-
Notifications
You must be signed in to change notification settings - Fork 790
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
Client: "Error: invalid transaction trie" leading to corrupted state DB #1066
Comments
My analysis so far: so this happens - as stated in the error - due to the transaction trie evaluated as being invalid. I had to look into the code, the transaction trie is simply the transactions from the block put into a trie by some keys and then compare the root hash with the hash stored in the block. So this is a static thing and a check should - normally - not be a problem, also a hint that this is rather a race condition, this will likely/eventually be somewhat hard to debug. What then happens is the following: in Anyhow: these can actually be treated as two different problems, fixing the I our case here though it is rather the case - since this is only a race condition - that we might want to just re-run the block (until we find the root cause of the race condition, so as a first-round fix) without deleting. There are two options here since at the moment we have no control over the delete code in a) We add a new option b) We take over the whole I am actually not sure here. 🤔 Maybe for now we stick with a) (I am not sure in general if it is a good idea to "abandon" the What do you guys think? |
Very weird that it seems we have a race condition on the You are right that if we delete a block, it should reset the head to a block in the past which worked as intended (up to the genesis block). However, I am pretty sure that when I refactored the blockchain package, I explicitly checked that this deletion stuff was correct - I think there are also tests for it. If you manually reset the head to the previous block, does the "bad block" then pass? (The problem here would be that the actual block which was executed is deleted from the DB). I think the best option would be (b), but I don't think we should remove |
At least I've now a local copy of an "invalid transaction trie" db. 😅 |
Can you dump the block body and the block header? That should be sufficient data to figure out what's going wrong (and possibly find the source of this error). |
Yeah, got it. 😄 This was actually not that easy since the block got deleted due to the error thrown. But I now added some additional debugging output messages and after 200.000 blocks or so the error got retriggered, this is the output: This is actually returning Without further digging in it just occurred to me that this error should actually not be triggered along the VM run but already on block addition since this is a relatively common case that we receive malformed data for some reason, and - tada - on a closer look it just is the case currently that we just don't have activated block validation on blockchain yet in the client, lol. 😋 I will activate along a PR with other fixes I am working on right now. Not sure yet how well the |
Side note: fixed various typos on the longer post above, please read on site. |
Fixed by #1075 |
Here is another one, this might be the last (occurring during the first 200.000 or so mainnet blocks, not related to some specific blocks though):
This one occurs during some - I would say - random PiT during block execution. Execution then stops and also doesn't resume on restarting the client, after merging of #1065 we will have some better output here. This is not related to a specific block, I re-ran the execution with a state DB backup and on the second run it passed the blocks where it broke the first time. So this is likely rather some race condition.
The text was updated successfully, but these errors were encountered: