From 8a9f722caa6457c0757ab39bf81dbf0b4296b35a Mon Sep 17 00:00:00 2001 From: William Banfield Date: Sat, 26 Feb 2022 14:41:01 -0500 Subject: [PATCH] remove most references to endblock --- internal/state/execution.go | 2 +- internal/state/execution_test.go | 10 +++++----- internal/state/state.go | 2 +- light/detector.go | 4 ++-- node/node.go | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/state/execution.go b/internal/state/execution.go index f109f43fe..a633873b1 100644 --- a/internal/state/execution.go +++ b/internal/state/execution.go @@ -485,7 +485,7 @@ func updateState( validatorUpdates []*types.Validator, ) (State, error) { - // Copy the valset so we can apply changes from EndBlock + // Copy the valset so we can apply changes from FinalizeBlock // and update s.LastValidators and s.Validators. nValSet := state.NextValidators.Copy() diff --git a/internal/state/execution_test.go b/internal/state/execution_test.go index 01b3df079..dc4596e0a 100644 --- a/internal/state/execution_test.go +++ b/internal/state/execution_test.go @@ -445,8 +445,8 @@ func TestUpdateValidators(t *testing.T) { } } -// TestEndBlockValidatorUpdates ensures we update validator set and send an event. -func TestEndBlockValidatorUpdates(t *testing.T) { +// TestFinalizeBlockValidatorUpdates ensures we update validator set and send an event. +func TestFinalizeBlockValidatorUpdates(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -478,7 +478,7 @@ func TestEndBlockValidatorUpdates(t *testing.T) { blockExec.SetEventBus(eventBus) updatesSub, err := eventBus.SubscribeWithArgs(ctx, pubsub.SubscribeArgs{ - ClientID: "TestEndBlockValidatorUpdates", + ClientID: "TestFinalizeBlockValidatorUpdates", Query: types.EventQueryValidatorSetUpdates, }) require.NoError(t, err) @@ -519,9 +519,9 @@ func TestEndBlockValidatorUpdates(t *testing.T) { } } -// TestEndBlockValidatorUpdatesResultingInEmptySet checks that processing validator updates that +// TestFinalizeBlockValidatorUpdatesResultingInEmptySet checks that processing validator updates that // would result in empty set causes no panic, an error is raised and NextValidators is not updated -func TestEndBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { +func TestFinalizeBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/internal/state/state.go b/internal/state/state.go index 43cd78fb0..6a39e2c08 100644 --- a/internal/state/state.go +++ b/internal/state/state.go @@ -91,7 +91,7 @@ type State struct { LastHeightValidatorsChanged int64 // Consensus parameters used for validating blocks. - // Changes returned by EndBlock and updated after Commit. + // Changes returned by FinalizeBlock and updated after Commit. ConsensusParams types.ConsensusParams LastHeightConsensusParamsChanged int64 diff --git a/light/detector.go b/light/detector.go index 1d7a066cb..a5ac35a02 100644 --- a/light/detector.go +++ b/light/detector.go @@ -39,8 +39,8 @@ func (c *Client) detectDivergence(ctx context.Context, primaryTrace []*types.Lig lastVerifiedHeader = primaryTrace[len(primaryTrace)-1].SignedHeader witnessesToRemove = make([]int, 0) ) - c.logger.Debug("running detector against trace", "endBlockHeight", lastVerifiedHeader.Height, - "endBlockHash", lastVerifiedHeader.Hash, "length", len(primaryTrace)) + c.logger.Debug("running detector against trace", "finalizeBlockHeight", lastVerifiedHeader.Height, + "finalizeBlockHash", lastVerifiedHeader.Hash, "length", len(primaryTrace)) // launch one goroutine per witness to retrieve the light block of the target height // and compare it with the header from the primary diff --git a/node/node.go b/node/node.go index 7d7b75170..39889230b 100644 --- a/node/node.go +++ b/node/node.go @@ -166,8 +166,8 @@ func makeNode( // EventBus and IndexerService must be started before the handshake because // we might need to index the txs of the replayed block as this might not have happened - // when the node stopped last time (i.e. the node stopped after it saved the block - // but before it indexed the txs, or, endblocker panicked) + // when the node stopped last time (i.e. the node stopped or crqashed after it saved the block + // but before it indexed the txs) eventBus := eventbus.NewDefault(logger.With("module", "events")) if err := eventBus.Start(ctx); err != nil { return nil, combineCloseError(err, makeCloser(closers))