mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 06:13:07 +00:00
Merge pull request #982 from toposware/sys_chainid
Use Block chain id for sys_chainid
This commit is contained in:
commit
58f4568e7c
@ -6,15 +6,6 @@ global sys_blockhash:
|
||||
global sys_prevrandao:
|
||||
// TODO: What semantics will this have for Edge?
|
||||
PANIC
|
||||
global sys_chainid:
|
||||
// TODO: Return the block's chain ID instead of the txn's, even though they should match.
|
||||
// stack: kexit_info
|
||||
%charge_gas_const(@GAS_BASE)
|
||||
// stack: kexit_info
|
||||
%mload_txn_field(@TXN_FIELD_CHAIN_ID)
|
||||
// stack: chain_id, kexit_info
|
||||
SWAP1
|
||||
EXIT_KERNEL
|
||||
global sys_log0:
|
||||
%check_static
|
||||
PANIC
|
||||
|
||||
@ -200,6 +200,19 @@ global sys_gaslimit:
|
||||
SWAP1
|
||||
EXIT_KERNEL
|
||||
|
||||
%macro blockchainid
|
||||
%mload_global_metadata(@GLOBAL_METADATA_BLOCK_CHAIN_ID)
|
||||
%endmacro
|
||||
|
||||
global sys_chainid:
|
||||
// stack: kexit_info
|
||||
%charge_gas_const(@GAS_BASE)
|
||||
// stack: kexit_info
|
||||
%blockchainid
|
||||
// stack: chain_id, kexit_info
|
||||
SWAP1
|
||||
EXIT_KERNEL
|
||||
|
||||
%macro basefee
|
||||
%mload_global_metadata(@GLOBAL_METADATA_BLOCK_BASE_FEE)
|
||||
%endmacro
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user