mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 14:23:07 +00:00
parent
11a03c5ebc
commit
67a3edb2f1
@ -35,9 +35,7 @@ global pop_and_return_success:
|
||||
// stack: retdest
|
||||
%mload_txn_field(@TXN_FIELD_TO)
|
||||
// stack: addr, retdest
|
||||
DUP1 %ge_const(@ECREC) DUP2 %le_const(@BLAKE2_F)
|
||||
// stack: addr<=9, addr>=1, addr, retdest
|
||||
MUL // Cheaper than AND
|
||||
DUP1 %is_precompile
|
||||
%jumpi(handle_precompiles_from_eoa)
|
||||
// stack: addr, retdest
|
||||
POP
|
||||
|
||||
@ -28,11 +28,24 @@
|
||||
// stack: to == 0
|
||||
%endmacro
|
||||
|
||||
%macro is_precompile
|
||||
// stack: addr
|
||||
DUP1 %ge_const(@ECREC) SWAP1 %le_const(@BLAKE2_F)
|
||||
// stack: addr>=1, addr<=9
|
||||
MUL // Cheaper than AND
|
||||
%endmacro
|
||||
|
||||
// Returns 1 if the account is non-existent, 0 otherwise.
|
||||
%macro is_non_existent
|
||||
// stack: addr
|
||||
%mpt_read_state_trie
|
||||
ISZERO
|
||||
DUP1
|
||||
// stack: addr, addr
|
||||
%mpt_read_state_trie ISZERO
|
||||
SWAP1
|
||||
// stack: addr, zero_state_trie
|
||||
%is_precompile ISZERO
|
||||
// stack: not_precompile, zero_state_trie
|
||||
MUL // Cheaper than AND
|
||||
%endmacro
|
||||
|
||||
// Returns 1 if the account is empty, 0 otherwise.
|
||||
@ -65,5 +78,5 @@
|
||||
// stack: addr
|
||||
DUP1 %is_non_existent
|
||||
SWAP1 %is_empty
|
||||
ADD // OR
|
||||
OR
|
||||
%endmacro
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user