refactor: remove comet info from consensus as it will be stored in context for v2 (#21120)
This commit is contained in:
@@ -400,24 +400,6 @@ func (c *Consensus[T]) FinalizeBlock(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// TODO evaluate this approach vs. service using context.
|
||||
// cometInfo := &consensustypes.MsgUpdateCometInfo{
|
||||
// Authority: c.consensusAuthority,
|
||||
// CometInfo: &consensustypes.CometInfo{
|
||||
// Evidence: req.Misbehavior,
|
||||
// ValidatorsHash: req.NextValidatorsHash,
|
||||
// ProposerAddress: req.ProposerAddress,
|
||||
// LastCommit: req.DecidedLastCommit,
|
||||
// },
|
||||
// }
|
||||
//
|
||||
// ctx = context.WithValue(ctx, corecontext.CometInfoKey, &comet.Info{
|
||||
// Evidence: sdktypes.ToSDKEvidence(req.Misbehavior),
|
||||
// ValidatorsHash: req.NextValidatorsHash,
|
||||
// ProposerAddress: req.ProposerAddress,
|
||||
// LastCommit: sdktypes.ToSDKCommitInfo(req.DecidedLastCommit),
|
||||
// })
|
||||
|
||||
// we don't need to deliver the block in the genesis block
|
||||
if req.Height == int64(c.initialHeight) {
|
||||
appHash, err := c.store.Commit(store.NewChangeset())
|
||||
@@ -450,7 +432,6 @@ func (c *Consensus[T]) FinalizeBlock(
|
||||
AppHash: cid.Hash,
|
||||
ChainId: c.chainID,
|
||||
Txs: decodedTxs,
|
||||
// ConsensusMessages: []transaction.Msg{cometInfo},
|
||||
}
|
||||
|
||||
ciCtx := contextWithCometInfo(ctx, comet.Info{
|
||||
|
||||
@@ -149,7 +149,7 @@ func (s STF[T]) DeliverBlock(
|
||||
if err = isCtxCancelled(ctx); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
txResults[i] = s.deliverTx(ctx, newState, txBytes, transaction.ExecModeFinalize, hi)
|
||||
txResults[i] = s.deliverTx(exCtx, newState, txBytes, transaction.ExecModeFinalize, hi)
|
||||
}
|
||||
// reset events
|
||||
exCtx.events = make([]event.Event, 0)
|
||||
@@ -564,10 +564,10 @@ func (s STF[T]) makeContext(
|
||||
) *executionContext {
|
||||
valuedCtx := context.WithValue(ctx, corecontext.ExecModeKey, execMode)
|
||||
return newExecutionContext(
|
||||
valuedCtx,
|
||||
s.makeGasMeter,
|
||||
s.makeGasMeteredState,
|
||||
s.branchFn,
|
||||
valuedCtx,
|
||||
sender,
|
||||
store,
|
||||
execMode,
|
||||
@@ -577,10 +577,10 @@ func (s STF[T]) makeContext(
|
||||
}
|
||||
|
||||
func newExecutionContext(
|
||||
ctx context.Context,
|
||||
makeGasMeterFn makeGasMeterFn,
|
||||
makeGasMeteredStoreFn makeGasMeteredStateFn,
|
||||
branchFn branchFn,
|
||||
ctx context.Context,
|
||||
sender transaction.Identity,
|
||||
state store.WriterMap,
|
||||
execMode transaction.ExecMode,
|
||||
|
||||
Reference in New Issue
Block a user