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

Modifications to support snap sync #152

Merged
merged 9 commits into from
Jun 25, 2024
3 changes: 3 additions & 0 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ func (g *Genesis) ToBlock() *types.Block {
if g.Difficulty == nil && g.Mixhash == (common.Hash{}) {
head.Difficulty = params.GenesisDifficulty
}
} else if g.Difficulty == nil {
// In the case of migrated chains we ensure a zero rather than nil difficulty.
head.Difficulty = new(big.Int)
palango marked this conversation as resolved.
Show resolved Hide resolved
}
if g.Config != nil && g.Config.IsLondon(common.Big0) {
if g.BaseFee != nil {
Expand Down
1 change: 1 addition & 0 deletions core/types/celo_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (h *Header) DecodeRLP(s *rlp.Stream) error {
h.GasUsed = decodedHeader.GasUsed
h.Time = decodedHeader.Time
h.Extra = decodedHeader.Extra
h.Difficulty = new(big.Int)
} else {
// After gingerbread
decodedHeader := afterGingerbreadHeader{}
Expand Down