ain: `listaccounthistory` missing transactions
What happened:
listaccounthistory with option mine does not return all of my transactions. It only returns rewards from one pool and is missing rewards and commissions from the other one.
======================== List Account History =====================================
[
{
owner: 'dA',
blockHeight: 1004031,
blockHash: '056c2d535a846b71a4c776cc179b8f0995ae3a30f72b7f9dd8dd46788f84ec0a',
blockTime: 1626094701,
type: 'Rewards',
poolID: '6',
amounts: [ 'x.x@DFI' ]
},
{
owner: 'dA',
blockHeight: 1004030,
blockHash: '28143f1543003208d7e159da7d6cf87305aec0300a2de8e6a86b17959c665e87',
blockTime: 1626094805,
type: 'Rewards',
poolID: '6',
amounts: [ 'x.x@DFI' ]
},
...
]
What you expected to happen:
{
owner: 'dA',
blockHeight: 1004031,
blockHash: '056c2d535a846b71a4c776cc179b8f0995ae3a30f72b7f9dd8dd46788f84ec0a',
blockTime: 1626094701,
type: 'Rewards',
poolID: '6',
amounts: [ 'x.x@DFI' ]
},
{
owner: 'dB',
blockHeight: 1004031,
blockHash: '056c2d535a846b71a4c776cc179b8f0995ae3a30f72b7f9dd8dd46788f84ec0a',
blockTime: 1626094701,
type: 'Rewards',
poolID: '5',
amounts: [ 'x.x@DFI' ]
},
{
owner: 'dA',
blockHeight: 1004030,
blockHash: '28143f1543003208d7e159da7d6cf87305aec0300a2de8e6a86b17959c665e87',
blockTime: 1626094805,
type: 'Rewards',
poolID: '6',
amounts: [ 'x.x@DFI' ]
},
{
owner: 'dB',
blockHeight: 1004030,
blockHash: '28143f1543003208d7e159da7d6cf87305aec0300a2de8e6a86b17959c665e87',
blockTime: 1626094805,
type: 'Rewards',
poolID: '5',
amounts: [ 'x.x@DFI' ]
},
...
]
How to reproduce it (as minimally and precisely as possible):
listaccounthistory with option mine and no_rewards=false
What are your environment parameters:
Same behavior on Windows and OSX
defid.exe: v1.7.11
defi.conf:
rpcauth=usr:pw
rpcuser=usr
rpcpassword=pw
rpcconnect=127.0.0.1
testnet=0
regtest=0
[main]
rpcbind=127.0.0.1
rpcport=8555
spv=0
gen=0
wallet=some wallet.dat
walletdir=C:\Users\Usr\AppData\Roaming\DeFi Blockchain\wallets\main
checkpoints=0
[test]
rpcbind=127.0.0.1
rpcport=8555
Anything else we need to know?:
listaccounthistory with the explicit owner does return rewards which are not shown with mine
I used the jellyfish client to get the data:
const history = await this.jelly.client.account.listAccountHistory("mine", {
no_rewards: false,
});
Same behavior via export of transactions via the defichain app v2.5.2. Here all rewards and commissions of the pool 5 are missing.
Did a complete reindex with checkpoints=0 and spv=0 (see defi.conf)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 47 (20 by maintainers)
Fix
https://github.com/DeFiCh/ain/actions/runs/1425932251 When it’s ready you can get executable and test it. No reindex is required at all.
What happened:
Hello dear Tech Team,
I’m getting back to you (Had some discussions during the older nodes with @bvbfan) about the history of Liquidity Mining Rewards and Commissions.
I still get incomplete results back from the node after full synchronization. Tested with new Node 2.0.0.
The funny thing is that during the synchronization (I didn’t watch how long it will last) I get the complete history of the node back.
And when I am full sync, then no more.
Is there pruning at the end of the sync?
My test RPC call via CLI:
defi-cli.exe listaccounthistory mine {\"maxBlockHeight\":498600}and also with:
defi-cli.exe listaccounthistory dWq7uW6vRypHQ3E8YcgT7MhSw7F7KipYaY {\"maxBlockHeight\":498600}During Sync:
-> With Rewards and Commissions
After Full Sync:
-> It’s like lottery if there are Rewards or Commissions at blocks
Could it be that the node is too overloaded to read the DB if the wanted result are too far away from the current block? But this is also sometimes the case with newer blocks.
With luck, the information is in the history DB and only the node does not manage to read it completely?
Is there an easy way to read the history database that the node creates without the node? It is a level DB or? How is the database built with which key value pairs? Is there a documentation or someone who can show me something? I’m not a C++ expert, I don’t completely understand everything behind the code.
What you expected to happen:
I expect to get the matching rewards for each block as well. I think it would even be enough to save the rewards and commissions per pool per day and not to prune and throw away.
How to reproduce it (as minimally and precisely as possible):
Synchronized Node and try:
defi-cli.exe listaccounthistory dWq7uW6vRypHQ3E8YcgT7MhSw7F7KipYaY {"maxBlockHeight\":498600}-> It should return some rewards and commissions and not only 2 entries:
What are your environment parameters:
OS: Windows 10 CPU: 11th Gen Intel® Core™ i9-11900F @ 2.50GHz RAM: 32GB
@gamsterx - thanks for both the report and following up on this! I believe this was autoclosed with the PR merge. Let us have a look into this in the next few days and evaluate if we need to re-open again. Appreciate your patience!