-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fix trie output when debugging final root mismatch #86
Conversation
@BGluth I ended up adding some labels for the final trie checks, as we always do this locally when debugging anyway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah LGTM!
PUSH 1 // initial trie data length | ||
global check_state_trie: | ||
%mpt_hash_state_trie %mload_global_metadata(@GLOBAL_METADATA_STATE_TRIE_DIGEST_AFTER) %assert_eq | ||
global check_txn_trie: | ||
%mpt_hash_txn_trie %mload_global_metadata(@GLOBAL_METADATA_TXN_TRIE_DIGEST_AFTER) %assert_eq | ||
global check_receipt_trie: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I guess we have been adding these in locally for so long that maybe it makes more sense just to get this into main. 🙃
} | ||
|
||
// Retrieve previous PC (before jumping to KernelPanic), to see if we reached | ||
// `hash_final_tries`. We will output debugging information on the final |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think you changed hash_final_tries
--> perform_final_checks
(which is a much better name).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, yes I did, thanks!
Upon Kernel failure when comparing resulting tries post txn execution, we recompute the tries that plonky2 internally calculated (if
log::Level::Debug
or deeper is enabled) for debugging.However it currently fails when the receipts contain more than 1 log because of a missing offset increment. This wasn't caught when failures were encountered among the integration tests here because none of them have actual logs.
This can be tested against the
log_opcode
tests by adding aPANIC
say before the final%jump(halt)
, and calling:RUST_LOG=debug cargo test --release --test log_opcode test_log_opcodes -- --ignored
which will result in an "
Computed receipts trie: Err(IntegerTooLarge)
" issue.The PR also: