mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-04 23:03:08 +00:00
Apply comments
This commit is contained in:
parent
9ba2b895b9
commit
bf21b278d8
@ -57,9 +57,8 @@ process_receipt_after_bloom:
|
||||
// Write transaction type if necessary. RLP_RAW contains, at index 0, the current transaction type.
|
||||
PUSH 0
|
||||
%mload_kernel(@SEGMENT_RLP_RAW)
|
||||
DUP1
|
||||
// stack: first_txn_byte, first_txn_byte, receipt_ptr, payload_len, status, new_cum_gas, txn_nb, new_cum_gas, txn_nb, retdest
|
||||
%eq_const(1) %jumpi(receipt_nonzero_type)
|
||||
// stack: first_txn_byte, receipt_ptr, payload_len, status, new_cum_gas, txn_nb, new_cum_gas, txn_nb, retdest
|
||||
DUP1 %eq_const(1) %jumpi(receipt_nonzero_type)
|
||||
DUP1 %eq_const(2) %jumpi(receipt_nonzero_type)
|
||||
// If we are here, we are dealing with a legacy transaction, and we do not need to write the type.
|
||||
POP
|
||||
|
||||
@ -108,9 +108,10 @@ global encode_receipt:
|
||||
// either RLP(RLP(receipt)) for Legacy transactions or RLP(txn_type||RLP(receipt)) for transactions of type 1 or 2.
|
||||
// First encode the wrapper prefix.
|
||||
DUP2 %mload_trie_data
|
||||
// stack: first_byte, rlp_pos, value_ptr, retdest
|
||||
// The first byte is either the transaction type or the first byte of the RLP encoding.
|
||||
DUP1 PUSH 3 GT %jumpi(encode_nonzero_receipt_type)
|
||||
// stack: first_value, rlp_pos, value_ptr, retdest
|
||||
// The first value is either the transaction type or the payload length.
|
||||
// Since the receipt contains at least the 256-bytes long bloom filter, payload_len > 3.
|
||||
DUP1 %lt_const(3) %jumpi(encode_nonzero_receipt_type)
|
||||
// If we are here, then the first byte is the payload length.
|
||||
%rlp_list_len
|
||||
// stack: rlp_receipt_len, rlp_pos, value_ptr, retdest
|
||||
@ -254,10 +255,7 @@ encode_nonzero_receipt_type:
|
||||
%mstore_rlp
|
||||
%increment
|
||||
// stack: rlp_pos, txn_type, old_rlp_pos, value_ptr, retdest
|
||||
SWAP1 POP
|
||||
// stack: rlp_pos, old_rlp_pos, value_ptr, retdest
|
||||
SWAP1 POP
|
||||
// stack: rlp_pos, value_ptr, retdest
|
||||
%stack (rlp_pos, txn_type, old_rlp_pos, value_ptr, retdest) -> (rlp_pos, value_ptr, retdest)
|
||||
// We replace `value_ptr` with `paylaod_len_ptr` so we can encode the rest of the data more easily
|
||||
SWAP1 %increment SWAP1
|
||||
// stack: rlp_pos, payload_len_ptr, retdest
|
||||
|
||||
@ -37,7 +37,7 @@ global mpt_load_receipt_trie_value:
|
||||
PROVER_INPUT(mpt) DUP1 %append_to_trie_data
|
||||
// If the first byte is less than 3, then it is the transaction type, equal to either 1 or 2.
|
||||
// In that case, we still need to load the payload length.
|
||||
PUSH 3 GT %jumpi(mpt_load_payload_len)
|
||||
%lt_const(3) %jumpi(mpt_load_payload_len)
|
||||
|
||||
mpt_load_after_type:
|
||||
// Load status.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user