From 1dd191bc0109ddfe181a9f9a37df6b90b2073df9 Mon Sep 17 00:00:00 2001 From: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Date: Mon, 17 Feb 2025 14:54:34 +0800 Subject: [PATCH 01/11] feat: remove the restriction on pre-compile & restore results of opcode BLOCKHASH --- core/vm/contracts.go | 96 +++++++++++++++++++++++++++++++++++++---- core/vm/instructions.go | 33 ++++++++------ core/vm/interpreter.go | 2 + core/vm/jump_table.go | 8 ++++ params/config.go | 9 +++- 5 files changed, 124 insertions(+), 24 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 34b4b16ee..d95faa2da 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -20,6 +20,7 @@ import ( "crypto/sha256" "encoding/binary" "errors" + "fmt" "math/big" "github.com/morph-l2/go-ethereum/common" @@ -28,6 +29,7 @@ import ( "github.com/morph-l2/go-ethereum/crypto/blake2b" "github.com/morph-l2/go-ethereum/crypto/bls12381" "github.com/morph-l2/go-ethereum/crypto/bn256" + "github.com/morph-l2/go-ethereum/crypto/kzg4844" "github.com/morph-l2/go-ethereum/params" //lint:ignore SA1019 Needed for precompile @@ -125,6 +127,21 @@ var PrecompiledContractsBernoulli = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{9}): &blake2FDisabled{}, } +// PrecompiledContractsQianxuesen contains the default set of pre-compiled Ethereum +// contracts used in the Qainxuesen release. +var PrecompiledContractsQianxuesen = map[common.Address]PrecompiledContract{ + common.BytesToAddress([]byte{0x1}): &ecrecover{}, + common.BytesToAddress([]byte{0x2}): &sha256hash{}, + common.BytesToAddress([]byte{0x3}): &ripemd160hash{}, + common.BytesToAddress([]byte{0x4}): &dataCopy{}, + common.BytesToAddress([]byte{0x5}): &bigModExp{eip2565: true}, + common.BytesToAddress([]byte{0x6}): &bn256AddIstanbul{}, + common.BytesToAddress([]byte{0x7}): &bn256ScalarMulIstanbul{}, + common.BytesToAddress([]byte{0x8}): &bn256PairingIstanbul{}, + common.BytesToAddress([]byte{0x9}): &blake2F{}, + common.BytesToAddress([]byte{0xa}): &kzgPointEvaluation{}, +} + // PrecompiledContractsBLS contains the set of pre-compiled Ethereum // contracts specified in EIP-2537. These are exported for testing purposes. var PrecompiledContractsBLS = map[common.Address]PrecompiledContract{ @@ -140,6 +157,7 @@ var PrecompiledContractsBLS = map[common.Address]PrecompiledContract{ } var ( + PrecompiledAddressesQianxuesen []common.Address PrecompiledAddressesBernoulli []common.Address PrecompiledAddressesArchimedes []common.Address PrecompiledAddressesBerlin []common.Address @@ -167,11 +185,16 @@ func init() { for k := range PrecompiledContractsBernoulli { PrecompiledAddressesBernoulli = append(PrecompiledAddressesBernoulli, k) } + for k := range PrecompiledContractsQianxuesen { + PrecompiledAddressesQianxuesen = append(PrecompiledAddressesQianxuesen, k) + } } // ActivePrecompiles returns the precompiles enabled with the current configuration. func ActivePrecompiles(rules params.Rules) []common.Address { switch { + case rules.IsQianxuesen: + return PrecompiledAddressesQianxuesen case rules.IsBernoulli: return PrecompiledAddressesBernoulli case rules.IsArchimedes: @@ -437,11 +460,6 @@ func (c *bigModExp) Run(input []byte) ([]byte, error) { expLen = expLenBigInt.Uint64() modLen = modLenBigInt.Uint64() ) - // Check that all inputs are `u256` (32 - bytes) or less, revert otherwise - var lenLimit = new(big.Int).SetInt64(32) - if baseLenBigInt.Cmp(lenLimit) > 0 || expLenBigInt.Cmp(lenLimit) > 0 || modLenBigInt.Cmp(lenLimit) > 0 { - return nil, errModexpUnsupportedInput - } if len(input) > 96 { input = input[96:] } else { @@ -578,10 +596,6 @@ var ( // runBn256Pairing implements the Bn256Pairing precompile, referenced by both // Byzantium and Istanbul operations. func runBn256Pairing(input []byte) ([]byte, error) { - // Allow at most 4 inputs - if len(input) > 4*192 { - return nil, errBadPairingInput - } // Handle some corner cases cheaply if len(input)%192 > 0 { return nil, errBadPairingInput @@ -1130,3 +1144,67 @@ func (c *bls12381MapG2) Run(input []byte) ([]byte, error) { // Encode the G2 point to 256 bytes return g.EncodePoint(r), nil } + +// kzgPointEvaluation implements the EIP-4844 point evaluation precompile. +type kzgPointEvaluation struct{} + +// RequiredGas estimates the gas required for running the point evaluation precompile. +func (b *kzgPointEvaluation) RequiredGas(input []byte) uint64 { + return params.BlobTxPointEvaluationPrecompileGas +} + +const ( + blobVerifyInputLength = 192 // Max input length for the point evaluation precompile. + blobCommitmentVersionKZG uint8 = 0x01 // Version byte for the point evaluation precompile. + blobPrecompileReturnValue = "000000000000000000000000000000000000000000000000000000000000100073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001" +) + +var ( + errBlobVerifyInvalidInputLength = errors.New("invalid input length") + errBlobVerifyMismatchedVersion = errors.New("mismatched versioned hash") + errBlobVerifyKZGProof = errors.New("error verifying kzg proof") +) + +// Run executes the point evaluation precompile. +func (b *kzgPointEvaluation) Run(input []byte) ([]byte, error) { + if len(input) != blobVerifyInputLength { + return nil, errBlobVerifyInvalidInputLength + } + // versioned hash: first 32 bytes + var versionedHash common.Hash + copy(versionedHash[:], input[:]) + + var ( + point kzg4844.Point + claim kzg4844.Claim + ) + // Evaluation point: next 32 bytes + copy(point[:], input[32:]) + // Expected output: next 32 bytes + copy(claim[:], input[64:]) + + // input kzg point: next 48 bytes + var commitment kzg4844.Commitment + copy(commitment[:], input[96:]) + if kZGToVersionedHash(commitment) != versionedHash { + return nil, errBlobVerifyMismatchedVersion + } + + // Proof: next 48 bytes + var proof kzg4844.Proof + copy(proof[:], input[144:]) + + if err := kzg4844.VerifyProof(commitment, point, claim, proof); err != nil { + return nil, fmt.Errorf("%w: %v", errBlobVerifyKZGProof, err) + } + + return common.Hex2Bytes(blobPrecompileReturnValue), nil +} + +// kZGToVersionedHash implements kzg_to_versioned_hash from EIP-4844 +func kZGToVersionedHash(kzg kzg4844.Commitment) common.Hash { + h := sha256.Sum256(kzg[:]) + h[0] = blobCommitmentVersionKZG + + return h +} diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 240135381..3628abf27 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -455,22 +455,27 @@ func opBlockhash(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ( lower = upper - 256 } if num64 >= lower && num64 < upper { - chainId := interpreter.evm.ChainConfig().ChainID - chainIdBuf := make([]byte, 8) - binary.BigEndian.PutUint64(chainIdBuf, chainId.Uint64()) - num64Buf := make([]byte, 8) - binary.BigEndian.PutUint64(num64Buf, num64) - - if interpreter.hasher == nil { - interpreter.hasher = sha3.NewLegacyKeccak256().(keccakState) + if interpreter.evm.chainRules.IsQianxuesen { + res := interpreter.evm.Context.GetHash(num64) + num.SetBytes(res[:]) } else { - interpreter.hasher.Reset() + chainId := interpreter.evm.ChainConfig().ChainID + chainIdBuf := make([]byte, 8) + binary.BigEndian.PutUint64(chainIdBuf, chainId.Uint64()) + num64Buf := make([]byte, 8) + binary.BigEndian.PutUint64(num64Buf, num64) + + if interpreter.hasher == nil { + interpreter.hasher = sha3.NewLegacyKeccak256().(keccakState) + } else { + interpreter.hasher.Reset() + } + interpreter.hasher.Write(chainIdBuf) + interpreter.hasher.Write(num64Buf) + interpreter.hasher.Read(interpreter.hasherBuf[:]) + + num.SetBytes(interpreter.hasherBuf[:]) } - interpreter.hasher.Write(chainIdBuf) - interpreter.hasher.Write(num64Buf) - interpreter.hasher.Read(interpreter.hasherBuf[:]) - - num.SetBytes(interpreter.hasherBuf[:]) } else { num.Clear() } diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index c4eb04832..d89fdae3b 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -74,6 +74,8 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { if cfg.JumpTable[STOP] == nil { var jt JumpTable switch { + case evm.chainRules.IsQianxuesen: + jt = qianxuesenInstructionSet case evm.chainRules.IsDarwin: jt = darwinInstructionSet case evm.chainRules.IsCurie: diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index ddefbfc74..a291f1fa7 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -61,11 +61,19 @@ var ( shanghaiInstructionSet = newShanghaiInstructionSet() curieInstructionSet = newCurieInstructionSet() darwinInstructionSet = newDarwinInstructionSet() + qianxuesenInstructionSet = newQianxuesenInstructionSet() ) // JumpTable contains the EVM opcodes supported at a given fork. type JumpTable [256]*operation +// newQianXueSenInstructionSet returns the frontier, homestead, byzantium, +// contantinople, istanbul, petersburg, berlin, london, shanghai, curie, darwin and qianxuesen instructions. +func newQianxuesenInstructionSet() JumpTable { + instructionSet := newDarwinInstructionSet() + return instructionSet +} + // newDarwinInstructionSet returns the frontier, homestead, byzantium, // contantinople, istanbul, petersburg, berlin, london, shanghai, curie, and darwin instructions. func newDarwinInstructionSet() JumpTable { diff --git a/params/config.go b/params/config.go index 48c6755f8..04a1f6954 100644 --- a/params/config.go +++ b/params/config.go @@ -538,6 +538,7 @@ type ChainConfig struct { BernoulliBlock *big.Int `json:"bernoulliBlock,omitempty"` // Bernoulli switch block (nil = no fork, 0 = already on bernoulli) CurieBlock *big.Int `json:"curieBlock,omitempty"` // Curie switch block (nil = no fork, 0 = already on curie) DarwinTime *uint64 `json:"darwinTime,omitempty"` // Darwin switch time (nil = no fork, 0 = already on darwin) + QianxuesenTime *uint64 `json:"qianxuesenTime,omitempty"` // Qianxuesen switch time (nil = no fork, 0 = already on qianxuesen) // TerminalTotalDifficulty is the amount of total difficulty reached by // the network that triggers the consensus upgrade. @@ -748,6 +749,11 @@ func (c *ChainConfig) IsDarwin(now uint64) bool { return isForkedTime(now, c.DarwinTime) } +// IsQianxuesen returns whether num is either equal to the Qianxuesen fork block or greater. +func (c *ChainConfig) IsQianxuesen(now uint64) bool { + return isForkedTime(now, c.QianxuesenTime) +} + // IsTerminalPoWBlock returns whether the given block is the last block of PoW stage. func (c *ChainConfig) IsTerminalPoWBlock(parentTotalDiff *big.Int, totalDiff *big.Int) bool { if c.TerminalTotalDifficulty == nil { @@ -960,7 +966,7 @@ type Rules struct { IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool IsBerlin, IsLondon, IsArchimedes, IsShanghai bool - IsBernoulli, IsCurie, IsDarwin bool + IsBernoulli, IsCurie, IsDarwin, IsQianxuesen bool } // Rules ensures c's ChainID is not nil. @@ -986,5 +992,6 @@ func (c *ChainConfig) Rules(num *big.Int, time uint64) Rules { IsBernoulli: c.IsBernoulli(num), IsCurie: c.IsCurie(num), IsDarwin: c.IsDarwin(time), + IsQianxuesen: c.IsQianxuesen(time), } } From 222871f7e44f5e8498cf558d5ea55d983e3f54f2 Mon Sep 17 00:00:00 2001 From: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:02:19 +0800 Subject: [PATCH 02/11] revert opcode blockhash --- core/vm/instructions.go | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 3628abf27..240135381 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -455,27 +455,22 @@ func opBlockhash(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ( lower = upper - 256 } if num64 >= lower && num64 < upper { - if interpreter.evm.chainRules.IsQianxuesen { - res := interpreter.evm.Context.GetHash(num64) - num.SetBytes(res[:]) + chainId := interpreter.evm.ChainConfig().ChainID + chainIdBuf := make([]byte, 8) + binary.BigEndian.PutUint64(chainIdBuf, chainId.Uint64()) + num64Buf := make([]byte, 8) + binary.BigEndian.PutUint64(num64Buf, num64) + + if interpreter.hasher == nil { + interpreter.hasher = sha3.NewLegacyKeccak256().(keccakState) } else { - chainId := interpreter.evm.ChainConfig().ChainID - chainIdBuf := make([]byte, 8) - binary.BigEndian.PutUint64(chainIdBuf, chainId.Uint64()) - num64Buf := make([]byte, 8) - binary.BigEndian.PutUint64(num64Buf, num64) - - if interpreter.hasher == nil { - interpreter.hasher = sha3.NewLegacyKeccak256().(keccakState) - } else { - interpreter.hasher.Reset() - } - interpreter.hasher.Write(chainIdBuf) - interpreter.hasher.Write(num64Buf) - interpreter.hasher.Read(interpreter.hasherBuf[:]) - - num.SetBytes(interpreter.hasherBuf[:]) + interpreter.hasher.Reset() } + interpreter.hasher.Write(chainIdBuf) + interpreter.hasher.Write(num64Buf) + interpreter.hasher.Read(interpreter.hasherBuf[:]) + + num.SetBytes(interpreter.hasherBuf[:]) } else { num.Clear() } From b8a13c3c46e64c361353a5282a482b0236ddb313 Mon Sep 17 00:00:00 2001 From: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:06:44 +0800 Subject: [PATCH 03/11] rename version name --- core/vm/contracts.go | 2 +- core/vm/interpreter.go | 2 +- params/config.go | 12 ++++++------ params/version.go | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index d95faa2da..5b3a54bcc 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -193,7 +193,7 @@ func init() { // ActivePrecompiles returns the precompiles enabled with the current configuration. func ActivePrecompiles(rules params.Rules) []common.Address { switch { - case rules.IsQianxuesen: + case rules.IsMorph203: return PrecompiledAddressesQianxuesen case rules.IsBernoulli: return PrecompiledAddressesBernoulli diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index d89fdae3b..503dc19cd 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -74,7 +74,7 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { if cfg.JumpTable[STOP] == nil { var jt JumpTable switch { - case evm.chainRules.IsQianxuesen: + case evm.chainRules.IsMorph203: jt = qianxuesenInstructionSet case evm.chainRules.IsDarwin: jt = darwinInstructionSet diff --git a/params/config.go b/params/config.go index 04a1f6954..41b4928eb 100644 --- a/params/config.go +++ b/params/config.go @@ -538,7 +538,7 @@ type ChainConfig struct { BernoulliBlock *big.Int `json:"bernoulliBlock,omitempty"` // Bernoulli switch block (nil = no fork, 0 = already on bernoulli) CurieBlock *big.Int `json:"curieBlock,omitempty"` // Curie switch block (nil = no fork, 0 = already on curie) DarwinTime *uint64 `json:"darwinTime,omitempty"` // Darwin switch time (nil = no fork, 0 = already on darwin) - QianxuesenTime *uint64 `json:"qianxuesenTime,omitempty"` // Qianxuesen switch time (nil = no fork, 0 = already on qianxuesen) + Morph203Time *uint64 `json:"morph203Time,omitempty"` // Morph203Time switch time (nil = no fork, 0 = already on morph203) // TerminalTotalDifficulty is the amount of total difficulty reached by // the network that triggers the consensus upgrade. @@ -749,9 +749,9 @@ func (c *ChainConfig) IsDarwin(now uint64) bool { return isForkedTime(now, c.DarwinTime) } -// IsQianxuesen returns whether num is either equal to the Qianxuesen fork block or greater. -func (c *ChainConfig) IsQianxuesen(now uint64) bool { - return isForkedTime(now, c.QianxuesenTime) +// IsMorph203 returns whether num is either equal to the Qianxuesen fork block or greater. +func (c *ChainConfig) IsMorph203(now uint64) bool { + return isForkedTime(now, c.Morph203Time) } // IsTerminalPoWBlock returns whether the given block is the last block of PoW stage. @@ -966,7 +966,7 @@ type Rules struct { IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool IsBerlin, IsLondon, IsArchimedes, IsShanghai bool - IsBernoulli, IsCurie, IsDarwin, IsQianxuesen bool + IsBernoulli, IsCurie, IsDarwin, IsMorph203 bool } // Rules ensures c's ChainID is not nil. @@ -992,6 +992,6 @@ func (c *ChainConfig) Rules(num *big.Int, time uint64) Rules { IsBernoulli: c.IsBernoulli(num), IsCurie: c.IsCurie(num), IsDarwin: c.IsDarwin(time), - IsQianxuesen: c.IsQianxuesen(time), + IsMorph203: c.IsMorph203(time), } } diff --git a/params/version.go b/params/version.go index 100539112..b161be4fb 100644 --- a/params/version.go +++ b/params/version.go @@ -22,9 +22,9 @@ import ( ) const ( - VersionMajor = 5 // Major version component of the current release - VersionMinor = 5 // Minor version component of the current release - VersionPatch = 1 // Patch version component of the current release + VersionMajor = 2 // Major version component of the current release + VersionMinor = 0 // Minor version component of the current release + VersionPatch = 3 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) From 32e27d34794ca3ca5fd42657704f083c80938c83 Mon Sep 17 00:00:00 2001 From: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:11:02 +0800 Subject: [PATCH 04/11] rename vars --- core/vm/contracts.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 5b3a54bcc..ecc275b37 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -127,9 +127,9 @@ var PrecompiledContractsBernoulli = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{9}): &blake2FDisabled{}, } -// PrecompiledContractsQianxuesen contains the default set of pre-compiled Ethereum -// contracts used in the Qainxuesen release. -var PrecompiledContractsQianxuesen = map[common.Address]PrecompiledContract{ +// PrecompiledContractsMorph203 contains the default set of pre-compiled Ethereum +// contracts used in the Morph203 release. +var PrecompiledContractsMorph203 = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{0x1}): &ecrecover{}, common.BytesToAddress([]byte{0x2}): &sha256hash{}, common.BytesToAddress([]byte{0x3}): &ripemd160hash{}, @@ -157,7 +157,7 @@ var PrecompiledContractsBLS = map[common.Address]PrecompiledContract{ } var ( - PrecompiledAddressesQianxuesen []common.Address + PrecompiledAddressesMorph203 []common.Address PrecompiledAddressesBernoulli []common.Address PrecompiledAddressesArchimedes []common.Address PrecompiledAddressesBerlin []common.Address @@ -185,8 +185,8 @@ func init() { for k := range PrecompiledContractsBernoulli { PrecompiledAddressesBernoulli = append(PrecompiledAddressesBernoulli, k) } - for k := range PrecompiledContractsQianxuesen { - PrecompiledAddressesQianxuesen = append(PrecompiledAddressesQianxuesen, k) + for k := range PrecompiledContractsMorph203 { + PrecompiledAddressesMorph203 = append(PrecompiledAddressesMorph203, k) } } @@ -194,7 +194,7 @@ func init() { func ActivePrecompiles(rules params.Rules) []common.Address { switch { case rules.IsMorph203: - return PrecompiledAddressesQianxuesen + return PrecompiledAddressesMorph203 case rules.IsBernoulli: return PrecompiledAddressesBernoulli case rules.IsArchimedes: From d02e6e60210d8413d2de24323573da8ddd2727e8 Mon Sep 17 00:00:00 2001 From: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:14:46 +0800 Subject: [PATCH 05/11] rename vars --- core/vm/interpreter.go | 2 +- core/vm/jump_table.go | 8 ++++---- params/config.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 503dc19cd..62a783135 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -75,7 +75,7 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { var jt JumpTable switch { case evm.chainRules.IsMorph203: - jt = qianxuesenInstructionSet + jt = morph203InstructionSet case evm.chainRules.IsDarwin: jt = darwinInstructionSet case evm.chainRules.IsCurie: diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index a291f1fa7..340b6866c 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -61,15 +61,15 @@ var ( shanghaiInstructionSet = newShanghaiInstructionSet() curieInstructionSet = newCurieInstructionSet() darwinInstructionSet = newDarwinInstructionSet() - qianxuesenInstructionSet = newQianxuesenInstructionSet() + morph203InstructionSet = newMorph203InstructionSet() ) // JumpTable contains the EVM opcodes supported at a given fork. type JumpTable [256]*operation -// newQianXueSenInstructionSet returns the frontier, homestead, byzantium, -// contantinople, istanbul, petersburg, berlin, london, shanghai, curie, darwin and qianxuesen instructions. -func newQianxuesenInstructionSet() JumpTable { +// newMorph203InstructionSet returns the frontier, homestead, byzantium, +// contantinople, istanbul, petersburg, berlin, london, shanghai, curie, darwin and morph203 instructions. +func newMorph203InstructionSet() JumpTable { instructionSet := newDarwinInstructionSet() return instructionSet } diff --git a/params/config.go b/params/config.go index 41b4928eb..485412e89 100644 --- a/params/config.go +++ b/params/config.go @@ -749,7 +749,7 @@ func (c *ChainConfig) IsDarwin(now uint64) bool { return isForkedTime(now, c.DarwinTime) } -// IsMorph203 returns whether num is either equal to the Qianxuesen fork block or greater. +// IsMorph203 returns whether num is either equal to the Morph203 fork block or greater. func (c *ChainConfig) IsMorph203(now uint64) bool { return isForkedTime(now, c.Morph203Time) } From a99caf3ccf70a3bd3a79e4508304e8572e890521 Mon Sep 17 00:00:00 2001 From: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Date: Mon, 17 Feb 2025 20:05:31 +0800 Subject: [PATCH 06/11] add fork time check --- params/config.go | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/params/config.go b/params/config.go index 485412e89..c13ae82a4 100644 --- a/params/config.go +++ b/params/config.go @@ -282,6 +282,7 @@ var ( BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(6330180), DarwinTime: nil, + Morph203Time: nil, TerminalTotalDifficulty: big.NewInt(0), Morph: MorphConfig{ UseZktrie: true, @@ -312,6 +313,7 @@ var ( BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), DarwinTime: nil, + Morph203Time: nil, TerminalTotalDifficulty: big.NewInt(0), Morph: MorphConfig{ UseZktrie: true, @@ -784,9 +786,10 @@ func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *Confi // to guarantee that forks can be implemented in a different order than on official networks func (c *ChainConfig) CheckConfigForkOrder() error { type fork struct { - name string - block *big.Int - optional bool // if true, the fork may be nil and next fork is still allowed + name string + block *big.Int + timestamp *uint64 // forks after the merge are scheduled using timestamps + optional bool // if true, the fork may be nil and next fork is still allowed } var lastFork fork for _, cur := range []fork{ @@ -807,22 +810,40 @@ func (c *ChainConfig) CheckConfigForkOrder() error { {name: "shanghaiBlock", block: c.ShanghaiBlock, optional: true}, {name: "bernoulliBlock", block: c.BernoulliBlock, optional: true}, {name: "curieBlock", block: c.CurieBlock, optional: true}, + {name: "darwinTime", timestamp: c.DarwinTime, optional: true}, + {name: "morph203Time", timestamp: c.Morph203Time, optional: true}, } { if lastFork.name != "" { - // Next one must be higher number - if lastFork.block == nil && cur.block != nil { - return fmt.Errorf("unsupported fork ordering: %v not enabled, but %v enabled at %v", - lastFork.name, cur.name, cur.block) - } - if lastFork.block != nil && cur.block != nil { - if lastFork.block.Cmp(cur.block) > 0 { - return fmt.Errorf("unsupported fork ordering: %v enabled at %v, but %v enabled at %v", + switch { + // Non-optional forks must all be present in the chain config up to the last defined fork + case lastFork.block == nil && lastFork.timestamp == nil && (cur.block != nil || cur.timestamp != nil): + if cur.block != nil { + return fmt.Errorf("unsupported fork ordering: %v not enabled, but %v enabled at block %v", + lastFork.name, cur.name, cur.block) + } else { + return fmt.Errorf("unsupported fork ordering: %v not enabled, but %v enabled at timestamp %v", + lastFork.name, cur.name, *cur.timestamp) + } + + // Fork (whether defined by block or timestamp) must follow the fork definition sequence + case (lastFork.block != nil && cur.block != nil) || (lastFork.timestamp != nil && cur.timestamp != nil): + if lastFork.block != nil && lastFork.block.Cmp(cur.block) > 0 { + return fmt.Errorf("unsupported fork ordering: %v enabled at block %v, but %v enabled at block %v", lastFork.name, lastFork.block, cur.name, cur.block) + } else if lastFork.timestamp != nil && *lastFork.timestamp > *cur.timestamp { + return fmt.Errorf("unsupported fork ordering: %v enabled at timestamp %v, but %v enabled at timestamp %v", + lastFork.name, *lastFork.timestamp, cur.name, *cur.timestamp) + } + + // Timestamp based forks can follow block based ones, but not the other way around + if lastFork.timestamp != nil && cur.block != nil { + return fmt.Errorf("unsupported fork ordering: %v used timestamp ordering, but %v reverted to block ordering", + lastFork.name, cur.name) } } } // If it was optional and not set, then ignore it - if !cur.optional || cur.block != nil { + if !cur.optional || (cur.block != nil || cur.timestamp != nil) { lastFork = cur } } From 8fd47c1249f8d75b8bb7576e9083a080505646fe Mon Sep 17 00:00:00 2001 From: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Date: Mon, 17 Feb 2025 21:22:06 +0800 Subject: [PATCH 07/11] revert kzgPointEvaluation --- core/vm/contracts.go | 70 +------------------------------------------- 1 file changed, 1 insertion(+), 69 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index ecc275b37..54ee577c7 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -20,7 +20,6 @@ import ( "crypto/sha256" "encoding/binary" "errors" - "fmt" "math/big" "github.com/morph-l2/go-ethereum/common" @@ -29,7 +28,6 @@ import ( "github.com/morph-l2/go-ethereum/crypto/blake2b" "github.com/morph-l2/go-ethereum/crypto/bls12381" "github.com/morph-l2/go-ethereum/crypto/bn256" - "github.com/morph-l2/go-ethereum/crypto/kzg4844" "github.com/morph-l2/go-ethereum/params" //lint:ignore SA1019 Needed for precompile @@ -37,8 +35,7 @@ import ( ) var ( - errPrecompileDisabled = errors.New("sha256, ripemd160, blake2f precompiles temporarily disabled") - errModexpUnsupportedInput = errors.New("modexp temporarily only accepts inputs of 32 bytes (256 bits) or less") + errPrecompileDisabled = errors.New("sha256, ripemd160, blake2f precompiles temporarily disabled") ) // PrecompiledContract is the basic interface for native Go contracts. The implementation @@ -139,7 +136,6 @@ var PrecompiledContractsMorph203 = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{0x7}): &bn256ScalarMulIstanbul{}, common.BytesToAddress([]byte{0x8}): &bn256PairingIstanbul{}, common.BytesToAddress([]byte{0x9}): &blake2F{}, - common.BytesToAddress([]byte{0xa}): &kzgPointEvaluation{}, } // PrecompiledContractsBLS contains the set of pre-compiled Ethereum @@ -1144,67 +1140,3 @@ func (c *bls12381MapG2) Run(input []byte) ([]byte, error) { // Encode the G2 point to 256 bytes return g.EncodePoint(r), nil } - -// kzgPointEvaluation implements the EIP-4844 point evaluation precompile. -type kzgPointEvaluation struct{} - -// RequiredGas estimates the gas required for running the point evaluation precompile. -func (b *kzgPointEvaluation) RequiredGas(input []byte) uint64 { - return params.BlobTxPointEvaluationPrecompileGas -} - -const ( - blobVerifyInputLength = 192 // Max input length for the point evaluation precompile. - blobCommitmentVersionKZG uint8 = 0x01 // Version byte for the point evaluation precompile. - blobPrecompileReturnValue = "000000000000000000000000000000000000000000000000000000000000100073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001" -) - -var ( - errBlobVerifyInvalidInputLength = errors.New("invalid input length") - errBlobVerifyMismatchedVersion = errors.New("mismatched versioned hash") - errBlobVerifyKZGProof = errors.New("error verifying kzg proof") -) - -// Run executes the point evaluation precompile. -func (b *kzgPointEvaluation) Run(input []byte) ([]byte, error) { - if len(input) != blobVerifyInputLength { - return nil, errBlobVerifyInvalidInputLength - } - // versioned hash: first 32 bytes - var versionedHash common.Hash - copy(versionedHash[:], input[:]) - - var ( - point kzg4844.Point - claim kzg4844.Claim - ) - // Evaluation point: next 32 bytes - copy(point[:], input[32:]) - // Expected output: next 32 bytes - copy(claim[:], input[64:]) - - // input kzg point: next 48 bytes - var commitment kzg4844.Commitment - copy(commitment[:], input[96:]) - if kZGToVersionedHash(commitment) != versionedHash { - return nil, errBlobVerifyMismatchedVersion - } - - // Proof: next 48 bytes - var proof kzg4844.Proof - copy(proof[:], input[144:]) - - if err := kzg4844.VerifyProof(commitment, point, claim, proof); err != nil { - return nil, fmt.Errorf("%w: %v", errBlobVerifyKZGProof, err) - } - - return common.Hex2Bytes(blobPrecompileReturnValue), nil -} - -// kZGToVersionedHash implements kzg_to_versioned_hash from EIP-4844 -func kZGToVersionedHash(kzg kzg4844.Commitment) common.Hash { - h := sha256.Sum256(kzg[:]) - h[0] = blobCommitmentVersionKZG - - return h -} From 9a94ad2414aefd87caa9b3f495cb4332b834068f Mon Sep 17 00:00:00 2001 From: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Date: Mon, 17 Feb 2025 21:27:27 +0800 Subject: [PATCH 08/11] change byte format --- core/vm/contracts.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 54ee577c7..d90b8b3a3 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -127,15 +127,15 @@ var PrecompiledContractsBernoulli = map[common.Address]PrecompiledContract{ // PrecompiledContractsMorph203 contains the default set of pre-compiled Ethereum // contracts used in the Morph203 release. var PrecompiledContractsMorph203 = map[common.Address]PrecompiledContract{ - common.BytesToAddress([]byte{0x1}): &ecrecover{}, - common.BytesToAddress([]byte{0x2}): &sha256hash{}, - common.BytesToAddress([]byte{0x3}): &ripemd160hash{}, - common.BytesToAddress([]byte{0x4}): &dataCopy{}, - common.BytesToAddress([]byte{0x5}): &bigModExp{eip2565: true}, - common.BytesToAddress([]byte{0x6}): &bn256AddIstanbul{}, - common.BytesToAddress([]byte{0x7}): &bn256ScalarMulIstanbul{}, - common.BytesToAddress([]byte{0x8}): &bn256PairingIstanbul{}, - common.BytesToAddress([]byte{0x9}): &blake2F{}, + common.BytesToAddress([]byte{1}): &ecrecover{}, + common.BytesToAddress([]byte{2}): &sha256hash{}, + common.BytesToAddress([]byte{3}): &ripemd160hash{}, + common.BytesToAddress([]byte{4}): &dataCopy{}, + common.BytesToAddress([]byte{5}): &bigModExp{eip2565: true}, + common.BytesToAddress([]byte{6}): &bn256AddIstanbul{}, + common.BytesToAddress([]byte{7}): &bn256ScalarMulIstanbul{}, + common.BytesToAddress([]byte{8}): &bn256PairingIstanbul{}, + common.BytesToAddress([]byte{9}): &blake2F{}, } // PrecompiledContractsBLS contains the set of pre-compiled Ethereum From 7120f20e66c4ff0024887137de7dfc80d3340943 Mon Sep 17 00:00:00 2001 From: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Date: Mon, 17 Feb 2025 21:32:15 +0800 Subject: [PATCH 09/11] config string() --- params/config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/params/config.go b/params/config.go index c13ae82a4..7b3ef8d90 100644 --- a/params/config.go +++ b/params/config.go @@ -633,7 +633,7 @@ func (c *ChainConfig) String() string { default: engine = "unknown" } - return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Darwin: %v, Engine: %v, Morph config: %v}", + return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Darwin: %v, Morph203: %v, Engine: %v, Morph config: %v}", c.ChainID, c.HomesteadBlock, c.DAOForkBlock, @@ -654,6 +654,7 @@ func (c *ChainConfig) String() string { c.BernoulliBlock, c.CurieBlock, c.DarwinTime, + c.Morph203Time, engine, c.Morph, ) From e99d3dec2bfb307ab30ccea2c468c4d5cb524e72 Mon Sep 17 00:00:00 2001 From: FletcherMan Date: Tue, 18 Feb 2025 10:26:16 +0800 Subject: [PATCH 10/11] remove darwin --- core/blockchain_test.go | 2 +- core/state_processor_test.go | 2 +- core/vm/interpreter.go | 5 +---- core/vm/jump_table.go | 16 ---------------- core/vm/runtime/runtime.go | 2 +- eth/gasprice/gasprice_test.go | 2 +- params/config.go | 23 ++++++----------------- 7 files changed, 11 insertions(+), 41 deletions(-) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index e73e08e9d..766058487 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -3520,7 +3520,7 @@ func TestCurieTransition(t *testing.T) { b, _ := json.Marshal(params.AllEthashProtocolChanges) json.Unmarshal(b, &config) config.CurieBlock = big.NewInt(2) - config.DarwinTime = nil + config.Morph203Time = nil var ( db = rawdb.NewMemoryDatabase() diff --git a/core/state_processor_test.go b/core/state_processor_test.go index db5cdcfbe..f9bda74d4 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -58,7 +58,7 @@ func TestStateProcessorErrors(t *testing.T) { ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DarwinTime: new(uint64), + Morph203Time: new(uint64), Ethash: new(params.EthashConfig), } signer = types.LatestSigner(config) diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 62a783135..2f1e9721d 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -1,4 +1,5 @@ // Copyright 2014 The go-ethereum Authors +// Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify @@ -74,10 +75,6 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { if cfg.JumpTable[STOP] == nil { var jt JumpTable switch { - case evm.chainRules.IsMorph203: - jt = morph203InstructionSet - case evm.chainRules.IsDarwin: - jt = darwinInstructionSet case evm.chainRules.IsCurie: jt = curieInstructionSet case evm.chainRules.IsShanghai: diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 340b6866c..dc1bed741 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -60,27 +60,11 @@ var ( londonInstructionSet = newLondonInstructionSet() shanghaiInstructionSet = newShanghaiInstructionSet() curieInstructionSet = newCurieInstructionSet() - darwinInstructionSet = newDarwinInstructionSet() - morph203InstructionSet = newMorph203InstructionSet() ) // JumpTable contains the EVM opcodes supported at a given fork. type JumpTable [256]*operation -// newMorph203InstructionSet returns the frontier, homestead, byzantium, -// contantinople, istanbul, petersburg, berlin, london, shanghai, curie, darwin and morph203 instructions. -func newMorph203InstructionSet() JumpTable { - instructionSet := newDarwinInstructionSet() - return instructionSet -} - -// newDarwinInstructionSet returns the frontier, homestead, byzantium, -// contantinople, istanbul, petersburg, berlin, london, shanghai, curie, and darwin instructions. -func newDarwinInstructionSet() JumpTable { - instructionSet := newCurieInstructionSet() - return instructionSet -} - // newCurieInstructionSet returns the frontier, homestead, byzantium, // contantinople, istanbul, petersburg, berlin, london, shanghai, and curie instructions. func newCurieInstructionSet() JumpTable { diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index c15d68868..0be0c6558 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -72,7 +72,7 @@ func setDefaults(cfg *Config) { ShanghaiBlock: new(big.Int), BernoulliBlock: new(big.Int), CurieBlock: new(big.Int), - DarwinTime: new(uint64), + Morph203Time: new(uint64), } } diff --git a/eth/gasprice/gasprice_test.go b/eth/gasprice/gasprice_test.go index c250ad662..552b43572 100644 --- a/eth/gasprice/gasprice_test.go +++ b/eth/gasprice/gasprice_test.go @@ -114,7 +114,7 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool) *testBacke config.ShanghaiBlock = londonBlock config.BernoulliBlock = londonBlock config.CurieBlock = londonBlock - config.DarwinTime = nil + config.Morph203Time = nil engine := ethash.NewFaker() db := rawdb.NewMemoryDatabase() genesis, err := gspec.Commit(db) diff --git a/params/config.go b/params/config.go index 7b3ef8d90..93a939f58 100644 --- a/params/config.go +++ b/params/config.go @@ -281,7 +281,6 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(6330180), - DarwinTime: nil, Morph203Time: nil, TerminalTotalDifficulty: big.NewInt(0), Morph: MorphConfig{ @@ -312,7 +311,6 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DarwinTime: nil, Morph203Time: nil, TerminalTotalDifficulty: big.NewInt(0), Morph: MorphConfig{ @@ -349,7 +347,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DarwinTime: new(uint64), + Morph203Time: new(uint64), TerminalTotalDifficulty: nil, Ethash: new(EthashConfig), Clique: nil, @@ -385,7 +383,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DarwinTime: new(uint64), + Morph203Time: new(uint64), TerminalTotalDifficulty: nil, Ethash: nil, Clique: &CliqueConfig{Period: 0, Epoch: 30000}, @@ -416,7 +414,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DarwinTime: new(uint64), + Morph203Time: new(uint64), TerminalTotalDifficulty: nil, Ethash: new(EthashConfig), Clique: nil, @@ -448,7 +446,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DarwinTime: new(uint64), + Morph203Time: new(uint64), TerminalTotalDifficulty: nil, Ethash: new(EthashConfig), Clique: nil, @@ -539,7 +537,6 @@ type ChainConfig struct { ShanghaiBlock *big.Int `json:"shanghaiBlock,omitempty"` // Shanghai switch block (nil = no fork, 0 = already on shanghai) BernoulliBlock *big.Int `json:"bernoulliBlock,omitempty"` // Bernoulli switch block (nil = no fork, 0 = already on bernoulli) CurieBlock *big.Int `json:"curieBlock,omitempty"` // Curie switch block (nil = no fork, 0 = already on curie) - DarwinTime *uint64 `json:"darwinTime,omitempty"` // Darwin switch time (nil = no fork, 0 = already on darwin) Morph203Time *uint64 `json:"morph203Time,omitempty"` // Morph203Time switch time (nil = no fork, 0 = already on morph203) // TerminalTotalDifficulty is the amount of total difficulty reached by @@ -633,7 +630,7 @@ func (c *ChainConfig) String() string { default: engine = "unknown" } - return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Darwin: %v, Morph203: %v, Engine: %v, Morph config: %v}", + return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Morph203: %v, Engine: %v, Morph config: %v}", c.ChainID, c.HomesteadBlock, c.DAOForkBlock, @@ -653,7 +650,6 @@ func (c *ChainConfig) String() string { c.ShanghaiBlock, c.BernoulliBlock, c.CurieBlock, - c.DarwinTime, c.Morph203Time, engine, c.Morph, @@ -747,11 +743,6 @@ func (c *ChainConfig) IsCurie(num *big.Int) bool { return isForked(c.CurieBlock, num) } -// IsDarwin returns whether num is either equal to the Darwin fork block or greater. -func (c *ChainConfig) IsDarwin(now uint64) bool { - return isForkedTime(now, c.DarwinTime) -} - // IsMorph203 returns whether num is either equal to the Morph203 fork block or greater. func (c *ChainConfig) IsMorph203(now uint64) bool { return isForkedTime(now, c.Morph203Time) @@ -811,7 +802,6 @@ func (c *ChainConfig) CheckConfigForkOrder() error { {name: "shanghaiBlock", block: c.ShanghaiBlock, optional: true}, {name: "bernoulliBlock", block: c.BernoulliBlock, optional: true}, {name: "curieBlock", block: c.CurieBlock, optional: true}, - {name: "darwinTime", timestamp: c.DarwinTime, optional: true}, {name: "morph203Time", timestamp: c.Morph203Time, optional: true}, } { if lastFork.name != "" { @@ -988,7 +978,7 @@ type Rules struct { IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool IsBerlin, IsLondon, IsArchimedes, IsShanghai bool - IsBernoulli, IsCurie, IsDarwin, IsMorph203 bool + IsBernoulli, IsCurie, IsMorph203 bool } // Rules ensures c's ChainID is not nil. @@ -1013,7 +1003,6 @@ func (c *ChainConfig) Rules(num *big.Int, time uint64) Rules { IsShanghai: c.IsShanghai(num), IsBernoulli: c.IsBernoulli(num), IsCurie: c.IsCurie(num), - IsDarwin: c.IsDarwin(time), IsMorph203: c.IsMorph203(time), } } From 23945e2c158ac82da6dc69a7a85b30f1a2c587f9 Mon Sep 17 00:00:00 2001 From: FletcherMan Date: Tue, 18 Feb 2025 11:07:35 +0800 Subject: [PATCH 11/11] remove duplicated code --- core/vm/interpreter.go | 1 - 1 file changed, 1 deletion(-) diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 2f1e9721d..11d5252a0 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -1,5 +1,4 @@ // Copyright 2014 The go-ethereum Authors -// Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify