Skip to content

Commit

Permalink
update rialto genesis hash
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoyangLiu committed Dec 24, 2020
1 parent e2ce0d9 commit 0612c71
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions cmd/geth/retesteth.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ type CParamsParams struct {
ConstantinopleFixForkBlock *math.HexOrDecimal64 `json:"constantinopleFixForkBlock"`
IstanbulBlock *math.HexOrDecimal64 `json:"istanbulForkBlock"`
RamanujanForkBlock *math.HexOrDecimal64 `json:"ramanujanForkBlock"`
MirrorSyncForkBlock *math.HexOrDecimal64 `json:"mirrorSyncForkBlock"`
ChainID *math.HexOrDecimal256 `json:"chainID"`
MaximumExtraDataSize math.HexOrDecimal64 `json:"maximumExtraDataSize"`
TieBreakingGas bool `json:"tieBreakingGas"`
Expand Down Expand Up @@ -325,6 +326,7 @@ func (api *RetestethAPI) SetChainParams(ctx context.Context, chainParams ChainPa
petersburgBlock *big.Int
istanbulBlock *big.Int
ramanujanBlock *big.Int
mirrorSyncBlock *big.Int
)
if chainParams.Params.HomesteadForkBlock != nil {
homesteadBlock = big.NewInt(int64(*chainParams.Params.HomesteadForkBlock))
Expand Down Expand Up @@ -357,6 +359,9 @@ func (api *RetestethAPI) SetChainParams(ctx context.Context, chainParams ChainPa
if chainParams.Params.RamanujanForkBlock != nil {
ramanujanBlock = big.NewInt(int64(*chainParams.Params.RamanujanForkBlock))
}
if chainParams.Params.MirrorSyncForkBlock != nil {
mirrorSyncBlock = big.NewInt(int64(*chainParams.Params.MirrorSyncForkBlock))
}

genesis := &core.Genesis{
Config: &params.ChainConfig{
Expand All @@ -372,6 +377,7 @@ func (api *RetestethAPI) SetChainParams(ctx context.Context, chainParams ChainPa
PetersburgBlock: petersburgBlock,
IstanbulBlock: istanbulBlock,
RamanujanBlock: ramanujanBlock,
MirrorSyncBlock: mirrorSyncBlock,
},
Nonce: uint64(chainParams.Genesis.Nonce),
Timestamp: uint64(chainParams.Genesis.Timestamp),
Expand Down
2 changes: 1 addition & 1 deletion core/systemcontracts/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func UpgradeBuildInSystemContract(config *params.ChainConfig, blockNumber *big.I
network = defaultNet
}

logger := log.New("system-contract-upgrade")
logger := log.New("system-contract-upgrade", network)
if config.IsOnRamanujan(blockNumber) {
applySystemContractUpgrade(ramanujanUpgrade[network], blockNumber, statedb, logger)
}
Expand Down
10 changes: 7 additions & 3 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (

BSCGenesisHash = common.HexToHash("0x0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b")
ChapelGenesisHash = common.HexToHash("0x6d3c66c5357ec91d5c43af47e234a939b22557cbb552dc45bebbceeed90fbe34")
RialtoGenesisHash = common.HexToHash("0xaa1c1e0af675e846942719466ab72822eff51ebf8462ead0897ae1240e3c0da1")
RialtoGenesisHash = common.HexToHash("0x005dc005bddd1967de6187c1c23be801eb7abdd80cebcc24f341b727b70311d6")
)

// TrustedCheckpoints associates each known checkpoint with the genesis hash of
Expand Down Expand Up @@ -265,9 +265,9 @@ var (
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
RamanujanBlock: big.NewInt(400),
RamanujanBlock: big.NewInt(50),
NielsBlock: big.NewInt(0),
MirrorSyncBlock: big.NewInt(1000),
MirrorSyncBlock: big.NewInt(100),
Parlia: &ParliaConfig{
Period: 3,
Epoch: 200,
Expand Down Expand Up @@ -558,6 +558,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
{"istanbulBlock", c.IstanbulBlock},
{"muirGlacierBlock", c.MuirGlacierBlock},
{"ramanujanBlock", c.RamanujanBlock},
{"mirrorSyncBlock", c.MirrorSyncBlock},
} {
if lastFork.name != "" {
// Next one must be higher number
Expand Down Expand Up @@ -620,6 +621,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
if isForkIncompatible(c.RamanujanBlock, newcfg.RamanujanBlock, head) {
return newCompatError("ramanujan fork block", c.RamanujanBlock, newcfg.RamanujanBlock)
}
if isForkIncompatible(c.MirrorSyncBlock, newcfg.MirrorSyncBlock, head) {
return newCompatError("mirrorSync fork block", c.MirrorSyncBlock, newcfg.MirrorSyncBlock)
}
return nil
}

Expand Down

0 comments on commit 0612c71

Please sign in to comment.