Skip to content

Commit ea04650

Browse files
committed
vm: drop redundant syscall guard from CanTransfer check
1 parent e073ff1 commit ea04650

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

execution/vm/evm.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,11 @@ func (evm *EVM) call(typ OpCode, caller accounts.Address, callerAddress accounts
307307

308308
if typ == CALL || typ == CALLCODE {
309309
// Fail if we're trying to transfer more than the available balance.
310-
// CanTransfer is only relevant for calls that may execute Transfer.
311-
// Zero-value calls short-circuit the balance check, and system calls
312-
// are excluded because they intentionally bypass Transfer semantics.
313-
if !syscall && !value.IsZero() {
310+
// Only check when value is non-zero — matching geth's short-circuit
311+
// behavior. Calling CanTransfer for zero-value calls (e.g. system
312+
// calls) creates spurious balance reads on the caller that pollute
313+
// the Block Access List (EIP-7928).
314+
if !value.IsZero() {
314315
canTransfer, err := evm.Context.CanTransfer(evm.intraBlockState, caller, value)
315316
if err != nil {
316317
return nil, mdgas.MdGas{}, err

0 commit comments

Comments
 (0)