Missing validations #2125
Labels
module:consensus
Issues related to consensus module
module:node
Issues related to node module
module:node-data
Issues related to node-data module
type:enhancement
Issues concerning code or feature improvement (performance, refactoring, etc)
Summary
node/src/network/frame.rs:25
, field checksum is declared. It is initialized on line 35, but it is never utilized to verify a header consistency.node-data/src/ledger/attestation.rs:35
, the structureStepVotes
is considered to be empty if any ofbitset
oraggregate_signature
is zero. However, if only one of these fields is zero then it must be treated as an inconsistent structure.node/src/databroker.rs:303
, a child block was added to the inventory. This is part of the traversal from one block specified by its hash through all of its descendants. To ensure consistency of the database, the value ofprev_block_hash
of each child pair should be checked against the hash of its parent.consensus/src/user/provisioners.rs:255-263
, edge case of a single active provisioner is handled. Setmembers
should be checked to be non-empty in the end. It can be useful to double-check thatexclusion
set is equal toeligibles
set in this edge case.node-data/src/ledger.rs:38
, the functionto_str
returns an error because the length of the hexadecimal string is not even. However, the functionhex::encode
called on line 36 always returns even strings.Solution
We recommend adding validation checks and utilizing
debug_assert!
for invariants checks.The text was updated successfully, but these errors were encountered: