Skip to content

Commit 3d0604b

Browse files
georgehaoThegaram
andauthored
Fix/delegated code failed witness missing (#1270)
* fix delegatedcode failed witness missing * bump version * fix internal transfer * chore: auto version bump [bot] * re-run ci * revert re-run change --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Thegaram <[email protected]>
1 parent d67dd0b commit 3d0604b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

core/vm/evm.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
190190
}
191191
// Fail if we're trying to transfer more than the available balance
192192
if value.Sign() != 0 && !evm.Context.CanTransfer(evm.StateDB, caller.Address(), value) {
193+
// EIP-7702: Ensure delegated code is loaded into witness even when balance check fails.
194+
// revm always loads the code regardless of balance check result.
195+
if code := evm.StateDB.GetCode(addr); len(code) > 0 {
196+
if target, ok := types.ParseDelegation(code); ok {
197+
evm.StateDB.GetCode(target)
198+
}
199+
}
193200
return nil, gas, ErrInsufficientBalance
194201
}
195202
snapshot := evm.StateDB.Snapshot()

params/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
const (
2525
VersionMajor = 5 // Major version component of the current release
2626
VersionMinor = 10 // Minor version component of the current release
27-
VersionPatch = 2 // Patch version component of the current release
27+
VersionPatch = 3 // Patch version component of the current release
2828
VersionMeta = "mainnet" // Version metadata to append to the version string
2929
)
3030

0 commit comments

Comments
 (0)