Skip to content

Commit

Permalink
feat: schedule DarwinV2 (scroll-tech#1002)
Browse files Browse the repository at this point in the history
* refactor: add darwinV2 to tests, improve log format

* feat: schedule DarwinV2
  • Loading branch information
Thegaram authored and lwedge99 committed Aug 27, 2024
1 parent b24cf81 commit 40397d8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3723,6 +3723,7 @@ func TestCurieTransition(t *testing.T) {
json.Unmarshal(b, &config)
config.CurieBlock = big.NewInt(2)
config.DarwinTime = nil
config.DarwinV2Time = nil

var (
db = rawdb.NewMemoryDatabase()
Expand Down
1 change: 1 addition & 0 deletions core/state_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func TestStateProcessorErrors(t *testing.T) {
BernoulliBlock: big.NewInt(0),
CurieBlock: big.NewInt(0),
DarwinTime: new(uint64),
DarwinV2Time: new(uint64),
Ethash: new(params.EthashConfig),
}
signer = types.LatestSigner(config)
Expand Down
1 change: 1 addition & 0 deletions core/vm/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func setDefaults(cfg *Config) {
BernoulliBlock: new(big.Int),
CurieBlock: new(big.Int),
DarwinTime: new(uint64),
DarwinV2Time: new(uint64),
}
}

Expand Down
1 change: 1 addition & 0 deletions eth/gasprice/gasprice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool, pendingTxC
config.BernoulliBlock = londonBlock
config.CurieBlock = londonBlock
config.DarwinTime = nil
config.DarwinV2Time = nil
engine := ethash.NewFaker()
db := rawdb.NewMemoryDatabase()
genesis, err := gspec.Commit(db)
Expand Down
20 changes: 18 additions & 2 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ var (
BernoulliBlock: nil,
CurieBlock: nil,
DarwinTime: nil,
DarwinV2Time: nil,
Clique: &CliqueConfig{
Period: 3,
Epoch: 30000,
Expand Down Expand Up @@ -323,6 +324,7 @@ var (
BernoulliBlock: big.NewInt(3747132),
CurieBlock: big.NewInt(4740239),
DarwinTime: newUint64(1723622400),
DarwinV2Time: newUint64(1724832000),
Clique: &CliqueConfig{
Period: 3,
Epoch: 30000,
Expand Down Expand Up @@ -362,6 +364,7 @@ var (
BernoulliBlock: big.NewInt(5220340),
CurieBlock: big.NewInt(7096836),
DarwinTime: newUint64(1724227200),
DarwinV2Time: newUint64(1725264000),
Clique: &CliqueConfig{
Period: 3,
Epoch: 30000,
Expand Down Expand Up @@ -407,6 +410,7 @@ var (
BernoulliBlock: big.NewInt(0),
CurieBlock: big.NewInt(0),
DarwinTime: new(uint64),
DarwinV2Time: new(uint64),
TerminalTotalDifficulty: nil,
Ethash: new(EthashConfig),
Clique: nil,
Expand Down Expand Up @@ -450,6 +454,7 @@ var (
BernoulliBlock: big.NewInt(0),
CurieBlock: big.NewInt(0),
DarwinTime: new(uint64),
DarwinV2Time: new(uint64),
TerminalTotalDifficulty: nil,
Ethash: nil,
Clique: &CliqueConfig{Period: 0, Epoch: 30000},
Expand Down Expand Up @@ -488,6 +493,7 @@ var (
BernoulliBlock: big.NewInt(0),
CurieBlock: big.NewInt(0),
DarwinTime: new(uint64),
DarwinV2Time: new(uint64),
TerminalTotalDifficulty: nil,
Ethash: new(EthashConfig),
Clique: nil,
Expand Down Expand Up @@ -527,6 +533,7 @@ var (
BernoulliBlock: big.NewInt(0),
CurieBlock: big.NewInt(0),
DarwinTime: new(uint64),
DarwinV2Time: new(uint64),
TerminalTotalDifficulty: nil,
Ethash: new(EthashConfig),
Clique: nil,
Expand Down Expand Up @@ -744,7 +751,15 @@ func (c *ChainConfig) String() string {
default:
engine = "unknown"
}
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Darwin: %v, Engine: %v, Scroll config: %v}",
darwinTime := "<nil>"
if c.DarwinTime != nil {
darwinTime = fmt.Sprintf("@%v", *c.DarwinTime)
}
darwinV2Time := "<nil>"
if c.DarwinV2Time != nil {
darwinV2Time = fmt.Sprintf("@%v", *c.DarwinV2Time)
}
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Darwin: %v, DarwinV2: %v, Engine: %v, Scroll config: %v}",
c.ChainID,
c.HomesteadBlock,
c.DAOForkBlock,
Expand All @@ -764,7 +779,8 @@ func (c *ChainConfig) String() string {
c.ShanghaiBlock,
c.BernoulliBlock,
c.CurieBlock,
c.DarwinTime,
darwinTime,
darwinV2Time,
engine,
c.Scroll,
)
Expand Down
4 changes: 2 additions & 2 deletions params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (

const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 6 // Minor version component of the current release
VersionPatch = 5 // Patch version component of the current release
VersionMinor = 7 // Minor version component of the current release
VersionPatch = 0 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)

Expand Down

0 comments on commit 40397d8

Please sign in to comment.