mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 14:23:07 +00:00
Fix LOG* gas (#1086)
This commit is contained in:
parent
68b15ea503
commit
56e7ad0037
@ -3,11 +3,13 @@
|
||||
global sys_log0:
|
||||
%check_static
|
||||
// stack: kexit_info, offset, size
|
||||
DUP3 ISZERO %jumpi(log0_after_mem_gas)
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
log0_after_mem_gas:
|
||||
// stack: kexit_info, offset, size
|
||||
DUP3 %mul_const(@GAS_LOGDATA) %add_const(@GAS_LOG)
|
||||
// stack: gas, kexit_info, offset, size
|
||||
@ -18,11 +20,13 @@ global sys_log0:
|
||||
global sys_log1:
|
||||
%check_static
|
||||
// stack: kexit_info, offset, size, topic
|
||||
DUP3 ISZERO %jumpi(log1_after_mem_gas)
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size, topic
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
log1_after_mem_gas:
|
||||
// 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
|
||||
@ -33,25 +37,30 @@ global sys_log1:
|
||||
global sys_log2:
|
||||
%check_static
|
||||
// stack: kexit_info, offset, size, topic1, topic2
|
||||
DUP3 ISZERO %jumpi(log2_after_mem_gas)
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size, topic1, topic2
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
log2_after_mem_gas:
|
||||
// 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 ISZERO %jumpi(log3_after_mem_gas)
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size, topic1, topic2, topic3
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
log3_after_mem_gas:
|
||||
// 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
|
||||
@ -62,11 +71,13 @@ global sys_log3:
|
||||
global sys_log4:
|
||||
%check_static
|
||||
// stack: kexit_info, offset, size, topic1, topic2, topic3, topic4
|
||||
DUP3 ISZERO %jumpi(log4_after_mem_gas)
|
||||
DUP3 DUP3
|
||||
%add_or_fault
|
||||
// stack: offset+size, kexit_info, offset, size, topic1, topic2, topic3, topic4
|
||||
DUP1 %ensure_reasonable_offset
|
||||
%update_mem_bytes
|
||||
log4_after_mem_gas:
|
||||
// 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user