From b5e4c2a9615cd174289ba39630ca57fdd2b1f169 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 2 Oct 2024 14:43:24 +0200 Subject: [PATCH 1/2] cleaned up InitChain --- mod/consensus/pkg/cometbft/service/abci.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/mod/consensus/pkg/cometbft/service/abci.go b/mod/consensus/pkg/cometbft/service/abci.go index cc8cda64fe..19acd798bc 100644 --- a/mod/consensus/pkg/cometbft/service/abci.go +++ b/mod/consensus/pkg/cometbft/service/abci.go @@ -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" @@ -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, From e879eb4c696b12aac13accb20a577445f5192c2a Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 2 Oct 2024 22:50:10 +0200 Subject: [PATCH 2/2] updated mockery --- .../pkg/engine-primitives/mocks/blobs_bundle.mock.go | 2 +- .../mocks/built_execution_payload_env.mock.go | 2 +- .../engine-primitives/mocks/payload_attributer.mock.go | 2 +- mod/node-api/backend/mocks/availability_store.mock.go | 2 +- mod/node-api/backend/mocks/beacon_block_header.mock.go | 2 +- mod/node-api/backend/mocks/beacon_state.mock.go | 2 +- mod/node-api/backend/mocks/block_store.mock.go | 2 +- mod/node-api/backend/mocks/deposit_store.mock.go | 2 +- mod/node-api/backend/mocks/node.mock.go | 2 +- mod/node-api/backend/mocks/state_processor.mock.go | 2 +- mod/node-api/backend/mocks/storage_backend.mock.go | 2 +- mod/node-api/backend/mocks/validator.mock.go | 2 +- mod/node-api/backend/mocks/withdrawal.mock.go | 2 +- .../backend/mocks/withdrawal_credentials.mock.go | 2 +- .../pkg/services/registry/mocks/basic.mock.go | 2 +- .../pkg/services/registry/mocks/dispatcher.mock.go | 2 +- .../services/registry/mocks/registry_option.mock.go | 2 +- mod/primitives/pkg/crypto/mocks/bls_signer.mock.go | 10 +++++++--- mod/storage/pkg/interfaces/mocks/db.mock.go | 2 +- mod/storage/pkg/pruner/mocks/beacon_block.mock.go | 2 +- mod/storage/pkg/pruner/mocks/block_event.mock.go | 2 +- mod/storage/pkg/pruner/mocks/prunable.mock.go | 2 +- mod/storage/pkg/pruner/mocks/pruner.mock.go | 2 +- 23 files changed, 29 insertions(+), 25 deletions(-) diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go index b6479d42c9..af1804a20a 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go index 72872323c1..4e89e3dea7 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go index 7643d0ea2e..9b7e3685d4 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/availability_store.mock.go b/mod/node-api/backend/mocks/availability_store.mock.go index 9d06105727..08d384065d 100644 --- a/mod/node-api/backend/mocks/availability_store.mock.go +++ b/mod/node-api/backend/mocks/availability_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/beacon_block_header.mock.go b/mod/node-api/backend/mocks/beacon_block_header.mock.go index d653d99f61..afec4e3be8 100644 --- a/mod/node-api/backend/mocks/beacon_block_header.mock.go +++ b/mod/node-api/backend/mocks/beacon_block_header.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/beacon_state.mock.go b/mod/node-api/backend/mocks/beacon_state.mock.go index 8e83c1802c..fdd75d78f8 100644 --- a/mod/node-api/backend/mocks/beacon_state.mock.go +++ b/mod/node-api/backend/mocks/beacon_state.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/block_store.mock.go b/mod/node-api/backend/mocks/block_store.mock.go index 54697e55ed..e19547d3e9 100644 --- a/mod/node-api/backend/mocks/block_store.mock.go +++ b/mod/node-api/backend/mocks/block_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/deposit_store.mock.go b/mod/node-api/backend/mocks/deposit_store.mock.go index b58d3f343f..71c1c1e4a2 100644 --- a/mod/node-api/backend/mocks/deposit_store.mock.go +++ b/mod/node-api/backend/mocks/deposit_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/node.mock.go b/mod/node-api/backend/mocks/node.mock.go index d1b4f47f38..248413332d 100644 --- a/mod/node-api/backend/mocks/node.mock.go +++ b/mod/node-api/backend/mocks/node.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/state_processor.mock.go b/mod/node-api/backend/mocks/state_processor.mock.go index ed2421ae1a..bb85657785 100644 --- a/mod/node-api/backend/mocks/state_processor.mock.go +++ b/mod/node-api/backend/mocks/state_processor.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/storage_backend.mock.go b/mod/node-api/backend/mocks/storage_backend.mock.go index 7d36ea8b5c..1f7ea3673b 100644 --- a/mod/node-api/backend/mocks/storage_backend.mock.go +++ b/mod/node-api/backend/mocks/storage_backend.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/validator.mock.go b/mod/node-api/backend/mocks/validator.mock.go index 06f9856b18..dbd6ef8045 100644 --- a/mod/node-api/backend/mocks/validator.mock.go +++ b/mod/node-api/backend/mocks/validator.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/withdrawal.mock.go b/mod/node-api/backend/mocks/withdrawal.mock.go index 76f6fc1f08..c6468d3c14 100644 --- a/mod/node-api/backend/mocks/withdrawal.mock.go +++ b/mod/node-api/backend/mocks/withdrawal.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/withdrawal_credentials.mock.go b/mod/node-api/backend/mocks/withdrawal_credentials.mock.go index 2d3cd746cf..1c7b469442 100644 --- a/mod/node-api/backend/mocks/withdrawal_credentials.mock.go +++ b/mod/node-api/backend/mocks/withdrawal_credentials.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/basic.mock.go b/mod/node-core/pkg/services/registry/mocks/basic.mock.go index 3e0d760b88..dc9cb38ece 100644 --- a/mod/node-core/pkg/services/registry/mocks/basic.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/basic.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go b/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go index bdead0d532..238233dcc0 100644 --- a/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go b/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go index 565e8021e8..58b47f4514 100644 --- a/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go index 149525b88f..0b306d6509 100644 --- a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go +++ b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks @@ -32,7 +32,9 @@ func (_m *BLSSigner) PublicKey() crypto.BLSPubkey { if rf, ok := ret.Get(0).(func() crypto.BLSPubkey); ok { r0 = rf() } else { - r0 = ret.Get(0).(crypto.BLSPubkey) + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.BLSPubkey) + } } return r0 @@ -81,7 +83,9 @@ func (_m *BLSSigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { if rf, ok := ret.Get(0).(func([]byte) crypto.BLSSignature); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(crypto.BLSSignature) + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.BLSSignature) + } } if rf, ok := ret.Get(1).(func([]byte) error); ok { diff --git a/mod/storage/pkg/interfaces/mocks/db.mock.go b/mod/storage/pkg/interfaces/mocks/db.mock.go index 683f7fc14f..ac7b734427 100644 --- a/mod/storage/pkg/interfaces/mocks/db.mock.go +++ b/mod/storage/pkg/interfaces/mocks/db.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/beacon_block.mock.go b/mod/storage/pkg/pruner/mocks/beacon_block.mock.go index 4fdea13a1b..3859cc6053 100644 --- a/mod/storage/pkg/pruner/mocks/beacon_block.mock.go +++ b/mod/storage/pkg/pruner/mocks/beacon_block.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/block_event.mock.go b/mod/storage/pkg/pruner/mocks/block_event.mock.go index 515ac303ef..4b24eb033a 100644 --- a/mod/storage/pkg/pruner/mocks/block_event.mock.go +++ b/mod/storage/pkg/pruner/mocks/block_event.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/prunable.mock.go b/mod/storage/pkg/pruner/mocks/prunable.mock.go index 3116601d8c..fba09727d5 100644 --- a/mod/storage/pkg/pruner/mocks/prunable.mock.go +++ b/mod/storage/pkg/pruner/mocks/prunable.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/pruner.mock.go b/mod/storage/pkg/pruner/mocks/pruner.mock.go index a437f0fd73..19bb2c3f4c 100644 --- a/mod/storage/pkg/pruner/mocks/pruner.mock.go +++ b/mod/storage/pkg/pruner/mocks/pruner.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.1. DO NOT EDIT. +// Code generated by mockery v2.46.2. DO NOT EDIT. package mocks