Open TimDaub opened 2 months ago
Hi Tim! Thanks for submitting the issue. It's going to be hard for us to prioritize troubleshooting an issue from an older release (we've been on v6 for quite some time, and are looking at v7 shortly). Would you be able to upgrade your dependencies to use the latest ethjs versions?
From reading the error messages, the issue seems to come from whatever is passed down to _updateNode. You are passing the key/value fields, but the keyRemained and stack are empty. Stack can't be empty in this context. I would recommend logging the stack upstream and seeing if that gives more clarity into the issue.
Pretty sure revert, checkpoint and commit are faulty. I removed the entire logic now from my code base and I haven't run into these issues anymore. I'm pretty sure that if I create a checkpoint and add a ton of data and then my program panics without commit then there are issues with this library
Hmm. We might want to add on the suite of test cases, that might be the most realistic way to catch that. 🤔
For trie itself we are not as good tested as for state manager (regarding the checkpointing logic).
(can you guys nevertheless move over to v6? Or do you need to keep v5 for now?)
We sadly don't have budget to move to v6 as of now. That code is mission critical and very costly to maintain because it is related to our set reconciliation algorithm. Not something I wanna mess with unless absolutely necessary, as it currently works, and since it is hard to get working in the first place. We run Kiwi News through self-funding etc., so we've been focusing as much as we can on making money to pay rent. I'm hopeful that we'll manage to upgrade some time in the future!
Code: https://github.com/attestate/kiwistand/blob/7060bd6573f8b966d40e6af07d18d6ac2cb4a926/src/store.mjs#L282-L319
You can find the message in the logs and the index. I'm using v5.0.4
It seems to be this line which is faulty: https://github.com/ethereumjs/ethereumjs-monorepo/blob/295e5a3caa69c226e8f8edfad4ea72a843bc0b4f/packages/trie/src/trie/trie.ts#L377
I went in my ethereumjs/trie/dist/trie/trie.js and added a console log of all the function's inputs
this is what I get for the stack overflow throwing message