Skip to content

Commit 0f0cd99

Browse files
feat: update upcoming fork names (#680)
* feat: update upcoming fork names * bump version * Apply suggestions from code review Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com> * bump version --------- Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com>
1 parent 411889e commit 0f0cd99

27 files changed

+92
-70
lines changed

accounts/abi/bind/backends/simulated.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
590590
return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
591591
}
592592
head := b.blockchain.CurrentHeader()
593-
if !b.blockchain.Config().IsBanach(head.Number) {
593+
if !b.blockchain.Config().IsCurie(head.Number) {
594594
// If there's no basefee, then it must be a non-1559 execution
595595
if call.GasPrice == nil {
596596
call.GasPrice = new(big.Int)

accounts/abi/bind/base.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (c *BoundContract) createDynamicTx(opts *TransactOpts, contract *common.Add
289289

290290
func (c *BoundContract) createLegacyTx(opts *TransactOpts, contract *common.Address, input []byte) (*types.Transaction, error) {
291291
if opts.GasFeeCap != nil || opts.GasTipCap != nil {
292-
return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but banach is not active yet")
292+
return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but curie is not active yet")
293293
}
294294
// Normalize value
295295
value := opts.Value

cmd/evm/internal/t8ntool/transition.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func Transition(ctx *cli.Context) error {
247247
return NewError(ErrorJson, fmt.Errorf("failed signing transactions: %v", err))
248248
}
249249
// Sanity check, to not `panic` in state_transition
250-
if chainConfig.IsBanach(big.NewInt(int64(prestate.Env.Number))) {
250+
if chainConfig.IsCurie(big.NewInt(int64(prestate.Env.Number))) {
251251
if prestate.Env.BaseFee == nil {
252252
return NewError(ErrorConfig, errors.New("EIP-1559 config but missing 'currentBaseFee' in env section"))
253253
}

consensus/clique/clique.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ func (c *Clique) verifyCascadingFields(chain consensus.ChainHeaderReader, header
335335
if header.GasUsed > header.GasLimit {
336336
return fmt.Errorf("invalid gasUsed: have %d, gasLimit %d", header.GasUsed, header.GasLimit)
337337
}
338-
if !chain.Config().IsBanach(header.Number) {
338+
if !chain.Config().IsCurie(header.Number) {
339339
// Verify BaseFee not present before EIP-1559 fork.
340340
if header.BaseFee != nil {
341341
return fmt.Errorf("invalid baseFee before fork: have %d, want <nil>", header.BaseFee)

consensus/ethash/consensus.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
291291
return fmt.Errorf("invalid gasUsed: have %d, gasLimit %d", header.GasUsed, header.GasLimit)
292292
}
293293
// Verify the block's gas usage and (if applicable) verify the base fee.
294-
if !chain.Config().IsBanach(header.Number) {
294+
if !chain.Config().IsCurie(header.Number) {
295295
// Verify BaseFee not present before EIP-1559 fork.
296296
if header.BaseFee != nil {
297297
return fmt.Errorf("invalid baseFee before fork: have %d, expected 'nil'", header.BaseFee)

consensus/misc/eip1559_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ func copyConfig(original *params.ChainConfig) *params.ChainConfig {
5151

5252
func config() *params.ChainConfig {
5353
config := copyConfig(params.TestChainConfig)
54-
config.LondonBlock = big.NewInt(3)
55-
config.BanachBlock = big.NewInt(5)
54+
config.BernoulliBlock = big.NewInt(3)
55+
config.CurieBlock = big.NewInt(5)
5656
return config
5757
}
5858

@@ -67,13 +67,13 @@ func TestBlockGasLimits(t *testing.T) {
6767
gasLimit uint64
6868
ok bool
6969
}{
70-
// Transitions from non-banach to banach
70+
// Transitions from non-curie to curie
7171
{10000000, 4, 10000000, true}, // No change
7272
{10000000, 4, 10009764, true}, // Upper limit
7373
{10000000, 4, 10009765, false}, // Upper +1
7474
{10000000, 4, 9990236, true}, // Lower limit
7575
{10000000, 4, 9990235, false}, // Lower limit -1
76-
// Banach to Banach
76+
// Curie to Curie
7777
{20000000, 5, 20000000, true},
7878
{20000000, 5, 20019530, true}, // Upper limit
7979
{20000000, 5, 20019531, false}, // Upper limit +1

core/chain_makers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.S
276276
Number: new(big.Int).Add(parent.Number(), common.Big1),
277277
Time: time,
278278
}
279-
if chain.Config().IsBanach(header.Number) {
279+
if chain.Config().IsCurie(header.Number) {
280280
parentL1BaseFee := fees.GetL1BaseFee(state)
281281
header.BaseFee = misc.CalcBaseFee(chain.Config(), parent.Header(), parentL1BaseFee)
282282
}

core/genesis.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block {
313313
if g.Difficulty == nil {
314314
head.Difficulty = params.GenesisDifficulty
315315
}
316-
if g.Config != nil && g.Config.IsBanach(common.Big0) {
316+
if g.Config != nil && g.Config.IsCurie(common.Big0) {
317317
if g.BaseFee != nil {
318318
head.BaseFee = g.BaseFee
319319
} else {

core/state_processor_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ func TestStateProcessorErrors(t *testing.T) {
5656
BerlinBlock: big.NewInt(0),
5757
LondonBlock: big.NewInt(0),
5858
ShanghaiBlock: big.NewInt(0),
59-
BanachBlock: big.NewInt(0),
59+
BernoulliBlock: big.NewInt(0),
60+
CurieBlock: big.NewInt(0),
6061
Ethash: new(params.EthashConfig),
6162
}
6263
signer = types.LatestSigner(config)
@@ -333,7 +334,8 @@ func TestStateProcessorErrors(t *testing.T) {
333334
ArrowGlacierBlock: big.NewInt(0),
334335
ArchimedesBlock: big.NewInt(0),
335336
ShanghaiBlock: big.NewInt(0),
336-
BanachBlock: big.NewInt(0),
337+
BernoulliBlock: big.NewInt(0),
338+
CurieBlock: big.NewInt(0),
337339
},
338340
Alloc: GenesisAlloc{
339341
common.HexToAddress("0x71562b71999873DB5b286dF957af199Ec94617F7"): GenesisAccount{
@@ -398,7 +400,7 @@ func GenerateBadBlock(parent *types.Block, engine consensus.Engine, txs types.Tr
398400
UncleHash: types.EmptyUncleHash,
399401
}
400402

401-
if config.IsBanach(header.Number) {
403+
if config.IsCurie(header.Number) {
402404
parentL1BaseFee := big.NewInt(1000000000) // 1 gwei
403405
header.BaseFee = misc.CalcBaseFee(config, parent.Header(), parentL1BaseFee)
404406
}

core/state_transition.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ func (st *StateTransition) preCheck() error {
288288
}
289289
}
290290
// Make sure that transaction gasFeeCap is greater than the baseFee (post london)
291-
// Note: Logically, this should be `IsBanach`, but we keep `IsLondon` to ensure backward compatibility.
291+
// Note: Logically, this should be `IsCurie`, but we keep `IsLondon` to ensure backward compatibility.
292292
if st.evm.ChainConfig().IsLondon(st.evm.Context.BlockNumber) {
293293
// Skip the checks if gas fields are zero and baseFee was explicitly disabled (eth_call)
294294
if !st.evm.Config.NoBaseFee || st.gasFeeCap.BitLen() > 0 || st.gasTipCap.BitLen() > 0 {
@@ -414,7 +414,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
414414
effectiveTip := st.gasPrice
415415

416416
// only burn the base fee if the fee vault is not enabled
417-
if rules.IsBanach && !st.evm.ChainConfig().Scroll.FeeVaultEnabled() {
417+
if rules.IsCurie && !st.evm.ChainConfig().Scroll.FeeVaultEnabled() {
418418
effectiveTip = cmath.BigMin(st.gasTipCap, new(big.Int).Sub(st.gasFeeCap, st.evm.Context.BaseFee))
419419
}
420420

core/tx_pool.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ func (pool *TxPool) runReorg(done chan struct{}, reset *txpoolResetRequest, dirt
12311231
// because of another transaction (e.g. higher gas price).
12321232
if reset != nil {
12331233
pool.demoteUnexecutables()
1234-
if reset.newHead != nil && pool.chainconfig.IsBanach(new(big.Int).Add(reset.newHead.Number, big.NewInt(1))) {
1234+
if reset.newHead != nil && pool.chainconfig.IsCurie(new(big.Int).Add(reset.newHead.Number, big.NewInt(1))) {
12351235
l1BaseFee := fees.GetL1BaseFee(pool.currentState)
12361236
pendingBaseFee := misc.CalcBaseFee(pool.chainconfig, reset.newHead, l1BaseFee)
12371237
pool.priced.SetBaseFee(pendingBaseFee)
@@ -1357,8 +1357,8 @@ func (pool *TxPool) reset(oldHead, newHead *types.Header) {
13571357
next := new(big.Int).Add(newHead.Number, big.NewInt(1))
13581358
pool.istanbul = pool.chainconfig.IsIstanbul(next)
13591359

1360-
pool.eip2718 = pool.chainconfig.IsBanach(next)
1361-
pool.eip1559 = pool.chainconfig.IsBanach(next)
1360+
pool.eip2718 = pool.chainconfig.IsCurie(next)
1361+
pool.eip1559 = pool.chainconfig.IsCurie(next)
13621362
pool.shanghai = pool.chainconfig.IsShanghai(next)
13631363
}
13641364

core/types/transaction_signing.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type sigCache struct {
4040
func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer {
4141
var signer Signer
4242
switch {
43-
case config.IsBanach(blockNumber):
43+
case config.IsCurie(blockNumber):
4444
signer = NewLondonSignerWithEIP4844(config.ChainID)
4545
case config.IsLondon(blockNumber):
4646
signer = NewLondonSignerWithEIP4844(config.ChainID)

core/vm/contracts.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ var PrecompiledContractsArchimedes = map[common.Address]PrecompiledContract{
111111
common.BytesToAddress([]byte{9}): &blake2FDisabled{},
112112
}
113113

114-
// PrecompiledContractsBanach contains the default set of pre-compiled Ethereum
115-
// contracts used in the Banach release. Same as Archimedes but with sha256hash enabled again
116-
var PrecompiledContractsBanach = map[common.Address]PrecompiledContract{
114+
// PrecompiledContractsBernoulli contains the default set of pre-compiled Ethereum
115+
// contracts used in the Bernoulli release. Same as Archimedes but with sha256hash enabled again
116+
var PrecompiledContractsBernoulli = map[common.Address]PrecompiledContract{
117117
common.BytesToAddress([]byte{1}): &ecrecover{},
118118
common.BytesToAddress([]byte{2}): &sha256hash{},
119119
common.BytesToAddress([]byte{3}): &ripemd160hashDisabled{},
@@ -140,7 +140,7 @@ var PrecompiledContractsBLS = map[common.Address]PrecompiledContract{
140140
}
141141

142142
var (
143-
PrecompiledAddressesBanach []common.Address
143+
PrecompiledAddressesBernoulli []common.Address
144144
PrecompiledAddressesArchimedes []common.Address
145145
PrecompiledAddressesBerlin []common.Address
146146
PrecompiledAddressesIstanbul []common.Address
@@ -164,16 +164,16 @@ func init() {
164164
for k := range PrecompiledContractsArchimedes {
165165
PrecompiledAddressesArchimedes = append(PrecompiledAddressesArchimedes, k)
166166
}
167-
for k := range PrecompiledContractsBanach {
168-
PrecompiledAddressesBanach = append(PrecompiledAddressesBanach, k)
167+
for k := range PrecompiledContractsBernoulli {
168+
PrecompiledAddressesBernoulli = append(PrecompiledAddressesBernoulli, k)
169169
}
170170
}
171171

172172
// ActivePrecompiles returns the precompiles enabled with the current configuration.
173173
func ActivePrecompiles(rules params.Rules) []common.Address {
174174
switch {
175-
case rules.IsBanach:
176-
return PrecompiledAddressesBanach
175+
case rules.IsBernoulli:
176+
return PrecompiledAddressesBernoulli
177177
case rules.IsArchimedes:
178178
return PrecompiledAddressesArchimedes
179179
case rules.IsBerlin:

core/vm/evm.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ type (
4646
func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) {
4747
var precompiles map[common.Address]PrecompiledContract
4848
switch {
49-
case evm.chainRules.IsBanach:
50-
precompiles = PrecompiledContractsBanach
49+
case evm.chainRules.IsBernoulli:
50+
precompiles = PrecompiledContractsBernoulli
5151
case evm.chainRules.IsArchimedes:
5252
precompiles = PrecompiledContractsArchimedes
5353
case evm.chainRules.IsBerlin:

core/vm/interpreter.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
7474
if cfg.JumpTable[STOP] == nil {
7575
var jt JumpTable
7676
switch {
77-
case evm.chainRules.IsBanach:
78-
jt = banachInstructionSet
77+
case evm.chainRules.IsCurie:
78+
jt = curieInstructionSet
7979
case evm.chainRules.IsShanghai:
8080
jt = shanghaiInstructionSet
8181
case evm.chainRules.IsLondon:

core/vm/jump_table.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ var (
5959
berlinInstructionSet = newBerlinInstructionSet()
6060
londonInstructionSet = newLondonInstructionSet()
6161
shanghaiInstructionSet = newShanghaiInstructionSet()
62-
banachInstructionSet = newBanachInstructionSet()
62+
curieInstructionSet = newCurieInstructionSet()
6363
)
6464

6565
// JumpTable contains the EVM opcodes supported at a given fork.
6666
type JumpTable [256]*operation
6767

68-
// newBanachInstructionSet returns the frontier, homestead, byzantium,
69-
// contantinople, istanbul, petersburg, berlin, london, shanghai, and banach instructions.
70-
func newBanachInstructionSet() JumpTable {
68+
// newCurieInstructionSet returns the frontier, homestead, byzantium,
69+
// contantinople, istanbul, petersburg, berlin, london, shanghai, and curie instructions.
70+
func newCurieInstructionSet() JumpTable {
7171
instructionSet := newShanghaiInstructionSet()
7272
enable3198(&instructionSet) // Base fee opcode https://eips.ethereum.org/EIPS/eip-3198
7373
return instructionSet

core/vm/runtime/runtime.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ func setDefaults(cfg *Config) {
6969
BerlinBlock: new(big.Int),
7070
LondonBlock: new(big.Int),
7171
ArchimedesBlock: new(big.Int),
72-
BanachBlock: new(big.Int),
72+
ShanghaiBlock: new(big.Int),
73+
BernoulliBlock: new(big.Int),
74+
CurieBlock: new(big.Int),
7375
}
7476
}
7577

eth/catalyst/api.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (api *consensusAPI) AssembleBlock(params assembleBlockParams) (*executableD
142142
Extra: []byte{},
143143
Time: params.Timestamp,
144144
}
145-
if config := api.eth.BlockChain().Config(); config.IsBanach(header.Number) {
145+
if config := api.eth.BlockChain().Config(); config.IsCurie(header.Number) {
146146
stateDb, err := api.eth.BlockChain().StateAt(parent.Root())
147147
if err != nil {
148148
return nil, err
@@ -273,7 +273,7 @@ func insertBlockParamsToBlock(config *chainParams.ChainConfig, parent *types.Hea
273273
GasUsed: params.GasUsed,
274274
Time: params.Timestamp,
275275
}
276-
if config.IsBanach(number) {
276+
if config.IsCurie(number) {
277277
header.BaseFee = misc.CalcBaseFee(config, parent, parentL1BaseFee)
278278
}
279279
block := types.NewBlockWithHeader(header).WithBody(txs, nil /* uncles */)

eth/gasprice/feehistory.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (oracle *Oracle) processBlock(bf *blockFees, percentiles []float64) {
8989
if bf.results.baseFee = bf.header.BaseFee; bf.results.baseFee == nil {
9090
bf.results.baseFee = new(big.Int)
9191
}
92-
if chainconfig.IsBanach(big.NewInt(int64(bf.blockNumber + 1))) {
92+
if chainconfig.IsCurie(big.NewInt(int64(bf.blockNumber + 1))) {
9393
state, err := oracle.backend.StateAt(bf.header.Root)
9494
if err != nil || state == nil {
9595
log.Error("State not found", "number", bf.header.Number, "hash", bf.header.Hash().Hex(), "state", state, "err", err)

eth/gasprice/gasprice_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool) *testBacke
111111
config.ArrowGlacierBlock = londonBlock
112112
config.ArchimedesBlock = londonBlock
113113
config.ShanghaiBlock = londonBlock
114-
config.BanachBlock = londonBlock
114+
config.BernoulliBlock = londonBlock
115+
config.CurieBlock = londonBlock
115116
engine := ethash.NewFaker()
116117
db := rawdb.NewMemoryDatabase()
117118
genesis, err := gspec.Commit(db)

internal/ethapi/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, ha
16811681
"l1Fee": (*hexutil.Big)(receipt.L1Fee),
16821682
}
16831683
// Assign the effective gas price paid
1684-
if !s.b.ChainConfig().IsBanach(bigblock) {
1684+
if !s.b.ChainConfig().IsCurie(bigblock) {
16851685
fields["effectiveGasPrice"] = hexutil.Uint64(tx.GasPrice().Uint64())
16861686
} else {
16871687
header, err := s.b.HeaderByHash(ctx, blockHash)

internal/ethapi/transaction_args.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error {
7878
if args.GasPrice != nil && (args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil) {
7979
return errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
8080
}
81-
// After banach, default to 1559 unless gasPrice is set
81+
// After curie, default to 1559 unless gasPrice is set
8282
head := b.CurrentHeader()
8383
// If user specifies both maxPriorityfee and maxFee, then we do not
84-
// need to consult the chain for defaults. It's definitely a Banach tx.
84+
// need to consult the chain for defaults. It's definitely a Curie tx.
8585
if args.MaxPriorityFeePerGas == nil || args.MaxFeePerGas == nil {
8686
// In this clause, user left some fields unspecified.
87-
if b.ChainConfig().IsBanach(head.Number) && args.GasPrice == nil {
87+
if b.ChainConfig().IsCurie(head.Number) && args.GasPrice == nil {
8888
if args.MaxPriorityFeePerGas == nil {
8989
tip, err := b.SuggestGasTipCap(ctx)
9090
if err != nil {
@@ -110,14 +110,14 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error {
110110
}
111111
} else {
112112
if args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil {
113-
return errors.New("maxFeePerGas or maxPriorityFeePerGas specified but banach is not active yet")
113+
return errors.New("maxFeePerGas or maxPriorityFeePerGas specified but curie is not active yet")
114114
}
115115
if args.GasPrice == nil {
116116
price, err := b.SuggestGasTipCap(ctx)
117117
if err != nil {
118118
return err
119119
}
120-
if b.ChainConfig().IsBanach(head.Number) {
120+
if b.ChainConfig().IsCurie(head.Number) {
121121
// The legacy tx gas price suggestion should not add 2x base fee
122122
// because all fees are consumed, so it would result in a spiral
123123
// upwards.

miner/worker.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
13241324
Time: uint64(timestamp),
13251325
}
13261326
// Set baseFee if we are on an EIP-1559 chain
1327-
if w.chainConfig.IsBanach(header.Number) {
1327+
if w.chainConfig.IsCurie(header.Number) {
13281328
state, err := w.chain.StateAt(parent.Root())
13291329
if err != nil {
13301330
log.Error("Failed to create mining context", "err", err)

0 commit comments

Comments
 (0)