cmd: add amsterdam override flag (#35213)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
This commit is contained in:
Rafael Matias 2026-07-01 11:55:12 +02:00 committed by GitHub
parent 21652ef9ef
commit 7e625dd548
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 35 additions and 10 deletions

View file

@ -62,6 +62,7 @@ var (
Flags: slices.Concat([]cli.Flag{
utils.CachePreimagesFlag,
utils.OverrideOsaka,
utils.OverrideAmsterdam,
utils.OverrideBPO1,
utils.OverrideBPO2,
utils.OverrideUBT,
@ -287,6 +288,10 @@ func initGenesis(ctx *cli.Context) error {
v := ctx.Uint64(utils.OverrideOsaka.Name)
overrides.OverrideOsaka = &v
}
if ctx.IsSet(utils.OverrideAmsterdam.Name) {
v := ctx.Uint64(utils.OverrideAmsterdam.Name)
overrides.OverrideAmsterdam = &v
}
if ctx.IsSet(utils.OverrideBPO1.Name) {
v := ctx.Uint64(utils.OverrideBPO1.Name)
overrides.OverrideBPO1 = &v

View file

@ -228,6 +228,10 @@ func makeFullNode(ctx *cli.Context) *node.Node {
v := ctx.Uint64(utils.OverrideOsaka.Name)
cfg.Eth.OverrideOsaka = &v
}
if ctx.IsSet(utils.OverrideAmsterdam.Name) {
v := ctx.Uint64(utils.OverrideAmsterdam.Name)
cfg.Eth.OverrideAmsterdam = &v
}
if ctx.IsSet(utils.OverrideBPO1.Name) {
v := ctx.Uint64(utils.OverrideBPO1.Name)
cfg.Eth.OverrideBPO1 = &v

View file

@ -57,6 +57,7 @@ var (
utils.USBFlag,
utils.SmartCardDaemonPathFlag,
utils.OverrideOsaka,
utils.OverrideAmsterdam,
utils.OverrideBPO1,
utils.OverrideBPO2,
utils.OverrideUBT,

View file

@ -254,6 +254,11 @@ var (
Usage: "Manually specify the Osaka fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideAmsterdam = &cli.Uint64Flag{
Name: "override.amsterdam",
Usage: "Manually specify the Amsterdam fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideBPO1 = &cli.Uint64Flag{
Name: "override.bpo1",
Usage: "Manually specify the bpo1 fork timestamp, overriding the bundled setting",

View file

@ -49,9 +49,6 @@ func TestEIP8246SelfdestructNoBurn(t *testing.T) {
// TODO: drop this hacky Amsterdam config initialization once the final
// Amsterdam config is available (mirrors TestEthTransferLogs).
config.AmsterdamTime = new(uint64)
blobConfig := *config.BlobScheduleConfig
blobConfig.Amsterdam = blobConfig.Osaka
config.BlobScheduleConfig = &blobConfig
gspec := &Genesis{
Config: &config,

View file

@ -277,10 +277,11 @@ func (e *GenesisMismatchError) Error() string {
// ChainOverrides contains the changes to chain config.
type ChainOverrides struct {
OverrideOsaka *uint64
OverrideBPO1 *uint64
OverrideBPO2 *uint64
OverrideUBT *uint64
OverrideOsaka *uint64
OverrideAmsterdam *uint64
OverrideBPO1 *uint64
OverrideBPO2 *uint64
OverrideUBT *uint64
}
// apply applies the chain overrides on the supplied chain config.
@ -291,6 +292,9 @@ func (o *ChainOverrides) apply(cfg *params.ChainConfig) error {
if o.OverrideOsaka != nil {
cfg.OsakaTime = o.OverrideOsaka
}
if o.OverrideAmsterdam != nil {
cfg.AmsterdamTime = o.OverrideAmsterdam
}
if o.OverrideBPO1 != nil {
cfg.BPO1Time = o.OverrideBPO1
}

View file

@ -45,9 +45,6 @@ var (
func amsterdam8037Config() *params.ChainConfig {
cfg := *params.MergedTestChainConfig
cfg.AmsterdamTime = new(uint64)
blob := *cfg.BlobScheduleConfig
blob.Amsterdam = blob.Osaka
cfg.BlobScheduleConfig = &blob
return &cfg
}

View file

@ -280,6 +280,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
if config.OverrideOsaka != nil {
overrides.OverrideOsaka = config.OverrideOsaka
}
if config.OverrideAmsterdam != nil {
overrides.OverrideAmsterdam = config.OverrideAmsterdam
}
if config.OverrideBPO1 != nil {
overrides.OverrideBPO1 = config.OverrideBPO1
}

View file

@ -206,6 +206,9 @@ type Config struct {
// OverrideOsaka (TODO: remove after the fork)
OverrideOsaka *uint64 `toml:",omitempty"`
// OverrideAmsterdam (TODO: remove after the fork)
OverrideAmsterdam *uint64 `toml:",omitempty"`
// OverrideBPO1 (TODO: remove after the fork)
OverrideBPO1 *uint64 `toml:",omitempty"`

View file

@ -64,6 +64,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
RPCEVMTimeout time.Duration
RPCTxFeeCap float64
OverrideOsaka *uint64 `toml:",omitempty"`
OverrideAmsterdam *uint64 `toml:",omitempty"`
OverrideBPO1 *uint64 `toml:",omitempty"`
OverrideBPO2 *uint64 `toml:",omitempty"`
OverrideUBT *uint64 `toml:",omitempty"`
@ -119,6 +120,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.RPCEVMTimeout = c.RPCEVMTimeout
enc.RPCTxFeeCap = c.RPCTxFeeCap
enc.OverrideOsaka = c.OverrideOsaka
enc.OverrideAmsterdam = c.OverrideAmsterdam
enc.OverrideBPO1 = c.OverrideBPO1
enc.OverrideBPO2 = c.OverrideBPO2
enc.OverrideUBT = c.OverrideUBT
@ -178,6 +180,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
RPCEVMTimeout *time.Duration
RPCTxFeeCap *float64
OverrideOsaka *uint64 `toml:",omitempty"`
OverrideAmsterdam *uint64 `toml:",omitempty"`
OverrideBPO1 *uint64 `toml:",omitempty"`
OverrideBPO2 *uint64 `toml:",omitempty"`
OverrideUBT *uint64 `toml:",omitempty"`
@ -330,6 +333,9 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if dec.OverrideOsaka != nil {
c.OverrideOsaka = dec.OverrideOsaka
}
if dec.OverrideAmsterdam != nil {
c.OverrideAmsterdam = dec.OverrideAmsterdam
}
if dec.OverrideBPO1 != nil {
c.OverrideBPO1 = dec.OverrideBPO1
}