Skip to content

Commit

Permalink
chore(CometBFTService): minor InitChain cleanup (#2035)
Browse files Browse the repository at this point in the history
  • Loading branch information
abi87 authored Oct 3, 2024
1 parent 455762b commit f767228
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions mod/consensus/pkg/cometbft/service/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"github.com/berachain/beacon-kit/mod/primitives/pkg/encoding/json"
math "github.com/berachain/beacon-kit/mod/primitives/pkg/math"
cmtabci "github.com/cometbft/cometbft/abci/types"
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
sdkversion "github.com/cosmos/cosmos-sdk/version"
Expand Down Expand Up @@ -85,22 +84,6 @@ func (s *Service[LoggerT]) InitChain(

s.finalizeBlockState = s.resetState()

defer func() {
// InitChain represents the state of the application BEFORE the first
// block, i.e. the genesis block. This means that when processing the
// app's InitChain handler, the block height is zero by default.
// However, after genesis is handled the height needs to reflect
// the true block height.
initHeader := cmtproto.Header{
ChainID: req.ChainId,
Time: req.Time,
Height: req.InitialHeight,
}
s.finalizeBlockState.SetContext(
s.finalizeBlockState.Context().WithBlockHeader(initHeader),
)
}()

resValidators, err := s.initChainer(
s.finalizeBlockState.Context(),
req.AppStateBytes,
Expand Down

0 comments on commit f767228

Please sign in to comment.