Skip to content

Commit

Permalink
Unify how we check for Jorvik height
Browse files Browse the repository at this point in the history
  • Loading branch information
avalkov committed Jan 7, 2025
1 parent 5c353b1 commit 37daf72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bor/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (k *Keeper) FreezeSet(ctx sdk.Context, id uint64, startBlock uint64, endBlo

// SelectNextProducers selects producers for next span
func (k *Keeper) SelectNextProducers(ctx sdk.Context, seed common.Hash, prevVals []hmTypes.Validator) (vals []hmTypes.Validator, err error) {
if ctx.BlockHeader().Height < helper.GetJorvikHeight() {
if ctx.BlockHeight() < helper.GetJorvikHeight() {
prevVals = nil
}

Expand Down Expand Up @@ -358,7 +358,7 @@ func (k *Keeper) GetNextSpanSeed(ctx sdk.Context, id uint64) (common.Hash, commo
author *common.Address
)

if ctx.BlockHeader().Height < helper.GetJorvikHeight() {
if ctx.BlockHeight() < helper.GetJorvikHeight() {
lastEthBlock := k.GetLastEthBlock(ctx)
// increment last processed header block number
newEthBlock := lastEthBlock.Add(lastEthBlock, big.NewInt(1))
Expand Down
2 changes: 1 addition & 1 deletion bor/side_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func PostHandleMsgEventSpan(ctx sdk.Context, k Keeper, msg sdk.Msg, sideTxResult
"seed", proposeMsg.Seed.String(),
)

if ctx.BlockHeader().Height >= helper.GetJorvikHeight() {
if ctx.BlockHeight() >= helper.GetJorvikHeight() {
var seedSpanID uint64
if proposeMsg.ID < 2 {
seedSpanID = proposeMsg.ID - 1
Expand Down

0 comments on commit 37daf72

Please sign in to comment.