Skip to content

Commit

Permalink
Merge pull request #79 from bobanetwork/revert-75
Browse files Browse the repository at this point in the history
Revert #75 and add hardfork logs
  • Loading branch information
boyuan-chen authored Jan 18, 2024
2 parents 7f00ec8 + 23b0742 commit a9730db
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion consensus/merge/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (s *Merge) verifyHeader(chain consensus.ChainHeaderReader, header, parent *

// Verify existence / non-existence of withdrawalsHash
shanghai := chain.Config().IsShanghai(header.Time)
if shanghai && header.WithdrawalsHash == nil && !chain.Config().IsOptimism() {
if shanghai && header.WithdrawalsHash == nil {
return fmt.Errorf("missing withdrawalsHash")
}
if !shanghai && header.WithdrawalsHash != nil {
Expand Down
5 changes: 4 additions & 1 deletion erigon-lib/chain/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type Config struct {
func (c *Config) String() string {
engine := c.getEngine()

return fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Prague: %v, Engine: %v}",
return fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Prague: %v, BedrockBlock: %v, RegolithTime: %v, CanyonTime: %v, Engine: %v}",
c.ChainID,
c.HomesteadBlock,
c.DAOForkBlock,
Expand All @@ -113,6 +113,9 @@ func (c *Config) String() string {
c.ShanghaiTime,
c.CancunTime,
c.PragueTime,
c.BedrockBlock,
c.RegolithTime,
c.CanyonTime,
engine,
)
}
Expand Down
4 changes: 3 additions & 1 deletion params/chainspecs/boba-sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@
"eip1559Elasticity": 6,
"eip1559Denominator": 50
},
"shanghaiTime": 1705429032
"regolithTime": 1705600788,
"shanghaiTime": 1705600788,
"canyonTime": 1705600788
}
2 changes: 1 addition & 1 deletion turbo/engineapi/engine_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (s *EngineServer) checkWithdrawalsPresence(time uint64, withdrawals []*type
if !s.config.IsShanghai(time) && withdrawals != nil {
return &rpc.InvalidParamsError{Message: "withdrawals before shanghai"}
}
if s.config.IsShanghai(time) && withdrawals == nil && !s.config.IsOptimism() {
if s.config.IsShanghai(time) && withdrawals == nil {
return &rpc.InvalidParamsError{Message: "missing withdrawals list"}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion turbo/execution/eth1/block_building.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (e *EthereumExecutionModule) checkWithdrawalsPresence(time uint64, withdraw
if !e.config.IsShanghai(time) && withdrawals != nil {
return &rpc.InvalidParamsError{Message: "withdrawals before shanghai"}
}
if e.config.IsShanghai(time) && withdrawals == nil && !e.config.IsOptimism() {
if e.config.IsShanghai(time) && withdrawals == nil {
return &rpc.InvalidParamsError{Message: "missing withdrawals list"}
}
return nil
Expand Down

0 comments on commit a9730db

Please sign in to comment.