diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index 26c8307ce61b..febabccc2b08 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -590,7 +590,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified") } head := b.blockchain.CurrentHeader() - if !b.blockchain.Config().IsBanach(head.Number) { + if !b.blockchain.Config().IsCurie(head.Number) { // If there's no basefee, then it must be a non-1559 execution if call.GasPrice == nil { call.GasPrice = new(big.Int) diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 9f388f0b7c67..9e7d0705dc4b 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -289,7 +289,7 @@ func (c *BoundContract) createDynamicTx(opts *TransactOpts, contract *common.Add func (c *BoundContract) createLegacyTx(opts *TransactOpts, contract *common.Address, input []byte) (*types.Transaction, error) { if opts.GasFeeCap != nil || opts.GasTipCap != nil { - return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but banach is not active yet") + return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but curie is not active yet") } // Normalize value value := opts.Value diff --git a/cmd/evm/internal/t8ntool/transition.go b/cmd/evm/internal/t8ntool/transition.go index e19280610f60..02732bfa9663 100644 --- a/cmd/evm/internal/t8ntool/transition.go +++ b/cmd/evm/internal/t8ntool/transition.go @@ -247,7 +247,7 @@ func Transition(ctx *cli.Context) error { return NewError(ErrorJson, fmt.Errorf("failed signing transactions: %v", err)) } // Sanity check, to not `panic` in state_transition - if chainConfig.IsBanach(big.NewInt(int64(prestate.Env.Number))) { + if chainConfig.IsCurie(big.NewInt(int64(prestate.Env.Number))) { if prestate.Env.BaseFee == nil { return NewError(ErrorConfig, errors.New("EIP-1559 config but missing 'currentBaseFee' in env section")) } diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 33ccb82a7a86..bc4aef31518f 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -335,7 +335,7 @@ func (c *Clique) verifyCascadingFields(chain consensus.ChainHeaderReader, header if header.GasUsed > header.GasLimit { return fmt.Errorf("invalid gasUsed: have %d, gasLimit %d", header.GasUsed, header.GasLimit) } - if !chain.Config().IsBanach(header.Number) { + if !chain.Config().IsCurie(header.Number) { // Verify BaseFee not present before EIP-1559 fork. if header.BaseFee != nil { return fmt.Errorf("invalid baseFee before fork: have %d, want ", header.BaseFee) diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 78154d4dac0e..eb829d9777f9 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -291,7 +291,7 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa return fmt.Errorf("invalid gasUsed: have %d, gasLimit %d", header.GasUsed, header.GasLimit) } // Verify the block's gas usage and (if applicable) verify the base fee. - if !chain.Config().IsBanach(header.Number) { + if !chain.Config().IsCurie(header.Number) { // Verify BaseFee not present before EIP-1559 fork. if header.BaseFee != nil { return fmt.Errorf("invalid baseFee before fork: have %d, expected 'nil'", header.BaseFee) diff --git a/consensus/misc/eip1559_test.go b/consensus/misc/eip1559_test.go index 8aa22c830fa5..48dfabef54ad 100644 --- a/consensus/misc/eip1559_test.go +++ b/consensus/misc/eip1559_test.go @@ -51,8 +51,8 @@ func copyConfig(original *params.ChainConfig) *params.ChainConfig { func config() *params.ChainConfig { config := copyConfig(params.TestChainConfig) - config.LondonBlock = big.NewInt(3) - config.BanachBlock = big.NewInt(5) + config.BernoulliBlock = big.NewInt(3) + config.CurieBlock = big.NewInt(5) return config } @@ -67,13 +67,13 @@ func TestBlockGasLimits(t *testing.T) { gasLimit uint64 ok bool }{ - // Transitions from non-banach to banach + // Transitions from non-curie to curie {10000000, 4, 10000000, true}, // No change {10000000, 4, 10009764, true}, // Upper limit {10000000, 4, 10009765, false}, // Upper +1 {10000000, 4, 9990236, true}, // Lower limit {10000000, 4, 9990235, false}, // Lower limit -1 - // Banach to Banach + // Curie to Curie {20000000, 5, 20000000, true}, {20000000, 5, 20019530, true}, // Upper limit {20000000, 5, 20019531, false}, // Upper limit +1 diff --git a/core/chain_makers.go b/core/chain_makers.go index 3920b2bef4d4..99c527f3530b 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -276,7 +276,7 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.S Number: new(big.Int).Add(parent.Number(), common.Big1), Time: time, } - if chain.Config().IsBanach(header.Number) { + if chain.Config().IsCurie(header.Number) { parentL1BaseFee := fees.GetL1BaseFee(state) header.BaseFee = misc.CalcBaseFee(chain.Config(), parent.Header(), parentL1BaseFee) } diff --git a/core/genesis.go b/core/genesis.go index 50b77d4da2e8..50a8e8843a4d 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -313,7 +313,7 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block { if g.Difficulty == nil { head.Difficulty = params.GenesisDifficulty } - if g.Config != nil && g.Config.IsBanach(common.Big0) { + if g.Config != nil && g.Config.IsCurie(common.Big0) { if g.BaseFee != nil { head.BaseFee = g.BaseFee } else { diff --git a/core/state_processor_test.go b/core/state_processor_test.go index 8c90264f27be..796e64d747f6 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -56,7 +56,8 @@ func TestStateProcessorErrors(t *testing.T) { BerlinBlock: big.NewInt(0), LondonBlock: big.NewInt(0), ShanghaiBlock: big.NewInt(0), - BanachBlock: big.NewInt(0), + BernoulliBlock: big.NewInt(0), + CurieBlock: big.NewInt(0), Ethash: new(params.EthashConfig), } signer = types.LatestSigner(config) @@ -333,7 +334,8 @@ func TestStateProcessorErrors(t *testing.T) { ArrowGlacierBlock: big.NewInt(0), ArchimedesBlock: big.NewInt(0), ShanghaiBlock: big.NewInt(0), - BanachBlock: big.NewInt(0), + BernoulliBlock: big.NewInt(0), + CurieBlock: big.NewInt(0), }, Alloc: GenesisAlloc{ common.HexToAddress("0x71562b71999873DB5b286dF957af199Ec94617F7"): GenesisAccount{ @@ -398,7 +400,7 @@ func GenerateBadBlock(parent *types.Block, engine consensus.Engine, txs types.Tr UncleHash: types.EmptyUncleHash, } - if config.IsBanach(header.Number) { + if config.IsCurie(header.Number) { parentL1BaseFee := big.NewInt(1000000000) // 1 gwei header.BaseFee = misc.CalcBaseFee(config, parent.Header(), parentL1BaseFee) } diff --git a/core/state_transition.go b/core/state_transition.go index fd1e07e4377f..daacc118d8d4 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -288,7 +288,7 @@ func (st *StateTransition) preCheck() error { } } // Make sure that transaction gasFeeCap is greater than the baseFee (post london) - // Note: Logically, this should be `IsBanach`, but we keep `IsLondon` to ensure backward compatibility. + // Note: Logically, this should be `IsCurie`, but we keep `IsLondon` to ensure backward compatibility. if st.evm.ChainConfig().IsLondon(st.evm.Context.BlockNumber) { // Skip the checks if gas fields are zero and baseFee was explicitly disabled (eth_call) if !st.evm.Config.NoBaseFee || st.gasFeeCap.BitLen() > 0 || st.gasTipCap.BitLen() > 0 { @@ -414,7 +414,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { effectiveTip := st.gasPrice // only burn the base fee if the fee vault is not enabled - if rules.IsBanach && !st.evm.ChainConfig().Scroll.FeeVaultEnabled() { + if rules.IsCurie && !st.evm.ChainConfig().Scroll.FeeVaultEnabled() { effectiveTip = cmath.BigMin(st.gasTipCap, new(big.Int).Sub(st.gasFeeCap, st.evm.Context.BaseFee)) } diff --git a/core/tx_pool.go b/core/tx_pool.go index e5e30fc6bf4a..a81ebe17d7ed 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -1231,7 +1231,7 @@ func (pool *TxPool) runReorg(done chan struct{}, reset *txpoolResetRequest, dirt // because of another transaction (e.g. higher gas price). if reset != nil { pool.demoteUnexecutables() - if reset.newHead != nil && pool.chainconfig.IsBanach(new(big.Int).Add(reset.newHead.Number, big.NewInt(1))) { + if reset.newHead != nil && pool.chainconfig.IsCurie(new(big.Int).Add(reset.newHead.Number, big.NewInt(1))) { l1BaseFee := fees.GetL1BaseFee(pool.currentState) pendingBaseFee := misc.CalcBaseFee(pool.chainconfig, reset.newHead, l1BaseFee) pool.priced.SetBaseFee(pendingBaseFee) @@ -1357,8 +1357,8 @@ func (pool *TxPool) reset(oldHead, newHead *types.Header) { next := new(big.Int).Add(newHead.Number, big.NewInt(1)) pool.istanbul = pool.chainconfig.IsIstanbul(next) - pool.eip2718 = pool.chainconfig.IsBanach(next) - pool.eip1559 = pool.chainconfig.IsBanach(next) + pool.eip2718 = pool.chainconfig.IsCurie(next) + pool.eip1559 = pool.chainconfig.IsCurie(next) pool.shanghai = pool.chainconfig.IsShanghai(next) } diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go index dea0afcc1a0c..3a9fff64190d 100644 --- a/core/types/transaction_signing.go +++ b/core/types/transaction_signing.go @@ -40,7 +40,7 @@ type sigCache struct { func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer { var signer Signer switch { - case config.IsBanach(blockNumber): + case config.IsCurie(blockNumber): signer = NewLondonSignerWithEIP4844(config.ChainID) case config.IsLondon(blockNumber): signer = NewLondonSignerWithEIP4844(config.ChainID) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index ac9624ee126b..fe6f66feb1a2 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -111,9 +111,9 @@ var PrecompiledContractsArchimedes = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{9}): &blake2FDisabled{}, } -// PrecompiledContractsBanach contains the default set of pre-compiled Ethereum -// contracts used in the Banach release. Same as Archimedes but with sha256hash enabled again -var PrecompiledContractsBanach = map[common.Address]PrecompiledContract{ +// PrecompiledContractsBernoulli contains the default set of pre-compiled Ethereum +// contracts used in the Bernoulli release. Same as Archimedes but with sha256hash enabled again +var PrecompiledContractsBernoulli = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{1}): &ecrecover{}, common.BytesToAddress([]byte{2}): &sha256hash{}, common.BytesToAddress([]byte{3}): &ripemd160hashDisabled{}, @@ -140,7 +140,7 @@ var PrecompiledContractsBLS = map[common.Address]PrecompiledContract{ } var ( - PrecompiledAddressesBanach []common.Address + PrecompiledAddressesBernoulli []common.Address PrecompiledAddressesArchimedes []common.Address PrecompiledAddressesBerlin []common.Address PrecompiledAddressesIstanbul []common.Address @@ -164,16 +164,16 @@ func init() { for k := range PrecompiledContractsArchimedes { PrecompiledAddressesArchimedes = append(PrecompiledAddressesArchimedes, k) } - for k := range PrecompiledContractsBanach { - PrecompiledAddressesBanach = append(PrecompiledAddressesBanach, k) + for k := range PrecompiledContractsBernoulli { + PrecompiledAddressesBernoulli = append(PrecompiledAddressesBernoulli, k) } } // ActivePrecompiles returns the precompiles enabled with the current configuration. func ActivePrecompiles(rules params.Rules) []common.Address { switch { - case rules.IsBanach: - return PrecompiledAddressesBanach + case rules.IsBernoulli: + return PrecompiledAddressesBernoulli case rules.IsArchimedes: return PrecompiledAddressesArchimedes case rules.IsBerlin: diff --git a/core/vm/evm.go b/core/vm/evm.go index d4d9fbf58b15..d6f6a6c8271e 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -46,8 +46,8 @@ type ( func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) { var precompiles map[common.Address]PrecompiledContract switch { - case evm.chainRules.IsBanach: - precompiles = PrecompiledContractsBanach + case evm.chainRules.IsBernoulli: + precompiles = PrecompiledContractsBernoulli case evm.chainRules.IsArchimedes: precompiles = PrecompiledContractsArchimedes case evm.chainRules.IsBerlin: diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 9089d1342949..9e1f47f1250b 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -74,8 +74,8 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { if cfg.JumpTable[STOP] == nil { var jt JumpTable switch { - case evm.chainRules.IsBanach: - jt = banachInstructionSet + case evm.chainRules.IsCurie: + jt = curieInstructionSet case evm.chainRules.IsShanghai: jt = shanghaiInstructionSet case evm.chainRules.IsLondon: diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 2116504dff1b..f93ce7b4cbdd 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -59,15 +59,15 @@ var ( berlinInstructionSet = newBerlinInstructionSet() londonInstructionSet = newLondonInstructionSet() shanghaiInstructionSet = newShanghaiInstructionSet() - banachInstructionSet = newBanachInstructionSet() + curieInstructionSet = newCurieInstructionSet() ) // JumpTable contains the EVM opcodes supported at a given fork. type JumpTable [256]*operation -// newBanachInstructionSet returns the frontier, homestead, byzantium, -// contantinople, istanbul, petersburg, berlin, london, shanghai, and banach instructions. -func newBanachInstructionSet() JumpTable { +// newCurieInstructionSet returns the frontier, homestead, byzantium, +// contantinople, istanbul, petersburg, berlin, london, shanghai, and curie instructions. +func newCurieInstructionSet() JumpTable { instructionSet := newShanghaiInstructionSet() enable3198(&instructionSet) // Base fee opcode https://eips.ethereum.org/EIPS/eip-3198 return instructionSet diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index a60927215eee..6fe50e0aa5cd 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -69,7 +69,9 @@ func setDefaults(cfg *Config) { BerlinBlock: new(big.Int), LondonBlock: new(big.Int), ArchimedesBlock: new(big.Int), - BanachBlock: new(big.Int), + ShanghaiBlock: new(big.Int), + BernoulliBlock: new(big.Int), + CurieBlock: new(big.Int), } } diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 7a6c1a3ad9ec..8caa3e9e8386 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -142,7 +142,7 @@ func (api *consensusAPI) AssembleBlock(params assembleBlockParams) (*executableD Extra: []byte{}, Time: params.Timestamp, } - if config := api.eth.BlockChain().Config(); config.IsBanach(header.Number) { + if config := api.eth.BlockChain().Config(); config.IsCurie(header.Number) { stateDb, err := api.eth.BlockChain().StateAt(parent.Root()) if err != nil { return nil, err @@ -273,7 +273,7 @@ func insertBlockParamsToBlock(config *chainParams.ChainConfig, parent *types.Hea GasUsed: params.GasUsed, Time: params.Timestamp, } - if config.IsBanach(number) { + if config.IsCurie(number) { header.BaseFee = misc.CalcBaseFee(config, parent, parentL1BaseFee) } block := types.NewBlockWithHeader(header).WithBody(txs, nil /* uncles */) diff --git a/eth/gasprice/feehistory.go b/eth/gasprice/feehistory.go index a8cf44138274..0d38d7628eba 100644 --- a/eth/gasprice/feehistory.go +++ b/eth/gasprice/feehistory.go @@ -89,7 +89,7 @@ func (oracle *Oracle) processBlock(bf *blockFees, percentiles []float64) { if bf.results.baseFee = bf.header.BaseFee; bf.results.baseFee == nil { bf.results.baseFee = new(big.Int) } - if chainconfig.IsBanach(big.NewInt(int64(bf.blockNumber + 1))) { + if chainconfig.IsCurie(big.NewInt(int64(bf.blockNumber + 1))) { state, err := oracle.backend.StateAt(bf.header.Root) if err != nil || state == nil { log.Error("State not found", "number", bf.header.Number, "hash", bf.header.Hash().Hex(), "state", state, "err", err) diff --git a/eth/gasprice/gasprice_test.go b/eth/gasprice/gasprice_test.go index 5fdaae2ca0ca..24822c4c2a96 100644 --- a/eth/gasprice/gasprice_test.go +++ b/eth/gasprice/gasprice_test.go @@ -111,7 +111,8 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool) *testBacke config.ArrowGlacierBlock = londonBlock config.ArchimedesBlock = londonBlock config.ShanghaiBlock = londonBlock - config.BanachBlock = londonBlock + config.BernoulliBlock = londonBlock + config.CurieBlock = londonBlock engine := ethash.NewFaker() db := rawdb.NewMemoryDatabase() genesis, err := gspec.Commit(db) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index fa476d1e148a..b41bd33fd84d 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1681,7 +1681,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, ha "l1Fee": (*hexutil.Big)(receipt.L1Fee), } // Assign the effective gas price paid - if !s.b.ChainConfig().IsBanach(bigblock) { + if !s.b.ChainConfig().IsCurie(bigblock) { fields["effectiveGasPrice"] = hexutil.Uint64(tx.GasPrice().Uint64()) } else { header, err := s.b.HeaderByHash(ctx, blockHash) diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 1b64f8b143a7..deac42152514 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -78,13 +78,13 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error { if args.GasPrice != nil && (args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil) { return errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified") } - // After banach, default to 1559 unless gasPrice is set + // After curie, default to 1559 unless gasPrice is set head := b.CurrentHeader() // If user specifies both maxPriorityfee and maxFee, then we do not - // need to consult the chain for defaults. It's definitely a Banach tx. + // need to consult the chain for defaults. It's definitely a Curie tx. if args.MaxPriorityFeePerGas == nil || args.MaxFeePerGas == nil { // In this clause, user left some fields unspecified. - if b.ChainConfig().IsBanach(head.Number) && args.GasPrice == nil { + if b.ChainConfig().IsCurie(head.Number) && args.GasPrice == nil { if args.MaxPriorityFeePerGas == nil { tip, err := b.SuggestGasTipCap(ctx) if err != nil { @@ -110,14 +110,14 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error { } } else { if args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil { - return errors.New("maxFeePerGas or maxPriorityFeePerGas specified but banach is not active yet") + return errors.New("maxFeePerGas or maxPriorityFeePerGas specified but curie is not active yet") } if args.GasPrice == nil { price, err := b.SuggestGasTipCap(ctx) if err != nil { return err } - if b.ChainConfig().IsBanach(head.Number) { + if b.ChainConfig().IsCurie(head.Number) { // The legacy tx gas price suggestion should not add 2x base fee // because all fees are consumed, so it would result in a spiral // upwards. diff --git a/miner/worker.go b/miner/worker.go index 99197551e1a9..62391c68530d 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1324,7 +1324,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64) Time: uint64(timestamp), } // Set baseFee if we are on an EIP-1559 chain - if w.chainConfig.IsBanach(header.Number) { + if w.chainConfig.IsCurie(header.Number) { state, err := w.chain.StateAt(parent.Root()) if err != nil { log.Error("Failed to create mining context", "err", err) diff --git a/params/config.go b/params/config.go index 75bb83a29dc2..03e11cc8d59a 100644 --- a/params/config.go +++ b/params/config.go @@ -279,7 +279,8 @@ var ( ArrowGlacierBlock: nil, ArchimedesBlock: big.NewInt(2646311), ShanghaiBlock: nil, - BanachBlock: nil, + BernoulliBlock: nil, + CurieBlock: nil, Clique: &CliqueConfig{ Period: 3, Epoch: 30000, @@ -316,7 +317,8 @@ var ( ArrowGlacierBlock: nil, ArchimedesBlock: big.NewInt(0), ShanghaiBlock: big.NewInt(0), - BanachBlock: nil, + BernoulliBlock: nil, + CurieBlock: nil, Clique: &CliqueConfig{ Period: 3, Epoch: 30000, @@ -353,7 +355,8 @@ var ( ArrowGlacierBlock: nil, ArchimedesBlock: big.NewInt(0), ShanghaiBlock: big.NewInt(0), - BanachBlock: nil, + BernoulliBlock: nil, + CurieBlock: nil, Clique: &CliqueConfig{ Period: 3, Epoch: 30000, @@ -377,7 +380,7 @@ var ( // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, + AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, ScrollConfig{ UseZktrie: false, FeeVaultAddress: nil, @@ -391,7 +394,7 @@ var ( // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, + AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, ScrollConfig{ UseZktrie: false, FeeVaultAddress: nil, @@ -400,7 +403,7 @@ var ( L1Config: &L1Config{5, common.HexToAddress("0x0000000000000000000000000000000000000000"), 0, common.HexToAddress("0x0000000000000000000000000000000000000000")}, }} - TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, + TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, ScrollConfig{ UseZktrie: false, FeeVaultAddress: &common.Address{123}, @@ -410,7 +413,7 @@ var ( }} TestRules = TestChainConfig.Rules(new(big.Int)) - TestNoL1DataFeeChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, + TestNoL1DataFeeChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, ScrollConfig{ UseZktrie: false, FeeVaultAddress: nil, @@ -498,7 +501,8 @@ type ChainConfig struct { ArrowGlacierBlock *big.Int `json:"arrowGlacierBlock,omitempty"` // Eip-4345 (bomb delay) switch block (nil = no fork, 0 = already activated) ArchimedesBlock *big.Int `json:"archimedesBlock,omitempty"` // Archimedes switch block (nil = no fork, 0 = already on archimedes) ShanghaiBlock *big.Int `json:"shanghaiBlock,omitempty"` // Shanghai switch block (nil = no fork, 0 = already on shanghai) - BanachBlock *big.Int `json:"banachBlock,omitempty"` // Banach switch block (nil = no fork, 0 = already on banach) + 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) // TerminalTotalDifficulty is the amount of total difficulty reached by // the network that triggers the consensus upgrade. @@ -614,7 +618,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, Banach: %v, Engine: %v, Scroll 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, Engine: %v, Scroll config: %v}", c.ChainID, c.HomesteadBlock, c.DAOForkBlock, @@ -632,7 +636,8 @@ func (c *ChainConfig) String() string { c.ArrowGlacierBlock, c.ArchimedesBlock, c.ShanghaiBlock, - c.BanachBlock, + c.BernoulliBlock, + c.CurieBlock, engine, c.Scroll, ) @@ -715,9 +720,14 @@ func (c *ChainConfig) IsShanghai(num *big.Int) bool { return isForked(c.ShanghaiBlock, num) } -// IsBanach returns whether num is either equal to the Banach fork block or greater. -func (c *ChainConfig) IsBanach(num *big.Int) bool { - return isForked(c.BanachBlock, num) +// IsBernoulli returns whether num is either equal to the Bernoulli fork block or greater. +func (c *ChainConfig) IsBernoulli(num *big.Int) bool { + return isForked(c.BernoulliBlock, num) +} + +// IsCurie returns whether num is either equal to the Curie fork block or greater. +func (c *ChainConfig) IsCurie(num *big.Int) bool { + return isForked(c.CurieBlock, num) } // IsTerminalPoWBlock returns whether the given block is the last block of PoW stage. @@ -771,7 +781,8 @@ func (c *ChainConfig) CheckConfigForkOrder() error { {name: "arrowGlacierBlock", block: c.ArrowGlacierBlock, optional: true}, {name: "archimedesBlock", block: c.ArchimedesBlock, optional: true}, {name: "shanghaiBlock", block: c.ShanghaiBlock, optional: true}, - {name: "banachBlock", block: c.BanachBlock, optional: true}, + {name: "bernoulliBlock", block: c.BernoulliBlock, optional: true}, + {name: "curieBlock", block: c.CurieBlock, optional: true}, } { if lastFork.name != "" { // Next one must be higher number @@ -850,8 +861,11 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi if isForkIncompatible(c.ShanghaiBlock, newcfg.ShanghaiBlock, head) { return newCompatError("Shanghai fork block", c.ShanghaiBlock, newcfg.ShanghaiBlock) } - if isForkIncompatible(c.BanachBlock, newcfg.BanachBlock, head) { - return newCompatError("Hard fork block", c.BanachBlock, newcfg.BanachBlock) + if isForkIncompatible(c.BernoulliBlock, newcfg.BernoulliBlock, head) { + return newCompatError("Bernoulli fork block", c.BernoulliBlock, newcfg.BernoulliBlock) + } + if isForkIncompatible(c.CurieBlock, newcfg.CurieBlock, head) { + return newCompatError("Curie fork block", c.CurieBlock, newcfg.CurieBlock) } return nil } @@ -921,7 +935,7 @@ type Rules struct { IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool IsBerlin, IsLondon, IsArchimedes, IsShanghai bool - IsBanach bool + IsBernoulli, IsCurie bool } // Rules ensures c's ChainID is not nil. @@ -944,6 +958,7 @@ func (c *ChainConfig) Rules(num *big.Int) Rules { IsLondon: c.IsLondon(num), IsArchimedes: c.IsArchimedes(num), IsShanghai: c.IsShanghai(num), - IsBanach: c.IsBanach(num), + IsBernoulli: c.IsBernoulli(num), + IsCurie: c.IsCurie(num), } } diff --git a/params/version.go b/params/version.go index e730602d1a54..217aaa394362 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 1 // Minor version component of the current release - VersionPatch = 25 // Patch version component of the current release + VersionPatch = 26 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) diff --git a/tests/init.go b/tests/init.go index 0b9b0895c254..e373bd989b6d 100644 --- a/tests/init.go +++ b/tests/init.go @@ -213,7 +213,7 @@ var Forks = map[string]*params.ChainConfig{ ArrowGlacierBlock: big.NewInt(0), ArchimedesBlock: big.NewInt(0), }, - "Banach": { + "Curie": { ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), EIP150Block: big.NewInt(0), @@ -228,7 +228,9 @@ var Forks = map[string]*params.ChainConfig{ LondonBlock: big.NewInt(0), ArrowGlacierBlock: big.NewInt(0), ArchimedesBlock: big.NewInt(0), - BanachBlock: big.NewInt(0), + ShanghaiBlock: big.NewInt(0), + BernoulliBlock: big.NewInt(0), + CurieBlock: big.NewInt(0), }, } diff --git a/tests/state_test_util.go b/tests/state_test_util.go index e259f9e62ba2..01ff828b8817 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -188,7 +188,7 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh snaps, statedb := MakePreState(rawdb.NewMemoryDatabase(), t.json.Pre, snapshotter) var baseFee *big.Int - if config.IsBanach(new(big.Int)) { + if config.IsCurie(new(big.Int)) { baseFee = t.json.Env.BaseFee if baseFee == nil { // Retesteth uses `0x10` for genesis baseFee. Therefore, it defaults to