Skip to content

Commit 7f811b7

Browse files
committed
Update balance summaries to ensure GAS_CELL is greater 0.
1 parent dd0642c commit 7f811b7

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

kevm-pyk/src/kevm_pyk/kproj/evm-semantics/summaries/balance-normal-summary.k

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ module BALANCE-NORMAL-SUMMARY
110110
requires ( USEGAS_CELL:Bool
111111
andBool ( Ghasaccesslist << SCHEDULE_CELL:Schedule >>
112112
andBool ( #if ( W0:Int modInt pow160 ) in ACCESSEDACCOUNTS_CELL:Set #then Gwarmstorageread < SCHEDULE_CELL:Schedule > #else Gcoldaccountaccess < SCHEDULE_CELL:Schedule > #fi <=Int GAS_CELL:Int
113+
andBool ( 0 <=Int GAS_CELL:Int
113114
andBool ( ( W0:Int modInt pow160 ) ==Int ACCTID:Int
114-
))))
115+
)))))
115116
[priority(20), label(BALANCE-NORMAL-SUMMARY-USEGAS-BERLIN)]
116117

117118
rule [BALANCE-NORMAL-SUMMARY-USEGAS]: <kevm>

kevm-pyk/src/kevm_pyk/kproj/evm-semantics/summaries/balance-owise-summary.k

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ module BALANCE-OWISE-SUMMARY
110110
requires ( USEGAS_CELL:Bool
111111
andBool ( Ghasaccesslist << SCHEDULE_CELL:Schedule >>
112112
andBool ( #if ( W0:Int modInt pow160 ) in ACCESSEDACCOUNTS_CELL:Set #then Gwarmstorageread < SCHEDULE_CELL:Schedule > #else Gcoldaccountaccess < SCHEDULE_CELL:Schedule > #fi <=Int GAS_CELL:Int
113+
andBool ( 0 <=Int GAS_CELL:Int
113114
andBool ( ( W0:Int modInt pow160 ) ==Int ACCTID:Int
114-
))))
115+
)))))
115116
[priority(20), label(BALANCE-OWISE-SUMMARY-USEGAS-BERLIN)]
116117

117118
rule [BALANCE-OWISE-SUMMARY-USEGAS]: <kevm>

kevm-pyk/src/kevm_pyk/summarizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def _transform_inf_gas_aux(inner: KInner) -> KInner:
499499
]
500500
)
501501

502-
if rule_id in ['BALANCE-NORMAL-SUMMARY-BERLIN', 'BALANCE-OWISE-SUMMARY-BERLIN']:
502+
if rule_id in ['BALANCE-NORMAL-SUMMARY-USEGAS-BERLIN', 'BALANCE-OWISE-SUMMARY-USEGAS-BERLIN']:
503503
requires = andBool([requires, leInt(KToken('0', 'Int'), KVariable('GAS_CELL', 'Int'))])
504504

505505
return body, requires

0 commit comments

Comments
 (0)