Skip to content

Commit

Permalink
Refactor: remove unused IsSolid flag
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoog committed Apr 25, 2024
1 parent 2027aec commit c3b481b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
7 changes: 0 additions & 7 deletions pkg/protocol/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ type Chain struct {
// IsEvicted contains a flag that indicates whether this chain was evicted.
IsEvicted reactive.Event

// IsSolid contains a flag that indicates whether this chain is solid (has a continuous connection to the root).
IsSolid reactive.Event

// shouldEvict contains a flag that indicates whether this chain should be evicted.
shouldEvict reactive.Event

Expand Down Expand Up @@ -89,7 +86,6 @@ func newChain(chains *Chains) *Chain {
StartEngine: reactive.NewVariable[bool](),
Engine: reactive.NewVariable[*engine.Engine](),
IsEvicted: reactive.NewEvent(),
IsSolid: reactive.NewEvent(),
shouldEvict: reactive.NewEvent(),

chains: chains,
Expand Down Expand Up @@ -213,7 +209,6 @@ func (c *Chain) initLogger() (shutdown func()) {
c.StartEngine.LogUpdates(c, log.LevelDebug, "StartEngine"),
c.Engine.LogUpdates(c, log.LevelTrace, "Engine", (*engine.Engine).LogName),
c.IsEvicted.LogUpdates(c, log.LevelTrace, "IsEvicted"),
c.IsSolid.LogUpdates(c, log.LevelTrace, "IsSolid"),
c.shouldEvict.LogUpdates(c, log.LevelTrace, "shouldEvict"),

c.Logger.Shutdown,
Expand All @@ -237,8 +232,6 @@ func (c *Chain) initDerivedProperties() (shutdown func()) {
c.deriveShouldEvict(forkingPoint, parentChain),
)
}),

c.IsSolid.InheritFrom(forkingPoint.IsSolid),
)
}),
),
Expand Down
9 changes: 0 additions & 9 deletions pkg/protocol/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ type Commitment struct {
// IsRoot contains a flag indicating if this Commitment is the root of the Chain.
IsRoot reactive.Event

// IsSolid contains a flag indicating if this Commitment is solid (has all the commitments in its past cone until
// the RootCommitment).
IsSolid reactive.Event

// IsAttested contains a flag indicating if we have received attestations for this Commitment.
IsAttested reactive.Event

Expand Down Expand Up @@ -112,7 +108,6 @@ func newCommitment(commitments *Commitments, model *model.Commitment) *Commitmen
CumulativeAttestedWeight: reactive.NewVariable[uint64](),
CumulativeVerifiedWeight: reactive.NewVariable[uint64](),
IsRoot: reactive.NewEvent(),
IsSolid: reactive.NewEvent(),
IsAttested: reactive.NewEvent(),
IsSynced: reactive.NewEvent(),
IsCommittable: reactive.NewEvent(),
Expand Down Expand Up @@ -224,7 +219,6 @@ func (c *Commitment) initLogger() (shutdown func()) {
c.CumulativeAttestedWeight.LogUpdates(c, log.LevelTrace, "CumulativeAttestedWeight"),
c.CumulativeVerifiedWeight.LogUpdates(c, log.LevelTrace, "CumulativeVerifiedWeight"),
c.IsRoot.LogUpdates(c, log.LevelTrace, "IsRoot"),
c.IsSolid.LogUpdates(c, log.LevelTrace, "IsSolid"),
c.IsAttested.LogUpdates(c, log.LevelTrace, "IsAttested"),
c.IsSynced.LogUpdates(c, log.LevelTrace, "IsSynced"),
c.IsCommittable.LogUpdates(c, log.LevelTrace, "IsCommittable"),
Expand All @@ -241,7 +235,6 @@ func (c *Commitment) initDerivedProperties() (shutdown func()) {
return lo.BatchReverse(
// mark commitments that are marked as root as verified
c.IsVerified.InheritFrom(c.IsRoot),
c.IsSolid.InheritFrom(c.IsRoot),

c.IsRoot.OnTrigger(func() {
c.CumulativeAttestedWeight.Set(c.Commitment.CumulativeWeight())
Expand Down Expand Up @@ -277,8 +270,6 @@ func (c *Commitment) initDerivedProperties() (shutdown func()) {
}),
)
}),

c.IsSolid.InheritFrom(parent.IsSolid),
)
}),

Expand Down

0 comments on commit c3b481b

Please sign in to comment.