Skip to content

Commit 34985c4

Browse files
chore: update some comments on block-related types
1 parent 371aa17 commit 34985c4

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tm/tmconsensus/block.go

+13-5
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ type Block struct {
3030

3131
// ID of the data for this block.
3232
// The user-defined consensus strategy provides this ID,
33-
// and the application is responsible for retrieving the raw data belonging to the ID.
33+
// and the driver is responsible for retrieving the raw data belonging to the ID.
3434
//
3535
// The ID is typically, but not necessarily,
36-
// a cryptographic hash of the application data for the block
36+
// a cryptographic hash of the application data for the block.
3737
DataID []byte
3838

3939
// The hash of the app state as a result of executing the previous block.
@@ -57,9 +57,13 @@ type Block struct {
5757

5858
// CommitProof is the commit proof for a block.
5959
type CommitProof struct {
60-
Round uint32 // Necessary to derive signature content.
60+
// Necessary to verify signature content.
61+
Round uint32
6162

62-
PubKeyHash string // Required to validate sparse signatures.
63+
// The hash of the ordered collection of public keys
64+
// of the validators at the height where the commit proof occurred.
65+
// Derived through a [HashScheme] method.
66+
PubKeyHash string
6367

6468
// Keyed by block hash, or an empty string for nil block.
6569
Proofs map[string][]gcrypto.SparseSignature
@@ -72,6 +76,8 @@ type CommittedBlock struct {
7276
}
7377

7478
// ProposedBlock is the data sent by a proposer at the beginning of a round.
79+
// This is the logical representation within the engine,
80+
// not necessarily an exact representation of the data sent across the network.
7581
type ProposedBlock struct {
7682
// The block to consider committing.
7783
Block Block
@@ -106,7 +112,8 @@ type ProposedBlock struct {
106112
Signature []byte
107113
}
108114

109-
// BlockFinalization is the set of data resulting from finalizing (read: evaluating) a block.
115+
// BlockFinalization is the set of data resulting from finalizing
116+
// (read: evaluating and executing) a block.
110117
type BlockFinalization struct {
111118
// The block hash, for an unambiguous reference to which block is in consideration.
112119
BlockHash []byte
@@ -119,6 +126,7 @@ type BlockFinalization struct {
119126
Round uint32
120127

121128
// The hash of the app state after finalizing the block.
129+
// The engine uses this as the [Block.PrevAppStateHash] field when proposing a new block.
122130
AppStateHash []byte
123131

124132
// The next validators after evaluating the block.

0 commit comments

Comments
 (0)