-
Notifications
You must be signed in to change notification settings - Fork 298
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
Transactions trie support #1232
Conversation
0125fdd
to
b1d5bfd
Compare
@@ -119,7 +127,7 @@ fn test_receipt_encoding() -> Result<()> { | |||
// Get the expected RLP encoding. | |||
let expected_rlp = rlp::encode(&rlp::encode(&receipt_1)); | |||
|
|||
let initial_stack = vec![retdest, 0.into(), 0.into()]; | |||
let initial_stack: Vec<U256> = vec![retdest, 0.into(), 0.into()]; |
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.
Those changes seem unnecessary, but they silenced the clippy warning of needless vec
(which is actually needed because of the Interpreter::new_with_kernel
expected parameter types).
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.
Looks good to me!
71f02cc
to
cb27a84
Compare
@wborgeaud Sorry for the force-push, the history got completely messed up during a rebase, and induced an error in one of the tests which was easier to just revert to the state of your review (commit fa63f90), and then do a clean merge followed by applying your comments. |
No worries, still looks good 👍 |
This reverts commit f49fbc8.
This PR updates the transaction trie with the processed transactions.
The transaction trie update is done as follows:
After reading and decoding each transaction from the prover inputs we copy the txn rlp and its size to the trie data segment. The pointer to this data is then used as payload for inserting a node with key RLP(txn_counter) in the transaction trie.
For hashing the transaction trie we implemented the function encode_txn. This function simply copies the rlp encoded transaction to the address received as input