diff --git a/evm_arithmetization/src/cpu/kernel/asm/core/access_lists.asm b/evm_arithmetization/src/cpu/kernel/asm/core/access_lists.asm index 8a487fed0..eda8c4fdd 100644 --- a/evm_arithmetization/src/cpu/kernel/asm/core/access_lists.asm +++ b/evm_arithmetization/src/cpu/kernel/asm/core/access_lists.asm @@ -15,8 +15,6 @@ global init_access_lists: // Reset access lists data. PUSH 0 %mstore_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_DATA_COST) - PUSH 0 %mstore_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_RLP_LEN) - PUSH 0 %mstore_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_RLP_START) // Store @U256_MAX at the beginning of the segment PUSH @SEGMENT_ACCESSED_ADDRESSES // ctx == virt == 0 diff --git a/evm_arithmetization/src/cpu/kernel/asm/transactions/common_decoding.asm b/evm_arithmetization/src/cpu/kernel/asm/transactions/common_decoding.asm index 5109f29af..6aff07187 100644 --- a/evm_arithmetization/src/cpu/kernel/asm/transactions/common_decoding.asm +++ b/evm_arithmetization/src/cpu/kernel/asm/transactions/common_decoding.asm @@ -122,14 +122,8 @@ %macro decode_and_store_access_list // stack: rlp_addr - DUP1 %mstore_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_RLP_START) - %decode_rlp_list_len - %stack (rlp_addr, len) -> (len, len, rlp_addr, %%after) - %jumpi(decode_and_store_access_list) - // stack: len, rlp_addr, %%after - POP SWAP1 POP - // stack: rlp_addr - %mload_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_RLP_START) DUP2 SUB %mstore_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_RLP_LEN) + %stack (rlp_addr) -> (rlp_addr, %%after) + %jump(decode_and_store_access_list) %%after: %endmacro @@ -143,7 +137,6 @@ %macro decode_and_store_blob_versioned_hashes // stack: rlp_addr - DUP1 %mstore_global_metadata(@GLOBAL_METADATA_BLOB_VERSIONED_HASHES_RLP_START) %decode_rlp_list_len %stack (rlp_addr, len) -> (len, len, rlp_addr, %%after) @@ -164,8 +157,6 @@ global decode_and_store_blob_versioned_hashes: // stack: len, rlp_addr DUP2 ADD // stack: end_rlp_addr, rlp_addr - // Store the RLP length. - %mload_global_metadata(@GLOBAL_METADATA_BLOB_VERSIONED_HASHES_RLP_START) DUP2 SUB %mstore_global_metadata(@GLOBAL_METADATA_BLOB_VERSIONED_HASHES_RLP_LEN) // stack: end_rlp_addr, rlp_addr PUSH @SEGMENT_TXN_BLOB_VERSIONED_HASHES // initial address to write to SWAP2 @@ -231,11 +222,13 @@ decode_and_store_blob_versioned_hashes_finish: // The access list is of the form `[[{20 bytes}, [{32 bytes}...]]...]`. global decode_and_store_access_list: + // stack: rlp_addr + %decode_rlp_list_len + // stack: rlp_addr, len + SWAP1 // stack: len, rlp_addr DUP2 ADD // stack: end_rlp_addr, rlp_addr - // Store the RLP length. - %mload_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_RLP_START) DUP2 SUB %mstore_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_RLP_LEN) SWAP1 decode_and_store_access_list_loop: // stack: rlp_addr, end_rlp_addr diff --git a/evm_arithmetization/src/cpu/kernel/asm/transactions/type_3.asm b/evm_arithmetization/src/cpu/kernel/asm/transactions/type_3.asm index fb551fb76..5b4ed8683 100644 --- a/evm_arithmetization/src/cpu/kernel/asm/transactions/type_3.asm +++ b/evm_arithmetization/src/cpu/kernel/asm/transactions/type_3.asm @@ -119,7 +119,6 @@ store_origin: PUSH @SEGMENT_TXN_BLOB_VERSIONED_HASHES // ctx 0 %memset // Reset the global metadata - PUSH 0 %mstore_global_metadata(@GLOBAL_METADATA_BLOB_VERSIONED_HASHES_RLP_LEN) PUSH 0 %mstore_global_metadata(@GLOBAL_METADATA_BLOB_VERSIONED_HASHES_LEN) // stack: (empty) %endmacro \ No newline at end of file diff --git a/evm_arithmetization/src/cpu/kernel/constants/global_metadata.rs b/evm_arithmetization/src/cpu/kernel/constants/global_metadata.rs index c81d4f4b2..53b2dd981 100644 --- a/evm_arithmetization/src/cpu/kernel/constants/global_metadata.rs +++ b/evm_arithmetization/src/cpu/kernel/constants/global_metadata.rs @@ -81,10 +81,6 @@ pub(crate) enum GlobalMetadata { TouchedAddressesLen, // Gas cost for the access list in type-1 txns. See EIP-2930. AccessListDataCost, - // Start of the access list in the RLP for type-1 txns. - AccessListRlpStart, - // Length of the access list in the RLP for type-1 txns. - AccessListRlpLen, // Boolean flag indicating if the txn is a contract creation txn. ContractCreation, IsPrecompileFromEoa, @@ -118,16 +114,12 @@ pub(crate) enum GlobalMetadata { /// The length of the transient storage segment. TransientStorageLen, - // Start of the blob versioned hashes in the RLP for type-3 txns. - BlobVersionedHashesRlpStart, - // Length of the blob versioned hashes in the RLP for type-3 txns. - BlobVersionedHashesRlpLen, // Number of blob versioned hashes contained in the current type-3 transaction. BlobVersionedHashesLen, } impl GlobalMetadata { - pub(crate) const COUNT: usize = 59; + pub(crate) const COUNT: usize = 55; /// Unscales this virtual offset by their respective `Segment` value. pub(crate) const fn unscale(&self) -> usize { @@ -173,8 +165,6 @@ impl GlobalMetadata { Self::CurrentCheckpoint, Self::TouchedAddressesLen, Self::AccessListDataCost, - Self::AccessListRlpStart, - Self::AccessListRlpLen, Self::ContractCreation, Self::IsPrecompileFromEoa, Self::CallStackDepth, @@ -192,8 +182,6 @@ impl GlobalMetadata { Self::InitialAccountsLinkedListLen, Self::InitialStorageLinkedListLen, Self::TransientStorageLen, - Self::BlobVersionedHashesRlpStart, - Self::BlobVersionedHashesRlpLen, Self::BlobVersionedHashesLen, ] } @@ -239,8 +227,6 @@ impl GlobalMetadata { Self::CurrentCheckpoint => "GLOBAL_METADATA_CURRENT_CHECKPOINT", Self::TouchedAddressesLen => "GLOBAL_METADATA_TOUCHED_ADDRESSES_LEN", Self::AccessListDataCost => "GLOBAL_METADATA_ACCESS_LIST_DATA_COST", - Self::AccessListRlpStart => "GLOBAL_METADATA_ACCESS_LIST_RLP_START", - Self::AccessListRlpLen => "GLOBAL_METADATA_ACCESS_LIST_RLP_LEN", Self::ContractCreation => "GLOBAL_METADATA_CONTRACT_CREATION", Self::IsPrecompileFromEoa => "GLOBAL_METADATA_IS_PRECOMPILE_FROM_EOA", Self::CallStackDepth => "GLOBAL_METADATA_CALL_STACK_DEPTH", @@ -263,8 +249,6 @@ impl GlobalMetadata { } Self::InitialStorageLinkedListLen => "GLOBAL_METADATA_INITIAL_STORAGE_LINKED_LIST_LEN", Self::TransientStorageLen => "GLOBAL_METADATA_TRANSIENT_STORAGE_LEN", - Self::BlobVersionedHashesRlpStart => "GLOBAL_METADATA_BLOB_VERSIONED_HASHES_RLP_START", - Self::BlobVersionedHashesRlpLen => "GLOBAL_METADATA_BLOB_VERSIONED_HASHES_RLP_LEN", Self::BlobVersionedHashesLen => "GLOBAL_METADATA_BLOB_VERSIONED_HASHES_LEN", } }