Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

params: schedule shanghai fork on sepolia #26662

Merged
merged 2 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions core/forkid/forkid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ func TestCreation(t *testing.T) {
params.SepoliaChainConfig,
params.SepoliaGenesisHash,
[]testcase{
{0, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block
{1735370, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Last London block
{1735371, 0, ID{Hash: checksumToBytes(0xb96cbd13), Next: 0}}, // First MergeNetsplit block
{0, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople, Petersburg, Istanbul, Berlin and first London block
{1735370, 0, ID{Hash: checksumToBytes(0xfe3366e7), Next: 1735371}}, // Last London block
{1735371, 0, ID{Hash: checksumToBytes(0xb96cbd13), Next: 1677557088}}, // First MergeNetsplit block
{1735372, 1677557087, ID{Hash: checksumToBytes(0xb96cbd13), Next: 1677557088}}, // Last MergeNetsplit block
{1735372, 1677557088, ID{Hash: checksumToBytes(0xf7f9bc08), Next: 0}}, // First Shanghai block
},
},
// Temporary timestamped test cases
Expand Down
3 changes: 3 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ var CheckpointOracles = map[common.Hash]*CheckpointOracleConfig{
GoerliGenesisHash: GoerliCheckpointOracle,
}

func newUint64(val uint64) *uint64 { return &val }

var (
MainnetTerminalTotalDifficulty, _ = new(big.Int).SetString("58_750_000_000_000_000_000_000", 0)

Expand Down Expand Up @@ -163,6 +165,7 @@ var (
TerminalTotalDifficulty: big.NewInt(17_000_000_000_000_000),
TerminalTotalDifficultyPassed: true,
MergeNetsplitBlock: big.NewInt(1735371),
ShanghaiTime: newUint64(1677557088),
Ethash: new(EthashConfig),
}

Expand Down
16 changes: 7 additions & 9 deletions params/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import (
"github.com/ethereum/go-ethereum/common/math"
)

func u64(val uint64) *uint64 { return &val }

func TestCheckCompatible(t *testing.T) {
type test struct {
stored, new *ChainConfig
Expand Down Expand Up @@ -95,19 +93,19 @@ func TestCheckCompatible(t *testing.T) {
},
},
{
stored: &ChainConfig{ShanghaiTime: u64(10)},
new: &ChainConfig{ShanghaiTime: u64(20)},
stored: &ChainConfig{ShanghaiTime: newUint64(10)},
new: &ChainConfig{ShanghaiTime: newUint64(20)},
headTimestamp: 9,
wantErr: nil,
},
{
stored: &ChainConfig{ShanghaiTime: u64(10)},
new: &ChainConfig{ShanghaiTime: u64(20)},
stored: &ChainConfig{ShanghaiTime: newUint64(10)},
new: &ChainConfig{ShanghaiTime: newUint64(20)},
headTimestamp: 25,
wantErr: &ConfigCompatError{
What: "Shanghai fork timestamp",
StoredTime: u64(10),
NewTime: u64(20),
StoredTime: newUint64(10),
NewTime: newUint64(20),
RewindToTime: 9,
},
},
Expand All @@ -123,7 +121,7 @@ func TestCheckCompatible(t *testing.T) {

func TestConfigRules(t *testing.T) {
c := &ChainConfig{
ShanghaiTime: u64(500),
ShanghaiTime: newUint64(500),
}
var stamp uint64
if r := c.Rules(big.NewInt(0), true, stamp); r.IsShanghai {
Expand Down