Skip to content

Commit

Permalink
Enable withdrawals only for Eth mainnet (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashtare committed Sep 10, 2024
1 parent bfdc6c3 commit 188397d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
5 changes: 3 additions & 2 deletions evm_arithmetization/src/cpu/kernel/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use crate::cpu::kernel::parser::parse;
pub const NUMBER_KERNEL_FILES: usize = if cfg!(feature = "eth_mainnet") {
157
} else if cfg!(feature = "cdk_erigon") {
156
} else if cfg!(feature = "polygon_pos") {
155
} else if cfg!(feature = "polygon_pos") {
154
} else {
// unreachable
0
Expand Down Expand Up @@ -54,6 +54,7 @@ pub static KERNEL_FILES: [&str; NUMBER_KERNEL_FILES] = [
include_str!("asm/core/log.asm"),
include_str!("asm/core/selfdestruct_list.asm"),
include_str!("asm/core/touched_addresses.asm"),
#[cfg(feature = "eth_mainnet")]
include_str!("asm/core/withdrawals.asm"),
include_str!("asm/core/precompiles/main.asm"),
include_str!("asm/core/precompiles/ecrec.asm"),
Expand Down
18 changes: 14 additions & 4 deletions evm_arithmetization/src/cpu/kernel/asm/main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ global start_txns:
global txn_loop:
// If the prover has no more txns for us to process, halt.
PROVER_INPUT(end_of_txns)
%jumpi(execute_withdrawals)
#[cfg(feature = eth_mainnet)]
{
%jumpi(execute_withdrawals)
}
#[cfg(not(feature = eth_mainnet))]
{
%jumpi(perform_final_checks)
}

// Call route_txn. When we return, we will process the txn receipt.
PUSH txn_loop_after
Expand All @@ -171,9 +178,12 @@ global txn_loop_after:
// stack: new_cum_gas, txn_counter, num_nibbles, new_txn_number
%jump(txn_loop)

global execute_withdrawals:
// stack: cum_gas, txn_counter, num_nibbles, txn_nb
%withdrawals
#[cfg(feature = eth_mainnet)]
{
global execute_withdrawals:
// stack: cum_gas, txn_counter, num_nibbles, txn_nb
%withdrawals
}

global perform_final_checks:
// stack: cum_gas, txn_counter, num_nibbles, txn_nb
Expand Down

0 comments on commit 188397d

Please sign in to comment.