core: clearup testflag for Bohr (#2727)

This commit is contained in:
buddho 2024-09-29 13:30:45 +08:00 committed by GitHub
parent 27f67a5210
commit bff9d252d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 5 additions and 61 deletions

@ -63,7 +63,6 @@ var (
Flags: flags.Merge([]cli.Flag{ Flags: flags.Merge([]cli.Flag{
utils.CachePreimagesFlag, utils.CachePreimagesFlag,
utils.OverridePassedForkTime, utils.OverridePassedForkTime,
utils.OverrideBohr,
utils.OverridePascal, utils.OverridePascal,
utils.OverridePrague, utils.OverridePrague,
utils.OverrideVerkle, utils.OverrideVerkle,
@ -260,10 +259,6 @@ func initGenesis(ctx *cli.Context) error {
v := ctx.Uint64(utils.OverridePassedForkTime.Name) v := ctx.Uint64(utils.OverridePassedForkTime.Name)
overrides.OverridePassedForkTime = &v overrides.OverridePassedForkTime = &v
} }
if ctx.IsSet(utils.OverrideBohr.Name) {
v := ctx.Uint64(utils.OverrideBohr.Name)
overrides.OverrideBohr = &v
}
if ctx.IsSet(utils.OverridePascal.Name) { if ctx.IsSet(utils.OverridePascal.Name) {
v := ctx.Uint64(utils.OverridePascal.Name) v := ctx.Uint64(utils.OverridePascal.Name)
overrides.OverridePascal = &v overrides.OverridePascal = &v

@ -191,10 +191,6 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
v := ctx.Uint64(utils.OverridePassedForkTime.Name) v := ctx.Uint64(utils.OverridePassedForkTime.Name)
cfg.Eth.OverridePassedForkTime = &v cfg.Eth.OverridePassedForkTime = &v
} }
if ctx.IsSet(utils.OverrideBohr.Name) {
v := ctx.Uint64(utils.OverrideBohr.Name)
cfg.Eth.OverrideBohr = &v
}
if ctx.IsSet(utils.OverridePascal.Name) { if ctx.IsSet(utils.OverridePascal.Name) {
v := ctx.Uint64(utils.OverridePascal.Name) v := ctx.Uint64(utils.OverridePascal.Name)
cfg.Eth.OverridePascal = &v cfg.Eth.OverridePascal = &v

@ -73,7 +73,6 @@ var (
utils.SmartCardDaemonPathFlag, utils.SmartCardDaemonPathFlag,
utils.RialtoHash, utils.RialtoHash,
utils.OverridePassedForkTime, utils.OverridePassedForkTime,
utils.OverrideBohr,
utils.OverridePascal, utils.OverridePascal,
utils.OverridePrague, utils.OverridePrague,
utils.OverrideVerkle, utils.OverrideVerkle,

@ -313,11 +313,6 @@ var (
Usage: "Manually specify the hard fork timestamps which have passed on the mainnet, overriding the bundled setting", Usage: "Manually specify the hard fork timestamps which have passed on the mainnet, overriding the bundled setting",
Category: flags.EthCategory, Category: flags.EthCategory,
} }
OverrideBohr = &cli.Uint64Flag{
Name: "override.bohr",
Usage: "Manually specify the Bohr fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverridePascal = &cli.Uint64Flag{ OverridePascal = &cli.Uint64Flag{
Name: "override.pascal", Name: "override.pascal",
Usage: "Manually specify the Pascal fork timestamp, overriding the bundled setting", Usage: "Manually specify the Pascal fork timestamp, overriding the bundled setting",

@ -217,7 +217,6 @@ func (e *GenesisMismatchError) Error() string {
// Typically, these modifications involve hardforks that are not enabled on the BSC mainnet, intended for testing purposes. // Typically, these modifications involve hardforks that are not enabled on the BSC mainnet, intended for testing purposes.
type ChainOverrides struct { type ChainOverrides struct {
OverridePassedForkTime *uint64 OverridePassedForkTime *uint64
OverrideBohr *uint64
OverridePascal *uint64 OverridePascal *uint64
OverridePrague *uint64 OverridePrague *uint64
OverrideVerkle *uint64 OverrideVerkle *uint64
@ -254,9 +253,7 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, g
config.CancunTime = overrides.OverridePassedForkTime config.CancunTime = overrides.OverridePassedForkTime
config.HaberTime = overrides.OverridePassedForkTime config.HaberTime = overrides.OverridePassedForkTime
config.HaberFixTime = overrides.OverridePassedForkTime config.HaberFixTime = overrides.OverridePassedForkTime
} config.BohrTime = overrides.OverridePassedForkTime
if overrides != nil && overrides.OverrideBohr != nil {
config.BohrTime = overrides.OverrideBohr
} }
if overrides != nil && overrides.OverridePascal != nil { if overrides != nil && overrides.OverridePascal != nil {
config.PascalTime = overrides.OverridePascal config.PascalTime = overrides.OverridePascal

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -17,11 +17,3 @@ var (
//go:embed chapel/StakeHubContract //go:embed chapel/StakeHubContract
ChapelStakeHubContract string ChapelStakeHubContract string
) )
// contract codes for Rialto upgrade
var (
//go:embed rialto/ValidatorContract
RialtoValidatorContract string
//go:embed rialto/StakeHubContract
RialtoStakeHubContract string
)

@ -776,22 +776,6 @@ func init() {
}, },
} }
bohrUpgrade[rialtoNet] = &Upgrade{
UpgradeName: "bohr",
Configs: []*UpgradeConfig{
{
ContractAddr: common.HexToAddress(ValidatorContract),
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/398c9364aad5261c1ecd90ac3ab2df89b65c45e3",
Code: bohr.RialtoValidatorContract,
},
{
ContractAddr: common.HexToAddress(StakeHubContract),
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/398c9364aad5261c1ecd90ac3ab2df89b65c45e3",
Code: bohr.RialtoStakeHubContract,
},
},
}
pascalUpgrade[mainNet] = &Upgrade{ pascalUpgrade[mainNet] = &Upgrade{
UpgradeName: "pascal", UpgradeName: "pascal",
Configs: []*UpgradeConfig{ Configs: []*UpgradeConfig{

@ -193,12 +193,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
chainConfig.CancunTime = config.OverridePassedForkTime chainConfig.CancunTime = config.OverridePassedForkTime
chainConfig.HaberTime = config.OverridePassedForkTime chainConfig.HaberTime = config.OverridePassedForkTime
chainConfig.HaberFixTime = config.OverridePassedForkTime chainConfig.HaberFixTime = config.OverridePassedForkTime
chainConfig.BohrTime = config.OverridePassedForkTime
overrides.OverridePassedForkTime = config.OverridePassedForkTime overrides.OverridePassedForkTime = config.OverridePassedForkTime
} }
if config.OverrideBohr != nil {
chainConfig.BohrTime = config.OverrideBohr
overrides.OverrideBohr = config.OverrideBohr
}
if config.OverridePascal != nil { if config.OverridePascal != nil {
chainConfig.PascalTime = config.OverridePascal chainConfig.PascalTime = config.OverridePascal
overrides.OverridePascal = config.OverridePascal overrides.OverridePascal = config.OverridePascal

@ -191,9 +191,6 @@ type Config struct {
// OverridePassedForkTime // OverridePassedForkTime
OverridePassedForkTime *uint64 `toml:",omitempty"` OverridePassedForkTime *uint64 `toml:",omitempty"`
// OverrideBohr (TODO: remove after the fork)
OverrideBohr *uint64 `toml:",omitempty"`
// OverridePascal (TODO: remove after the fork) // OverridePascal (TODO: remove after the fork)
OverridePascal *uint64 `toml:",omitempty"` OverridePascal *uint64 `toml:",omitempty"`

@ -71,7 +71,6 @@ func (c Config) MarshalTOML() (interface{}, error) {
RPCEVMTimeout time.Duration RPCEVMTimeout time.Duration
RPCTxFeeCap float64 RPCTxFeeCap float64
OverridePassedForkTime *uint64 `toml:",omitempty"` OverridePassedForkTime *uint64 `toml:",omitempty"`
OverrideBohr *uint64 `toml:",omitempty"`
OverridePascal *uint64 `toml:",omitempty"` OverridePascal *uint64 `toml:",omitempty"`
OverridePrague *uint64 `toml:",omitempty"` OverridePrague *uint64 `toml:",omitempty"`
OverrideVerkle *uint64 `toml:",omitempty"` OverrideVerkle *uint64 `toml:",omitempty"`
@ -132,7 +131,6 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.RPCEVMTimeout = c.RPCEVMTimeout enc.RPCEVMTimeout = c.RPCEVMTimeout
enc.RPCTxFeeCap = c.RPCTxFeeCap enc.RPCTxFeeCap = c.RPCTxFeeCap
enc.OverridePassedForkTime = c.OverridePassedForkTime enc.OverridePassedForkTime = c.OverridePassedForkTime
enc.OverrideBohr = c.OverrideBohr
enc.OverridePascal = c.OverridePascal enc.OverridePascal = c.OverridePascal
enc.OverridePrague = c.OverridePrague enc.OverridePrague = c.OverridePrague
enc.OverrideVerkle = c.OverrideVerkle enc.OverrideVerkle = c.OverrideVerkle
@ -197,7 +195,6 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
RPCEVMTimeout *time.Duration RPCEVMTimeout *time.Duration
RPCTxFeeCap *float64 RPCTxFeeCap *float64
OverridePassedForkTime *uint64 `toml:",omitempty"` OverridePassedForkTime *uint64 `toml:",omitempty"`
OverrideBohr *uint64 `toml:",omitempty"`
OverridePascal *uint64 `toml:",omitempty"` OverridePascal *uint64 `toml:",omitempty"`
OverridePrague *uint64 `toml:",omitempty"` OverridePrague *uint64 `toml:",omitempty"`
OverrideVerkle *uint64 `toml:",omitempty"` OverrideVerkle *uint64 `toml:",omitempty"`
@ -369,9 +366,6 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if dec.OverridePassedForkTime != nil { if dec.OverridePassedForkTime != nil {
c.OverridePassedForkTime = dec.OverridePassedForkTime c.OverridePassedForkTime = dec.OverridePassedForkTime
} }
if dec.OverrideBohr != nil {
c.OverrideBohr = dec.OverrideBohr
}
if dec.OverridePascal != nil { if dec.OverridePascal != nil {
c.OverridePascal = dec.OverridePascal c.OverridePascal = dec.OverridePascal
} }

@ -244,9 +244,9 @@ var (
HaberTime: newUint64(0), HaberTime: newUint64(0),
HaberFixTime: newUint64(0), HaberFixTime: newUint64(0),
BohrTime: newUint64(0), BohrTime: newUint64(0),
// TODO // TODO: set them to `0` when passed on the mainnet
PascalTime: newUint64(0), PascalTime: nil,
PragueTime: newUint64(0), PragueTime: nil,
Parlia: &ParliaConfig{ Parlia: &ParliaConfig{
Period: 3, Period: 3,