Replies: 5 comments 30 replies
-
One of the issues with making this work for both |
Beta Was this translation helpful? Give feedback.
-
While debugging a discrepancy lately, it would have been wonderful to be able to write something like This should ideally also show instructions executed in kernel context. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the write-up @BGluth and apologies for not replying earlier. For now the flow is
Now back to the debugging tooling that we may benefit from having: Trie discrepancy tool 1We already have
Ideally, in case of a bad decoder processing, we could pass in a given block that we know is being badly processed, and for which, this tool would (at a high level):
Trie discrepancy tool 2In the case of a trie discrepancy between the decoder and the prover (i.e. the prover reconstructed a different trie), then a similar logic than 1 could be applied, but the tries to be compared would need to be fetched differently:
Some more details on what this tool could be covering was listed here: #415. Txn execution trace discrepancy toolProving failures may be due to txn execution discrepancies: say a user bytecode is wrongly executed which results in a completely arbitrary sequence of state transitions leading to a different ending world state trie, but for which using the previous tools wouldn't be of much help. Instead, it'd be nice to have a tool comparing the transaction trace fetchable from the node, to the one replicated in the prover KERNEL. There is already an issue for this matter here: #221 Where would this tooling lie?We could either have a standalone debugger crate gathering all these ressources, or modify the existing Footnotes
|
Beta Was this translation helpful? Give feedback.
-
Since this is a discussion: Do any of us really prefer the Display impl, that prints hashes as: |
Beta Was this translation helpful? Give feedback.
-
Had a discussion with @Nashtare and he asked me to provide some ideas here.
This will catch many errors incurred by the inconsistency between the tracer and witness, e.g. a txn trace that contains an account read that isn't resolvable (hit hashnode) in witness. |
Beta Was this translation helpful? Give feedback.
-
We're planning on making some (better) debugging tools to help diagnose issues when we find a block that fails. Check out #415 for a bit more info and .
So right now, it's pretty cumbersome to run the current suite of debugging tools whenever we need to. For example, currently if
evm_arithmetization
produces a final trie that differs from what we expect (ie. the trie state thattrace_decoder
arrived at), we have to manually insert lines intotrace_decoder
to output all/some of the intermediate trie states. We then have to sift through these serialized states and pass them intotrie_diff
ortrie_query
, which is fairly cumbersome and also error prone.It would be nice to automate this process as much as possible. Ideally, it would probably be best to get these diagnostics when something fails during proof generation. However, doing this would be a bit of work since producing useful output requires data that is internal to both
trace_decoder
&evm_arithmetization
. For example, if we realize that a specific trie at a given point within a block differs between whattrace_decoder
and what the EVM got, then the EVM trie needs to be passed back up totrace_decoder
(or vice versa).Note that doing this will require us to store all of the intermediate trie states in memory (because currently we generate a
Vec<GenerationInputs>
before starting any proof gen) instead of just mutating a single trie after each txn/segment. At first this might seem like this will significantly increase the amount of required memory, but it's important to also note that cloning aHashedPartialTrie
is very efficient, since all nodes are wrapped in anArc
, and multiple tries can point to the same trie subset. With this, the memory requirements are actually probably very cheap.I can see two decent ways to go about implementing this by doing (when a flag is passed into
zero_bin
):Currently I'm just considering identifying trie divergences between
trace_decoder
&evm_arithmetization
but we could also expand this later on to also make queries to a production full node (as a ground truth to determine which side is at fault).Finally, a few other things to consider:
mpt
&smt
tries, is there a nice way to unify these (IIRC @0xaatif was working on this)?evm_arithmetization
? Should it instead just dump stuff to disk on failure?Beta Was this translation helpful? Give feedback.
All reactions