Skip to content

Commit 530e2d6

Browse files
committed
add error docs to commitee impl
1 parent a0b3ea1 commit 530e2d6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

consensus/hotstuff/committee.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ type DynamicCommittee interface {
117117
// * contains no duplicates.
118118
// The list of all legitimate HotStuff participants for the given epoch can be obtained by using `filter.Any`
119119
//
120-
// TODO - do we need this, if we are only checking a single proposer ID?
120+
// No errors are expected during normal operation.
121121
IdentitiesByBlock(blockID flow.Identifier) (flow.IdentityList, error)
122122

123123
// IdentityByBlock returns the full Identity for specified HotStuff participant.

consensus/hotstuff/committees/consensus_committee.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,15 @@ func NewConsensusCommittee(state protocol.State, me flow.Identifier) (*Consensus
189189

190190
// IdentitiesByBlock returns the identities of all authorized consensus participants at the given block.
191191
// The order of the identities is the canonical order.
192+
// No errors are expected during normal operation.
192193
func (c *Consensus) IdentitiesByBlock(blockID flow.Identifier) (flow.IdentityList, error) {
193194
il, err := c.state.AtBlockID(blockID).Identities(filter.IsVotingConsensusCommitteeMember)
194195
return il, err
195196
}
196197

197198
// IdentityByBlock returns the identity of the node with the given node ID at the given block.
199+
// ERROR conditions:
200+
// - model.InvalidSignerError if participantID does NOT correspond to an authorized HotStuff participant at the specified block.
198201
func (c *Consensus) IdentityByBlock(blockID flow.Identifier, nodeID flow.Identifier) (*flow.Identity, error) {
199202
identity, err := c.state.AtBlockID(blockID).Identity(nodeID)
200203
if err != nil {

0 commit comments

Comments
 (0)