Skip to content

Commit

Permalink
core: clearup testflag for Bohr (#2727)
Browse files Browse the repository at this point in the history
  • Loading branch information
buddh0 authored Sep 29, 2024
1 parent 27f67a5 commit bff9d25
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 61 deletions.
5 changes: 0 additions & 5 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ var (
Flags: flags.Merge([]cli.Flag{
utils.CachePreimagesFlag,
utils.OverridePassedForkTime,
utils.OverrideBohr,
utils.OverridePascal,
utils.OverridePrague,
utils.OverrideVerkle,
Expand Down Expand Up @@ -260,10 +259,6 @@ func initGenesis(ctx *cli.Context) error {
v := ctx.Uint64(utils.OverridePassedForkTime.Name)
overrides.OverridePassedForkTime = &v
}
if ctx.IsSet(utils.OverrideBohr.Name) {
v := ctx.Uint64(utils.OverrideBohr.Name)
overrides.OverrideBohr = &v
}
if ctx.IsSet(utils.OverridePascal.Name) {
v := ctx.Uint64(utils.OverridePascal.Name)
overrides.OverridePascal = &v
Expand Down
4 changes: 0 additions & 4 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
v := ctx.Uint64(utils.OverridePassedForkTime.Name)
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) {
v := ctx.Uint64(utils.OverridePascal.Name)
cfg.Eth.OverridePascal = &v
Expand Down
1 change: 0 additions & 1 deletion cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ var (
utils.SmartCardDaemonPathFlag,
utils.RialtoHash,
utils.OverridePassedForkTime,
utils.OverrideBohr,
utils.OverridePascal,
utils.OverridePrague,
utils.OverrideVerkle,
Expand Down
5 changes: 0 additions & 5 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,6 @@ var (
Usage: "Manually specify the hard fork timestamps which have passed on the mainnet, overriding the bundled setting",
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{
Name: "override.pascal",
Usage: "Manually specify the Pascal fork timestamp, overriding the bundled setting",
Expand Down
5 changes: 1 addition & 4 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
type ChainOverrides struct {
OverridePassedForkTime *uint64
OverrideBohr *uint64
OverridePascal *uint64
OverridePrague *uint64
OverrideVerkle *uint64
Expand Down Expand Up @@ -254,9 +253,7 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, g
config.CancunTime = overrides.OverridePassedForkTime
config.HaberTime = overrides.OverridePassedForkTime
config.HaberFixTime = overrides.OverridePassedForkTime
}
if overrides != nil && overrides.OverrideBohr != nil {
config.BohrTime = overrides.OverrideBohr
config.BohrTime = overrides.OverridePassedForkTime
}
if overrides != nil && overrides.OverridePascal != nil {
config.PascalTime = overrides.OverridePascal
Expand Down
1 change: 0 additions & 1 deletion core/systemcontracts/bohr/rialto/StakeHubContract

This file was deleted.

1 change: 0 additions & 1 deletion core/systemcontracts/bohr/rialto/ValidatorContract

This file was deleted.

8 changes: 0 additions & 8 deletions core/systemcontracts/bohr/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,3 @@ var (
//go:embed chapel/StakeHubContract
ChapelStakeHubContract string
)

// contract codes for Rialto upgrade
var (
//go:embed rialto/ValidatorContract
RialtoValidatorContract string
//go:embed rialto/StakeHubContract
RialtoStakeHubContract string
)
16 changes: 0 additions & 16 deletions core/systemcontracts/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
UpgradeName: "pascal",
Configs: []*UpgradeConfig{
Expand Down
5 changes: 1 addition & 4 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
chainConfig.CancunTime = config.OverridePassedForkTime
chainConfig.HaberTime = config.OverridePassedForkTime
chainConfig.HaberFixTime = config.OverridePassedForkTime
chainConfig.BohrTime = config.OverridePassedForkTime
overrides.OverridePassedForkTime = config.OverridePassedForkTime
}
if config.OverrideBohr != nil {
chainConfig.BohrTime = config.OverrideBohr
overrides.OverrideBohr = config.OverrideBohr
}
if config.OverridePascal != nil {
chainConfig.PascalTime = config.OverridePascal
overrides.OverridePascal = config.OverridePascal
Expand Down
3 changes: 0 additions & 3 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@ type Config struct {
// OverridePassedForkTime
OverridePassedForkTime *uint64 `toml:",omitempty"`

// OverrideBohr (TODO: remove after the fork)
OverrideBohr *uint64 `toml:",omitempty"`

// OverridePascal (TODO: remove after the fork)
OverridePascal *uint64 `toml:",omitempty"`

Expand Down
6 changes: 0 additions & 6 deletions eth/ethconfig/gen_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ var (
HaberTime: newUint64(0),
HaberFixTime: newUint64(0),
BohrTime: newUint64(0),
// TODO
PascalTime: newUint64(0),
PragueTime: newUint64(0),
// TODO: set them to `0` when passed on the mainnet
PascalTime: nil,
PragueTime: nil,

Parlia: &ParliaConfig{
Period: 3,
Expand Down

0 comments on commit bff9d25

Please sign in to comment.