Skip to content

Commit

Permalink
perf: Check for zero amount early in 'add_eth'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashtare committed Jun 24, 2024
1 parent baecefc commit 6492246
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions evm_arithmetization/src/cpu/kernel/asm/core/transfer.asm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ global deduct_eth_insufficient_balance:
// Pre stack: addr, amount, redest
// Post stack: (empty)
global add_eth:
// stack: addr, amount, retdest
DUP2 ISZERO %jumpi(add_eth_zero_amount)
// stack: addr, amount, retdest
DUP1 %insert_touched_addresses
DUP1 %mpt_read_state_trie
Expand All @@ -84,7 +86,6 @@ global add_eth_new_account:
// stack: null_account_ptr, addr, amount, retdest
POP
// stack: addr, amount, retdest
DUP2 ISZERO %jumpi(add_eth_new_account_zero)
DUP1 %journal_add_account_created
%get_trie_data_size // pointer to new account we're about to create
// stack: new_account_ptr, addr, amount, retdest
Expand All @@ -100,7 +101,7 @@ global add_eth_new_account:
// stack: key, new_account_ptr, retdest
%jump(mpt_insert_state_trie)

add_eth_new_account_zero:
add_eth_zero_amount:
// stack: addr, amount, retdest
%pop2 JUMP

Expand Down

0 comments on commit 6492246

Please sign in to comment.