Skip to content

Commit ec69830

Browse files
authored
core/vm: remove panic when address is not present (ethereum#30414)
Remove redundant address presence check in `makeGasSStoreFunc`. This PR simplifies the `makeGasSStoreFunc` function by removing the redundant check for address presence in the access list. The updated code now only checks for slot presence, streamlining the logic and eliminating unnecessary panic conditions. This change removes the unnecessary address presence check, simplifying the code and improving maintainability without affecting functionality. The previous panic condition was intended as a canary during the testing phases (i.e. _YOLOv2_) and is no longer needed.
1 parent c70b0a9 commit ec69830

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

core/vm/operations_acl.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,10 @@ func makeGasSStoreFunc(clearingRefund uint64) gasFunc {
3939
cost = uint64(0)
4040
)
4141
// Check slot presence in the access list
42-
if addrPresent, slotPresent := evm.StateDB.SlotInAccessList(contract.Address(), slot); !slotPresent {
42+
if _, slotPresent := evm.StateDB.SlotInAccessList(contract.Address(), slot); !slotPresent {
4343
cost = params.ColdSloadCostEIP2929
4444
// If the caller cannot afford the cost, this change will be rolled back
4545
evm.StateDB.AddSlotToAccessList(contract.Address(), slot)
46-
if !addrPresent {
47-
// Once we're done with YOLOv2 and schedule this for mainnet, might
48-
// be good to remove this panic here, which is just really a
49-
// canary to have during testing
50-
panic("impossible case: address was not present in access list during sstore op")
51-
}
5246
}
5347
value := common.Hash(y.Bytes32())
5448

0 commit comments

Comments
 (0)