Browse Source

annotate methods with notes from spec

wb/txrset
William Banfield 3 years ago
parent
commit
f52a2858c8
No known key found for this signature in database GPG Key ID: EFAD3442BF29E3AC
2 changed files with 22 additions and 1 deletions
  1. +2
    -1
      internal/state/execution.go
  2. +20
    -0
      internal/state/state.go

+ 2
- 1
internal/state/execution.go 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,
},
)


+ 20
- 0
internal/state/state.go 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
}


Loading…
Cancel
Save