annotate methods with notes from spec

This commit is contained in:
William Banfield
2022-03-07 19:09:06 -05:00
parent 778e2e8908
commit f52a2858c8
2 changed files with 22 additions and 1 deletions

View File

@@ -125,7 +125,8 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
Txs: block.Txs.ToSliceOfBytes(),
LocalLastCommit: extendedCommitInfo(localLastCommit),
ByzantineValidators: block.Evidence.ToABCI(),
MaxTxBytes: maxDataBytes,
// TODO:(wbanfield) ensure that this maxBytes is the correct value to pass through.
MaxTxBytes: maxDataBytes,
},
)

View File

@@ -284,7 +284,27 @@ func (state State) BlockFromResponsePrepareProposal(height int64, rpp *abci.Resp
}
func (state State) ValidateResponsePrepareProposal(rpp *abci.ResponsePrepareProposal) error {
rpp := abci.ResponsePrepareProposal{
ModifiedTx: false,
TxRecords: []*abci.TxRecord{},
// TODO: What is this field for?
// Need to check that the size of appsigned does not grow I guess, says spec
AppSignedUpdates: [][]byte{},
}
// TODO: Implement logic to validate block.
// Checks:
// * Size does not exceed max size bytes
// * Check that there are no duplicate Tx in the list
// * Check that there are no new or modified transactions marked as 'removed' or 'unmodified'
// * Check that there are no unmodified transactions marked as txadded
// * no tx marked as Tx unknown
//
// Spec says to just forgo this validators turn to propose if failure
// Another option is to panic. I think fail to propose is fine, but we should
// make it clear that this occurs to operators.
return nil
}