Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(evm_arithmetization): Check for zero amount early in add_eth #322

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading