Concordium / concordium-client

A command line client to interact with the concordium-node
Apache License 2.0
8 stars 6 forks source link

Client sometimes reports "No block with hash ..." while waiting for valid transaction to be committed #249

Open Bargsteen opened 1 year ago

Bargsteen commented 1 year ago

Bug Description The client waits for transactions to be committed and finalized by default. If a transaction is valid and eventually included in a finalized block, this waiting behavior should always succeed (as far as I know). But apparently, that is (no longer) the case.

Steps to Reproduce Not sure as it happened once while making some smart contract-related transactions. But it occurred during a contract update.

Expected Result

Transaction '18c2c67d50186e10c017bb911dfafcb33daed9fd9d2b697970533a2d35c65adb' sent to the baker.
Waiting for the transaction to be committed and finalized.
You may skip this step by interrupting the command using Ctrl-C (pass flag '--no-wait' to do this by default).
The transaction will still get processed and may be queried using
  'concordium-client transaction status 18c2c67d50186e10c017bb911dfafcb33daed9fd9d2b697970533a2d35c65adb'.
[13:51:21] Waiting for the transaction to be committed.....
Transaction is finalized into block 9418830e27ad7d557e29dbbe8a260c1e9829ec47641c6a617750ab639922b41a with status "success" and cost 4.639231 CCD (1838 NRG).
[13:51:26] Transaction finalized.
Successfully updated contract instance {"index":4190,"subindex":0} ('fibwasm') using the function 'receive'.

Actual Result

Transaction '617f2c80ba896cce7f8a7ec26102f0f8b70fa3d1c8bfeddbf544985d64e7d521' sent to the baker.
Waiting for the transaction to be committed and finalized.
You may skip this step by interrupting the command using Ctrl-C (pass flag '--no-wait' to do this by default).
The transaction will still get processed and may be queried using
  'concordium-client transaction status 617f2c80ba896cce7f8a7ec26102f0f8b70fa3d1c8bfeddbf544985d64e7d521'.
[14:18:42] Waiting for the transaction to be committed....
Error: No block with block with hash ee758c2aa8b75c5278e953ffbdea3de37bb0c1c94a5de5cd2637dcf00f94853f exists.

Also, the error message here is slightly off. Should have been: No block with hash:.

Versions

┆Issue is synchronized with this Jira Bug by Unito

abizjak commented 1 year ago

The cause of this is that when the transaction gets committed we then try to get schemas in all the blocks in which it is committed.

And some of those blocks might no longer exist since they can be pruned.

We can probably revise getTxContractInfoWithSchemas, where this error is caused, to not fail, but rather to not return the schema in the case it cannot find the block.