Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy between transaction list [ADDRESS] and address cache [THE_SAME_ADDRESS] outputs #132

Closed
buhtignew opened this issue Jun 14, 2024 · 7 comments
Assignees
Labels
anomaly If something works not as expected

Comments

@buhtignew
Copy link
Collaborator

buhtignew commented Jun 14, 2024

I've run transaction list transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik and got
this output, while the address cache mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik reports as following:

Block heights for the checked addresses: {'mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik': [132356, 141256, 149190, 150340, 150374, 155588, 156516, 156875, 156877, 156883, 156889, 156891, 156893, 156895, 156899, 156901, 157618, 158957, 159434, 159718, 159801, 162591, 163417, 163424, 163432, 164184, 164194, 164648, 165461, 166566, 169325, 174137, 177498, 177655, 177992, 190206, 203607, 364760, 364793, 364806, 364881, 364893, 381560, 445930, 445940, 445944, 445945, 446677, 447458, 447628, 447635, 447961, 447964, 447967, 447985, 449109, 451439, 451444, 454036, 454060, 454248, 454268, 454287, 454292, 454297, 454300, 454302, 454343, 455622]}

Thus the number of blocks in address cache mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik output is 68, while the transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik -t reports only 61 transactions.

I've further compared transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik output with transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik -x -l and transaction list -x -o mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik -l outputs (the -x flag doesn't work on my side without the -l flag for the moment, as reported here) and got that the transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik has the following two transactions that are not present in the other two outputs:

{
    'txid': '567f27f433f4f91237315a67fa2b3a81d9577ef6744ffa1c094144ff9d8e1e98',
    'type': ['receive'],
    'value_received': 0.01,
    'confirmations': 0
}
{
    'txid': '17478f4d20e357d6b8d7d51e473190871b5ee46f8f1fdd70754ff5649651c688',
    'type': ['receive'],
    'value_received': 0.01,
    'confirmations': 0
}

(which is a kind of expected because those are probably my test with --sign and --send flags as per issue #109, but probably we have to decide what we should do with the invalid transactions for different command. Maybe we create another flag for them? (although it could be a big challenge to find a letter for that)).

The transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik -x -l have the following 14 transactions that are not reported in transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik output:

{
    'txid': '97e82554217ff486343833c1e8c7629d459b9a831496091da46b4096d2523815',
    'inputs': [
        {'sender': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 125.27}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 0.01},
        {'receivers': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 125.23}
    ],
    'blockheight': 132356
}
{
    'txid': '909863ab0e1c0f62cc0c6721bea140c2d0618d9dd7f4e7bd05ff735ce92cc1a6',
    'inputs': [
        {'sender': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 12.14}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 0.01},
        {'receivers': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 12.1}
    ],
    'blockheight': 141256
}
{
    'txid': '25e8b47ba2c3af7855795ddef71bad216d1e97e6b2896915f0c6a2e8959d6f98',
    'inputs': [
        {'sender': ['mtmKbmMHdcXXepscuNrwAfjsKLeZzdZdya'], 'value': 246.12}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mtmKbmMHdcXXepscuNrwAfjsKLeZzdZdya'], 'value': 0.01},
        {'receivers': ['mtmKbmMHdcXXepscuNrwAfjsKLeZzdZdya'], 'value': 246.08}
    ],
    'blockheight': 159718
}
{
    'txid': '278454001e425bb605f063478f05f9f40f165c3abdb9f87304e35fe2090eeef5',
    'inputs': [
        {'sender': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 78.73}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 0.01},
        {'receivers': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 78.69}
    ],
    'blockheight': 164648
}
{
    'txid': '4b73bf14988847d0760b0bad08037bb72028ee755252b9f969889b3a7b45d51d',
    'inputs': [
        {'sender': ['mkfuTykT6anzsRjYH7Lktc2hFuTqcGpha7'], 'value': 46.49}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 0.01},
        {'receivers': ['mkfuTykT6anzsRjYH7Lktc2hFuTqcGpha7'], 'value': 0.01},
        {'receivers': ['mkfuTykT6anzsRjYH7Lktc2hFuTqcGpha7'], 'value': 46.44}
    ],
    'blockheight': 165461
}
{
    'txid': '3d7f4a2f74f66e797f135aa75986e36b41e60bf3e2a9f24d6f043c3488b0753e',
    'inputs': [
        {'sender': ['mtmKbmMHdcXXepscuNrwAfjsKLeZzdZdya'], 'value': 234.98}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mtmKbmMHdcXXepscuNrwAfjsKLeZzdZdya'], 'value': 0.01},
        {'receivers': ['mtmKbmMHdcXXepscuNrwAfjsKLeZzdZdya'], 'value': 234.94}
    ],
    'blockheight': 177655
}
{
    'txid': 'b5d8f64d478bc88454b378ca9f28f980bae5a9c6529c65cc5b1d3333116a58b1',
    'inputs': [
        {'sender': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 78.24}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 0.01},
        {'receivers': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 78.2}
    ],
    'blockheight': 177992
}
{
    'txid': 'ace7596753fdd9fefa5efb3f39d758826cf7b30f57a06069d11467099634e83d',
    'inputs': [
        {'sender': ['mtmKbmMHdcXXepscuNrwAfjsKLeZzdZdya'], 'value': 3.17}
    ],
    'outputs': [
        {'receivers': ['mq7ZQ9hnZoQRthi4o1Gzork8pRciHNoePb'], 'value': 1.17},
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 1.0}
    ],
    'blockheight': 190206
}
{
    'txid': '9fc95a709bd279b5796bcbff1ac8ebab5832ef51d11a687c7e7e8435234fbf51',
    'inputs': [
        {'sender': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 57.68}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mwzox84gMy8TKdeBftrfpmwGVZnJJdaReg'], 'value': 0.01},
        {'receivers': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 57.64}
    ],
    'blockheight': 381560
}
{
    'txid': '9f7112ae517bf3b889f2d6a4a044bdc7eea180a60536682d93ca53e5578dfd74',
    'inputs': [
        {'sender': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 55.85}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 0.01},
        {'receivers': ['mie75nFHrNAHHKfQ141fWfWozdMnaec8mb'], 'value': 55.81}
    ],
    'blockheight': 381560
}
{
    'txid': '40000fd970a4b3b8c504a04293119c2391b382f0d6719f29fa23787803b3e1ea',
    'inputs': [
        {'sender': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 55.84}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 0.01},
        {'receivers': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 55.8}
    ],
    'blockheight': 447458
}
{
    'txid': '94666fe1616c9825e849a30b4d525facf4b0485f322857b743abcf0ee233f262',
    'inputs': [
        {'sender': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 53.03}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 0.01},
        {'receivers': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 52.99}
    ],
    'blockheight': 447458
}
{
    'txid': 'dbda4d2c42917ec3f574b5a3575a075ebac9002d9faa9f147b393b04ce17642b',
    'inputs': [
        {'sender': ['mwzox84gMy8TKdeBftrfpmwGVZnJJdaReg'], 'value': 0.01},
        {'sender': ['mwzox84gMy8TKdeBftrfpmwGVZnJJdaReg'], 'value': 0.01},
        {'sender': ['mwzox84gMy8TKdeBftrfpmwGVZnJJdaReg'], 'value': 1.899772}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mhAB5eDnEqvSAmHJooUMrNo4diaUVZxMLD'], 'value': 0.01},
        {
            'receivers': ['mwzox84gMy8TKdeBftrfpmwGVZnJJdaReg'],
            'value': 1.879772
        }
    ],
    'blockheight': 454036
}
{
    'txid': '65f6e45525410aa400acfe71ff5dca00cd38d563db9ef4a4e8447d7df0c88491',
    'inputs': [
        {'sender': ['mwzox84gMy8TKdeBftrfpmwGVZnJJdaReg'], 'value': 2.029772}
    ],
    'outputs': [
        {'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01},
        {'receivers': [], 'value': 0.01},
        {'receivers': ['mpmZCVusQ6WoWHcFTAizmEcqSXdu5YX5PV'], 'value': 0.01},
        {
            'receivers': ['mwzox84gMy8TKdeBftrfpmwGVZnJJdaReg'],
            'value': 1.989772
        }
    ],
    'blockheight': 454060
}

The transaction list -x -o mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik -l has the following transaction that is not present in transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik output:

{
    'txid': 'be636073feaf957eee8339f5c6dc8bbfdf21b2de53263b11d625f93cd65113bd',
    'inputs': [
        {'sender': ['mskxtnWBJ1bBYZxmHe8rTR5H8ayZEXvG35'], 'value': 0.1},
        {'sender': ['mskwPWmHNAV2yfKPDCs4Yt6WvSpfGbA64e'], 'value': 0.78666},
        {'sender': ['miHhMLaMWubq4Wx6SdTEqZcUHEGp8RKMZt'], 'value': 0.01},
        {'sender': ['mrnZpB5Wm1FDBBcZ1s1pdPHpQgzaLRteSr'], 'value': 0.01},
        {'sender': ['mx5MdsenFDZufFuwT9ND7BKQBzS4Hy9YUP'], 'value': 0.01},
        {'sender': ['muod79CKYh5jU4ki4zdoDijd8W2aSNeog5'], 'value': 0.01},
        {'sender': ['mq1jZAiu8NoL3U3Ed7YiDdfjmY5t6Zphvq'], 'value': 0.01},
        {'sender': ['mgLyx4nNSPjcimazmo5U2Z8khUiRZWq5hn'], 'value': 0.01},
        {'sender': ['miHhMLaMWubq4Wx6SdTEqZcUHEGp8RKMZt'], 'value': 0.01},
        {'sender': ['mwutmXuJEzDvfs59nKY47Unm3M8cszxhf9'], 'value': 0.01},
        {'sender': ['mgLyx4nNSPjcimazmo5U2Z8khUiRZWq5hn'], 'value': 0.01},
        {'sender': ['miHhMLaMWubq4Wx6SdTEqZcUHEGp8RKMZt'], 'value': 0.01},
        {'sender': ['miHhMLaMWubq4Wx6SdTEqZcUHEGp8RKMZt'], 'value': 0.01},
        {'sender': ['mgLyx4nNSPjcimazmo5U2Z8khUiRZWq5hn'], 'value': 0.01},
        {'sender': ['n1xC4Dkp48mbsJsMV3yYEho6adBmbjgqNV'], 'value': 0.01},
        {'sender': ['mgLyx4nNSPjcimazmo5U2Z8khUiRZWq5hn'], 'value': 0.01},
        {'sender': ['mrnZpB5Wm1FDBBcZ1s1pdPHpQgzaLRteSr'], 'value': 0.01},
        {'sender': ['miHhMLaMWubq4Wx6SdTEqZcUHEGp8RKMZt'], 'value': 0.01},
        {'sender': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'], 'value': 0.01}
    ],
    'outputs': [
        {
            'receivers': ['mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik'],
            'value': 0.01666
        },
        {'receivers': ['mmSLiMCoinTestnetBurnAddress1XU5fu'], 'value': 1.0}
    ],
    'blockheight': 149190
}

For your convenience here are the transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik -x -l and the transaction list -x -o mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik -l outputs I'm getting:
transaction_list_mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik_-x_-l(20240614).txt
transaction_list_-x_-o_mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik_-l(20240614).txt

@buhtignew buhtignew added the anomaly If something works not as expected label Jun 14, 2024
@d5000
Copy link

d5000 commented Jun 19, 2024

Thank you. I'm already working on the discrepancy, but this could take some time.

I'll think about what can be done with the unconfirmed transactions. pacli itself can't detect if they are invalid as it shows the result of a slimcoind command, so for example if you just created some transactions which are still unconfirmed they will be shown in the same way than old invalid transactions that still "hang" in your mempool.

I would prefer to not have to add another flag (e.g. "only-confirmed" or so) nor "mark" them in any special way (this is difficult, and also the user already sees that the txes are unconfirmed).

@d5000
Copy link

d5000 commented Jun 21, 2024

The inconsistencies are now probably solved. I had inconsistencies too with this address, and they disappeared now with the fix in commit 8d83d95.

The reason was that the address mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik is a P2TH address. For optimization reasons, however, I had excluded the P2TH accounts from the query which is called by transaction list (without -x) even if single addresses are queried. Only those transactions where other addresses from the wallet were also involved were displayed. I now added a check which will include the P2TH accounts in the case a P2TH address is queried. So far it worked.

Regarding the unconfirmed transactions, I have still not modified the policy, so this issue can stay open until this is solved.

@buhtignew
Copy link
Collaborator Author

The discrepancy is gone. Looking forward for your decision on what to do with the pending transactions.

@d5000 d5000 self-assigned this Jul 8, 2024
@d5000
Copy link

d5000 commented Aug 2, 2024

Almost a miracle but I found a good flag: --mempool or -m.

I have it implemented now (commit 6677030) in a way that only if you use this flag, unconfirmed transactions will be shown (alongside the confirmed ones).

Of course it doesn't work with -x as mempool txes are not part of the blockchain (was already added to the help).

A question: Do you think it's more helpful if -m includes "only" the unconfirmed transactions, or that it includes all transactions "including" the unconfirmed ones?

(Just as a help for decision: slimcoind getmemorypool shows all unconfirmed transactions in your mempool, but of course this is less straightforward for non-technical users.)

@buhtignew
Copy link
Collaborator Author

buhtignew commented Aug 2, 2024

A question: Do you think it's more helpful if -m includes "only" the unconfirmed transactions, or that it includes all transactions "including" the unconfirmed ones?

I don't really know which is better. If we opt for adding unconfirmed transactions into the list the strategy to have a list of the unconfirmed transaction only could be running the transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik -f [current_blockheight] -m, which means that by introducing the -m flag as a tool to have the full list of both confirmed and unconfirmed transactions we implicitly have also the tool to have a separate list of unconfirmed transactions as well while I'm not able at least right now to figure the analogous strategy, to have the full list of transactions as well, if the -m flag would mean "a separate list of unconfirmed transactions".
So if the above is correct it would be probably better to implement it as it's already implemented, i.e. as a flag to have the list of both confirmed and unconfirmed transactions.
However if I run transaction list mkwJijAwqXNFcEBxuC93j3Kni43wzXVuik -f 508014 -m right now, while we are on the block 508014 I'm getting the list of 103 transactions with both unconfirmed and confirmed transactions, from which the oldest one has 375659 confirmations.

What if we introduce another possible value for the -m flag, only?
So as those who just need to see the list of the mempool transactions would use transaction list -m only command.
While true would be the default value and would let people seeing the list of both confirmed and unconfirmed transactions.

Just as a help for decision: slimcoind getmemorypool shows all unconfirmed transactions in your mempool, but of course this is less straightforward for non-technical users.

Here is my slimcoind getmemorypool output:

    "version" : 1,
    "previousblockhash" : "1e4a99a5d9d0d5afd4194effc9590f5d9ac9e5387a007dc5a2a099faa28a15eb",
    "transactions" : [
    ],
    "coinbasevalue" : 11250000,
    "coinbaseflags" : "062f503253482f",
    "time" : 1722607160,
    "mintime" : 1722606693,
    "curtime" : 1722607160,
    "bits" : "1e00a806"
}

it doesn't seem to contain the pending transactions.

@d5000
Copy link

d5000 commented Aug 4, 2024

What if we introduce another possible value for the -m flag, only?

Good idea, I have implemented it in commit 766fdd1. I have pre-tested all variants but leave this open in the case you want to test it. If not (or everything works), the issue can be closed.

Regarding the getmemorypool issue, I have checked that and it seems that indeed some unconfirmed transactions aren't displayed by getmemorypool. These transactions may have been saved in the wallet file but are strangely not in the mempool. I can't do anything to change this behavior as this is the Slimcoin client.

@buhtignew
Copy link
Collaborator Author

Good idea, I have implemented it in commit 766fdd1.

Everything works. I'm closing this.

I can't do anything to change this behavior as this is the Slimcoin client.

Alright, I only had not clear how to use this command in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
anomaly If something works not as expected
Projects
None yet
Development

No branches or pull requests

2 participants