mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-07 08:13:11 +00:00
Implement LOG* gas and remove panic (#1054)
* Implement LOG* gas and remove panic * Remove stubs
This commit is contained in:
parent
354664c86c
commit
08a061bc4d
@ -41,6 +41,7 @@ pub(crate) fn combined_kernel() -> Kernel {
|
||||
include_str!("asm/core/transfer.asm"),
|
||||
include_str!("asm/core/util.asm"),
|
||||
include_str!("asm/core/access_lists.asm"),
|
||||
include_str!("asm/core/log.asm"),
|
||||
include_str!("asm/core/selfdestruct_list.asm"),
|
||||
include_str!("asm/core/touched_addresses.asm"),
|
||||
include_str!("asm/core/precompiles/main.asm"),
|
||||
|
||||
75
evm/src/cpu/kernel/asm/core/log.asm
Normal file
75
evm/src/cpu/kernel/asm/core/log.asm
Normal file
@ -0,0 +1,75 @@
|
||||
// TODO: Implement receipts
|
||||
|
||||
global sys_log0:
|
||||
%check_static
|
||||
// stack: kexit_info, offset, size
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
// stack: kexit_info, offset, size
|
||||
DUP3 %mul_const(@GAS_LOGDATA) %add_const(@GAS_LOG)
|
||||
// stack: gas, kexit_info, offset, size
|
||||
%charge_gas
|
||||
%stack (kexit_info, offset, size) -> (kexit_info)
|
||||
EXIT_KERNEL
|
||||
|
||||
global sys_log1:
|
||||
%check_static
|
||||
// stack: kexit_info, offset, size, topic
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size, topic
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
// stack: kexit_info, offset, size, topic
|
||||
DUP3 %mul_const(@GAS_LOGDATA) %add_const(@GAS_LOG) %add_const(@GAS_LOGTOPIC)
|
||||
// stack: gas, kexit_info, offset, size, topic
|
||||
%charge_gas
|
||||
%stack (kexit_info, offset, size, topic) -> (kexit_info)
|
||||
EXIT_KERNEL
|
||||
|
||||
global sys_log2:
|
||||
%check_static
|
||||
// stack: kexit_info, offset, size, topic1, topic2
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size, topic1, topic2
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
// stack: kexit_info, offset, size, topic1, topic2
|
||||
DUP3 %mul_const(@GAS_LOGDATA) %add_const(@GAS_LOG) %add_const(@GAS_LOGTOPIC) %add_const(@GAS_LOGTOPIC)
|
||||
// stack: gas, kexit_info, offset, size, topic1, topic2
|
||||
%charge_gas
|
||||
%stack (kexit_info, offset, size, topic1, topic2) -> (kexit_info)
|
||||
EXIT_KERNEL
|
||||
global sys_log3:
|
||||
%check_static
|
||||
// stack: kexit_info, offset, size, topic1, topic2, topic3
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size, topic1, topic2, topic3
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
// stack: kexit_info, offset, size, topic1, topic2, topic3
|
||||
DUP3 %mul_const(@GAS_LOGDATA) %add_const(@GAS_LOG) %add_const(@GAS_LOGTOPIC) %add_const(@GAS_LOGTOPIC) %add_const(@GAS_LOGTOPIC)
|
||||
// stack: gas, kexit_info, offset, size, topic1, topic2, topic3
|
||||
%charge_gas
|
||||
%stack (kexit_info, offset, size, topic1, topic2, topic3) -> (kexit_info)
|
||||
EXIT_KERNEL
|
||||
|
||||
global sys_log4:
|
||||
%check_static
|
||||
// stack: kexit_info, offset, size, topic1, topic2, topic3, topic4
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size, topic1, topic2, topic3, topic4
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
// stack: kexit_info, offset, size, topic1, topic2, topic3, topic4
|
||||
DUP3 %mul_const(@GAS_LOGDATA) %add_const(@GAS_LOG) %add_const(@GAS_LOGTOPIC) %add_const(@GAS_LOGTOPIC) %add_const(@GAS_LOGTOPIC) %add_const(@GAS_LOGTOPIC)
|
||||
// stack: gas, kexit_info, offset, size, topic1, topic2, topic3, topic4
|
||||
%charge_gas
|
||||
%stack (kexit_info, offset, size, topic1, topic2, topic3, topic4) -> (kexit_info)
|
||||
EXIT_KERNEL
|
||||
@ -6,18 +6,3 @@ global sys_blockhash:
|
||||
global sys_prevrandao:
|
||||
// TODO: What semantics will this have for Edge?
|
||||
PANIC
|
||||
global sys_log0:
|
||||
%check_static
|
||||
PANIC
|
||||
global sys_log1:
|
||||
%check_static
|
||||
PANIC
|
||||
global sys_log2:
|
||||
%check_static
|
||||
PANIC
|
||||
global sys_log3:
|
||||
%check_static
|
||||
PANIC
|
||||
global sys_log4:
|
||||
%check_static
|
||||
PANIC
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user