abci++: update PrepareProposal API to accept just a list of bytes (#9283)

This changes the ResponsePrepareProposal type, substituting the []TxRecord for just []bytes. This change is made in the .proto file and in all necessary additional places in the code.
This commit is contained in:
William Banfield
2022-08-18 16:33:19 -04:00
committed by GitHub
parent fb9afcc969
commit 1a4d9397e9
16 changed files with 314 additions and 1062 deletions

View File

@@ -136,19 +136,13 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
// error for now (the production code calling this function is expected to panic).
return nil, err
}
txrSet := types.NewTxRecordSet(rpp.TxRecords)
if err := txrSet.Validate(maxDataBytes, block.Txs); err != nil {
txl := types.ToTxs(rpp.Txs)
if err := txl.Validate(maxDataBytes); err != nil {
return nil, err
}
for _, rtx := range txrSet.RemovedTxs() {
if err := blockExec.mempool.RemoveTxByKey(rtx.Key()); err != nil {
blockExec.logger.Debug("error removing transaction from the mempool", "error", err, "tx hash", rtx.Hash())
}
}
itxs := txrSet.IncludedTxs()
return state.MakeBlock(height, itxs, commit, evidence, proposerAddr), nil
return state.MakeBlock(height, txl, commit, evidence, proposerAddr), nil
}
func (blockExec *BlockExecutor) ProcessProposal(