Skip to content

Commit

Permalink
Removed all references to Muir Glacier
Browse files Browse the repository at this point in the history
  • Loading branch information
jdowning100 committed May 5, 2023
1 parent 056c6ab commit 4abe2e6
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 63 deletions.
9 changes: 4 additions & 5 deletions consensus/misc/eip1559_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ import (
// do not use e.g. SetInt() on the numbers. For testing only
func copyConfig(original *params.ChainConfig) *params.ChainConfig {
return &params.ChainConfig{
ChainID: original.ChainID,
MuirGlacierBlock: original.MuirGlacierBlock,
BerlinBlock: original.BerlinBlock,
LondonBlock: original.LondonBlock,
Blake3pow: original.Blake3pow,
ChainID: original.ChainID,
BerlinBlock: original.BerlinBlock,
LondonBlock: original.LondonBlock,
Blake3pow: original.Blake3pow,
}
}

Expand Down
9 changes: 4 additions & 5 deletions core/state_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,10 @@ func TestOpETX(t *testing.T) {
func TestStateProcessorErrors(t *testing.T) {
var (
config = &params.ChainConfig{
ChainID: big.NewInt(1),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(params.Blake3powConfig),
ChainID: big.NewInt(1),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(params.Blake3powConfig),
}
signer = types.LatestSigner(config)
testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
Expand Down
7 changes: 3 additions & 4 deletions core/vm/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ type Config struct {
func setDefaults(cfg *Config) {
if cfg.ChainConfig == nil {
cfg.ChainConfig = &params.ChainConfig{
ChainID: big.NewInt(1),
MuirGlacierBlock: new(big.Int),
BerlinBlock: new(big.Int),
LondonBlock: new(big.Int),
ChainID: big.NewInt(1),
BerlinBlock: new(big.Int),
LondonBlock: new(big.Int),
}
}

Expand Down
76 changes: 30 additions & 46 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,62 +35,57 @@ var (
var (
// ColosseumChainConfig is the chain parameters to run a node on the Colosseum network.
ColosseumChainConfig = &ChainConfig{
ChainID: big.NewInt(9000),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: ColosseumGenesisHash,
ChainID: big.NewInt(9000),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: ColosseumGenesisHash,
}

// GardenChainConfig contains the chain parameters to run a node on the Garden test network.
GardenChainConfig = &ChainConfig{
ChainID: big.NewInt(12000),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: GardenGenesisHash,
ChainID: big.NewInt(12000),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: GardenGenesisHash,
}

// OrchardChainConfig contains the chain parameters to run a node on the Orchard test network.
OrchardChainConfig = &ChainConfig{
ChainID: big.NewInt(15000),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: OrchardGenesisHash,
ChainID: big.NewInt(15000),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: OrchardGenesisHash,
}

// GalenaChainConfig contains the chain parameters to run a node on the Galena test network.
GalenaChainConfig = &ChainConfig{
ChainID: big.NewInt(17000),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: GalenaGenesisHash,
ChainID: big.NewInt(17000),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: GalenaGenesisHash,
}

// LocalChainConfig contains the chain parameters to run a node on the Local test network.
LocalChainConfig = &ChainConfig{
ChainID: big.NewInt(1337),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: LocalGenesisHash,
ChainID: big.NewInt(1337),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Blake3pow: new(Blake3powConfig),
GenesisHash: LocalGenesisHash,
}

// AllBlake3powProtocolChanges contains every protocol change (EIPs) introduced
// and accepted by the Ethereum core developers into the Blake3pow consensus.
//
// This configuration is intentionally not using keyed fields to force anyone
// adding flags to the config to also have to set these fields.
AllBlake3powProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), big.NewInt(0), big.NewInt(0), new(Blake3powConfig), common.Hash{}}
AllBlake3powProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), big.NewInt(0), new(Blake3powConfig), common.Hash{}}

TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), big.NewInt(0), big.NewInt(0), new(Blake3powConfig), common.Hash{}}
TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), big.NewInt(0), new(Blake3powConfig), common.Hash{}}
TestRules = TestChainConfig.Rules(new(big.Int))
)

Expand All @@ -102,9 +97,8 @@ var (
type ChainConfig struct {
ChainID *big.Int `json:"chainId"` // chainId identifies the current chain and is used for replay protection

MuirGlacierBlock *big.Int `json:"muirGlacierBlock,omitempty"` // Eip-2384 (bomb delay) switch block (nil = no fork, 0 = already activated)
BerlinBlock *big.Int `json:"berlinBlock,omitempty"` // Berlin switch block (nil = no fork, 0 = already on berlin)
LondonBlock *big.Int `json:"londonBlock,omitempty"` // London switch block (nil = no fork, 0 = already on london)
BerlinBlock *big.Int `json:"berlinBlock,omitempty"` // Berlin switch block (nil = no fork, 0 = already on berlin)
LondonBlock *big.Int `json:"londonBlock,omitempty"` // London switch block (nil = no fork, 0 = already on london)

// Various consensus engines
Blake3pow *Blake3powConfig `json:"blake3pow,omitempty"`
Expand All @@ -128,20 +122,14 @@ func (c *ChainConfig) String() string {
default:
engine = "unknown"
}
return fmt.Sprintf("{ChainID: %v Muir Glacier: %v, Berlin: %v, London: %v, Engine: %v}",
return fmt.Sprintf("{ChainID: %v Berlin: %v, London: %v, Engine: %v}",
c.ChainID,
c.MuirGlacierBlock,
c.BerlinBlock,
c.LondonBlock,
engine,
)
}

// IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
func (c *ChainConfig) IsMuirGlacier(num *big.Int) bool {
return isForked(c.MuirGlacierBlock, num)
}

// IsBerlin returns whether num is either equal to the Berlin fork block or greater.
func (c *ChainConfig) IsBerlin(num *big.Int) bool {
return isForked(c.BerlinBlock, num)
Expand Down Expand Up @@ -180,7 +168,6 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
}
var lastFork fork
for _, cur := range []fork{
{name: "muirGlacierBlock", block: c.MuirGlacierBlock, optional: true},
{name: "berlinBlock", block: c.BerlinBlock},
{name: "londonBlock", block: c.LondonBlock},
} {
Expand All @@ -206,9 +193,6 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
}

func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *ConfigCompatError {
if isForkIncompatible(c.MuirGlacierBlock, newcfg.MuirGlacierBlock, head) {
return newCompatError("Muir Glacier fork block", c.MuirGlacierBlock, newcfg.MuirGlacierBlock)
}
if isForkIncompatible(c.BerlinBlock, newcfg.BerlinBlock, head) {
return newCompatError("Berlin fork block", c.BerlinBlock, newcfg.BerlinBlock)
}
Expand Down
3 changes: 0 additions & 3 deletions tests/difficulty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ func TestDifficulty(t *testing.T) {

dt.config("MainNetwork", mainnetChainConfig)
dt.config("CustomMainNetwork", mainnetChainConfig)
dt.config("EIP2384", params.ChainConfig{
MuirGlacierBlock: big.NewInt(0),
})
dt.config("difficulty.json", mainnetChainConfig)

dt.walk(t, difficultyTestDir, func(t *testing.T, name string, test *DifficultyTest) {
Expand Down

0 comments on commit 4abe2e6

Please sign in to comment.