Spec ExecutionState::{EndTx,EndBlock}#88
Conversation
fd9dd07 to
c0eb981
Compare
ExecutionState::{EndTx,EndBlock}ExecutionState::{EndTx,EndBlock}
13d7187 to
dd06110
Compare
CPerezz
left a comment
There was a problem hiding this comment.
Should we also file issues for the TODOs that we will leave with this PR?
| hash = rlc_store.to_rlc(keccak256(bytecode), 32) | ||
| rlc = rlc_store.to_rlc(list(reversed(bytecode))) | ||
| hash = RLC(bytes(reversed(keccak256(bytecode))), randomness) | ||
| rlc = RLC(bytes(reversed(bytecode)), randomness, len(bytecode)) |
There was a problem hiding this comment.
Question: Which is the purpose of applying the RLC to the keccak inputs? Hasn't it been done previously in assign_bytecode_circuit?
Also, why do we need to reversethe bytecodet?
There was a problem hiding this comment.
Which is the purpose of applying the RLC to the keccak inputs? Hasn't it been done previously in
assign_bytecode_circuit?
This is a mocking keccak_table, for lookup the hash by RLC of bytecode and length.
Also, why do we need to reversethe bytecodet?
Because in bytecode circuit, it accumulates the bytes in big-endian order, so we need to reverse it for RLC, which takes input as little-endian.
This PR aims to spec
ExecutionState::EndTxandExecutionState::EndBlock, for enable EVM circuit to verify block consists of minimal transaction. WithBeginTx,EndTxandEndBlock, the finite state machine diagram will look like:The
EndTxaims to handle tx refund to signer, and tx fee to coinbase.The
EndBlockaims to pad the EVM circuit to the fixed capacity, and checkstx_idandrw_counterat the last step.Also it refactors random linear combination usage, to make things more straightforward. Regardless of the refactors, please refer to
end_tx.pyandend_block.pyfor spec itself.TODO
ExecutionState::EndTxExecutionState::EndBlock