You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 6, 2025. It is now read-only.
consortium-v2: explicitly name conditional check in snapshot's apply
This is a refactor commit that explicitly name some hard to understand
conditional checks in snapshot's apply. It also adds more comments to snapshot
fields.
Copy file name to clipboardExpand all lines: consensus/consortium/v2/snapshot.go
+46-34Lines changed: 46 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -28,20 +28,21 @@ type Snapshot struct {
28
28
ethAPI*ethapi.PublicBlockChainAPI
29
29
sigCache*arc.ARCCache[common.Hash, common.Address] // Cache of recent block signatures to speed up ecrecover
30
30
31
-
Numberuint64`json:"number"`// Block number where the snapshot was created
32
-
Hash common.Hash`json:"hash"`// Block hash where the snapshot was created
33
-
Validatorsmap[common.Address]struct{} `json:"validators,omitempty"`// Set of authorized validators at this moment before Shillin
34
-
Recentsmap[uint64]common.Address`json:"recents"`// Set of recent validators for spam protections
35
-
36
-
// Finality additional fields
37
-
ValidatorsWithBlsPub []finality.ValidatorWithBlsPub`json:"validatorWithBlsPub,omitempty"`// Array of sorted authorized validators and BLS public keys after Shillin
38
-
39
-
// After Tripp, block producers are stored separately in a new field BlockProducers,
40
-
// differentiating from validator candidates, which are stored in ValidatorsWithBlsPub.
41
-
BlockProducers []common.Address`json:"blockProducers,omitempty"`// Array of sorted block producers After Tripp.
42
-
JustifiedBlockNumberuint64`json:"justifiedBlockNumber,omitempty"`// The justified block number
43
-
JustifiedBlockHash common.Hash`json:"justifiedBlockHash,omitempty"`// The justified block hash
44
-
CurrentPerioduint64`json:"currentPeriod,omitempty"`// Period number where the snapshot was created
31
+
Numberuint64`json:"number"`// Block number where the snapshot was created
32
+
Hash common.Hash`json:"hash"`// Block hash where the snapshot was created
33
+
Recentsmap[uint64]common.Address`json:"recents"`// Set of recent validators for spam protections
34
+
35
+
// The block producer list (is able to produce block) before Shillin
0 commit comments