diff --git a/cannon/mipsevm/testutil/evm.go b/cannon/mipsevm/testutil/evm.go index b986711c2fc84..25f05f124baf6 100644 --- a/cannon/mipsevm/testutil/evm.go +++ b/cannon/mipsevm/testutil/evm.go @@ -120,7 +120,7 @@ func NewEVMEnv(contracts *ContractMetadata) (*vm.EVM, *state.StateDB) { copy(mipsCtorArgs[12:], contracts.Addresses.Oracle[:]) mipsDeploy := append(bytes.Clone(contracts.Artifacts.MIPS.Bytecode.Object), mipsCtorArgs[:]...) startingGas := uint64(30_000_000) - _, deployedMipsAddr, leftOverGas, err := env.Create(vm.AccountRef(contracts.Addresses.Sender), mipsDeploy, startingGas, common.U2560) + _, deployedMipsAddr, leftOverGas, err := env.Create(contracts.Addresses.Sender, mipsDeploy, startingGas, common.U2560) if err != nil { panic(fmt.Errorf("failed to deploy MIPS contract: %w. took %d gas", err, startingGas-leftOverGas)) } diff --git a/cannon/mipsevm/testutil/mips.go b/cannon/mipsevm/testutil/mips.go index 43de91f0962e7..3bafc36131725 100644 --- a/cannon/mipsevm/testutil/mips.go +++ b/cannon/mipsevm/testutil/mips.go @@ -27,7 +27,7 @@ import ( const maxStepGas = 20_000_000 type MIPSEVM struct { - sender vm.AccountRef + sender common.Address startingGas uint64 env *vm.EVM evmState *state.StateDB @@ -42,7 +42,7 @@ type MIPSEVM struct { func newMIPSEVM(contracts *ContractMetadata, opts ...evmOption) *MIPSEVM { env, evmState := NewEVMEnv(contracts) - sender := vm.AccountRef{0x13, 0x37} + sender := common.Address{0x13, 0x37} startingGas := uint64(maxStepGas) evm := &MIPSEVM{sender, startingGas, env, evmState, contracts.Addresses, nil, contracts.Artifacts, math.MaxUint64, nil, nil} for _, opt := range opts { @@ -264,7 +264,7 @@ func AssertEVMReverts(t *testing.T, state mipsevm.FPVMState, contracts *Contract env, evmState := NewEVMEnv(contracts) env.Config.Tracer = tracer sender := common.Address{0x13, 0x37} - ret, _, err := env.Call(vm.AccountRef(sender), contracts.Addresses.MIPS, input, startingGas, common.U2560) + ret, _, err := env.Call(sender, contracts.Addresses.MIPS, input, startingGas, common.U2560) require.EqualValues(t, err, vm.ErrExecutionReverted) matcher(t, ret) diff --git a/go.mod b/go.mod index 27ffa5d880796..993b5b6cb299b 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250228185245-d4bb112dc979 - github.com/ethereum/go-ethereum v1.15.1 + github.com/ethereum/go-ethereum v1.15.3 github.com/fatih/color v1.18.0 github.com/fsnotify/fsnotify v1.8.0 github.com/go-task/slim-sprig/v3 v3.0.0 @@ -256,7 +256,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101500.2-rc.3 +replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101503.0-rc.1 //replace github.com/ethereum/go-ethereum => ../op-geth diff --git a/go.sum b/go.sum index 43c36613eb9c4..7f9ad6f0c91d9 100644 --- a/go.sum +++ b/go.sum @@ -192,8 +192,8 @@ github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/u github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101500.2-rc.3 h1:rA/pwy10ep9RDK08x5F1fjkDh8BFUg7OtCAICTo43Kg= -github.com/ethereum-optimism/op-geth v1.101500.2-rc.3/go.mod h1:OMpyVMMy5zpAAHlR5s/aGbXRk+7cIKczUEIJj54APbY= +github.com/ethereum-optimism/op-geth v1.101503.0-rc.1 h1:8qSXpCfLvLIPlkmwO4J+J9chi9NgZlhRckVJEjxS5Lg= +github.com/ethereum-optimism/op-geth v1.101503.0-rc.1/go.mod h1:QUo3fn+45vWqJWzJW+rIzRHUV7NmhhHLPdI87mAn1M8= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250228185245-d4bb112dc979 h1:P37l7EFCz5KxE20+yPa3LWiH2Cg+xx6lQ4mOKYCZFPs= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250228185245-d4bb112dc979/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= diff --git a/mise.toml b/mise.toml index 11901cab175d3..ca63c38d44c1a 100644 --- a/mise.toml +++ b/mise.toml @@ -18,7 +18,7 @@ just = "1.37.0" "go:github.com/ethereum/go-ethereum/cmd/abigen" = "1.10.25" "go:gotest.tools/gotestsum" = "1.12.0" "go:github.com/vektra/mockery/v2" = "2.46.0" -"go:github.com/golangci/golangci-lint/cmd/golangci-lint" = "1.61.0" +"go:github.com/golangci/golangci-lint/cmd/golangci-lint" = "1.64.5" # Python dependencies "pipx:slither-analyzer" = "0.10.2" diff --git a/op-chain-ops/script/prank.go b/op-chain-ops/script/prank.go index cdea026063a20..2d4fda75b7d2f 100644 --- a/op-chain-ops/script/prank.go +++ b/op-chain-ops/script/prank.go @@ -33,41 +33,17 @@ type Prank struct { Broadcast bool } -// prankRef implements the vm.ContractRef interface, to mock a caller. -type prankRef struct { - prank common.Address - ref vm.ContractRef -} - -var _ vm.ContractRef = (*prankRef)(nil) - -func (p *prankRef) Address() common.Address { - return p.prank -} - -// Value returns the value send into this contract context. -// The delegate call tracer implicitly relies on this being implemented on ContractRef -func (p *prankRef) Value() *uint256.Int { - return p.ref.(interface{ Value() *uint256.Int }).Value() -} - -func (h *Host) handleCaller(caller vm.ContractRef) vm.ContractRef { +func (h *Host) handleCaller(caller common.Address) common.Address { // apply prank, if top call-frame had set up a prank if len(h.callStack) > 0 { parentCallFrame := h.callStack[len(h.callStack)-1] - if parentCallFrame.Prank != nil && caller.Address() != addresses.VMAddr { // pranks do not apply to the cheatcode precompile + if parentCallFrame.Prank != nil && caller != addresses.VMAddr { // pranks do not apply to the cheatcode precompile if parentCallFrame.Prank.Broadcast && parentCallFrame.LastOp == vm.CREATE2 && h.useCreate2Deployer { - return &prankRef{ - prank: DeterministicDeployerAddress, - ref: caller, - } + return DeterministicDeployerAddress } if parentCallFrame.Prank.Sender != nil { - return &prankRef{ - prank: *parentCallFrame.Prank.Sender, - ref: caller, - } + return *parentCallFrame.Prank.Sender } if parentCallFrame.Prank.Origin != nil { h.env.TxContext.Origin = *parentCallFrame.Prank.Origin diff --git a/op-chain-ops/script/script.go b/op-chain-ops/script/script.go index 65523ccbd27f2..e9553ff4172c6 100644 --- a/op-chain-ops/script/script.go +++ b/op-chain-ops/script/script.go @@ -346,7 +346,7 @@ func (h *Host) prelude(from common.Address, to *common.Address) { // Call calls a contract in the EVM. The state changes persist. func (h *Host) Call(from common.Address, to common.Address, input []byte, gas uint64, value *uint256.Int) (returnData []byte, leftOverGas uint64, err error) { h.prelude(from, &to) - return h.env.Call(vm.AccountRef(from), to, input, gas, value) + return h.env.Call(from, to, input, gas, value) } // LoadContract loads the bytecode of a contract, and deploys it with regular CREATE. @@ -386,7 +386,7 @@ func (h *Host) RememberArtifact(addr common.Address, artifact *foundry.Artifact, // This create function helps deploy contracts quickly for scripting etc. func (h *Host) Create(from common.Address, initCode []byte) (common.Address, error) { h.prelude(from, nil) - ret, addr, _, err := h.env.Create(vm.AccountRef(from), + ret, addr, _, err := h.env.Create(from, initCode, DefaultFoundryGasLimit, uint256.NewInt(0)) if err != nil { retStr := fmt.Sprintf("%x", ret) @@ -790,9 +790,6 @@ func (h *Host) LogCallStack() { for _, cf := range h.callStack { callsite := "" srcMap, ok := h.srcMaps[cf.Ctx.Address()] - if !ok && cf.Ctx.Contract.CodeAddr != nil { // if delegate-call, we might know the implementation code. - srcMap, ok = h.srcMaps[*cf.Ctx.Contract.CodeAddr] - } if ok { callsite = srcMap.FormattedInfo(cf.LastPC) if callsite == "unknown:0:0" && len(cf.LastJumps) > 0 { diff --git a/op-program/client/l2/fast_canon.go b/op-program/client/l2/fast_canon.go index 4b40786dd779d..52fe997d277f4 100644 --- a/op-program/client/l2/fast_canon.go +++ b/op-program/client/l2/fast_canon.go @@ -118,7 +118,7 @@ func (o *FastCanonicalBlockHeaderOracle) getHistoricalBlockHash(head *types.Head context := core.NewEVMBlockContext(head, o.ctx, nil, o.config, statedb) vmenv := vm.NewEVM(context, statedb, o.config, vm.Config{}) - var caller vm.AccountRef // can be anything as long as it's not the system contract + var caller common.Address // can be anything as long as it's not the system contract gas := uint64(1000000) var input [32]byte binary.BigEndian.PutUint64(input[24:], n)