Skip to content

Commit

Permalink
consensus/bor: fetch validator set using parent hash
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 committed Dec 10, 2024
1 parent 67b12b5 commit 14c8887
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions consensus/bor/bor.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,9 @@ func (c *Bor) verifyCascadingFields(chain consensus.ChainHeaderReader, header *t

// Verify the validator list match the local contract
if IsSprintStart(number+1, c.config.CalculateSprint(number)) {
newValidators, err := c.spanner.GetCurrentValidatorsByBlockNrOrHash(context.Background(), rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber), number+1)

// Use parent block's hash to make the eth_call to fetch validators so that the state being
// used to make the call is of the same fork.
newValidators, err := c.spanner.GetCurrentValidatorsByBlockNrOrHash(context.Background(), rpc.BlockNumberOrHashWithHash(header.ParentHash, false), number+1)
if err != nil {
return err
}
Expand Down

0 comments on commit 14c8887

Please sign in to comment.