From 37daf7203b4a24822fa19786697a83bebaa93d15 Mon Sep 17 00:00:00 2001 From: Angel Valkov Date: Tue, 7 Jan 2025 09:53:18 +0200 Subject: [PATCH] Unify how we check for Jorvik height --- bor/keeper.go | 4 ++-- bor/side_handler.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bor/keeper.go b/bor/keeper.go index 2fb0205d8..5ebf7e046 100644 --- a/bor/keeper.go +++ b/bor/keeper.go @@ -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 } @@ -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)) diff --git a/bor/side_handler.go b/bor/side_handler.go index 16990dc96..f5e647f5a 100644 --- a/bor/side_handler.go +++ b/bor/side_handler.go @@ -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