Skip to content

Commit

Permalink
add analyse failed duty function
Browse files Browse the repository at this point in the history
  • Loading branch information
dB2510 committed Jan 19, 2023
1 parent a6bdde6 commit 14e0062
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 21 deletions.
2 changes: 2 additions & 0 deletions core/consensus/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ func (c *Component) propose(ctx context.Context, duty core.Duty, value proto.Mes

if !decided {
consensusTimeout.WithLabelValues(duty.Type.String()).Inc()

return errors.New("consensus timeout", z.Str("duty", duty.String()))
}

return nil
Expand Down
6 changes: 6 additions & 0 deletions core/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ type Tracker interface {
// FetcherFetched sends Fetcher component's events to tracker.
FetcherFetched(context.Context, Duty, DutyDefinitionSet, error)

// ConsensusProposed sends Consensus component's events to tracker.
ConsensusProposed(context.Context, Duty, UnsignedDataSet, error)

// DutyDBStored sends DutyDB component's store events to tracker.
DutyDBStored(context.Context, Duty, UnsignedDataSet, error)

Expand All @@ -187,6 +190,9 @@ type Tracker interface {
// ParSigDBStoredExternal sends ParSigDB component's store external events to tracker.
ParSigDBStoredExternal(context.Context, Duty, ParSignedDataSet, error)

// SigAggAggregated sends SigAgg component's events to tracker.
SigAggAggregated(context.Context, Duty, PubKey, []ParSignedData, error)

// BroadcasterBroadcast sends Broadcaster component's broadcast events to tracker.
BroadcasterBroadcast(context.Context, Duty, PubKey, SignedData, error)
}
Expand Down
2 changes: 2 additions & 0 deletions core/sigagg/sigagg.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func (a *Aggregator) Subscribe(fn func(context.Context, core.Duty, core.PubKey,

// Aggregate aggregates the partially signed duty data for the DV.
func (a *Aggregator) Aggregate(ctx context.Context, duty core.Duty, pubkey core.PubKey, parSigs []core.ParSignedData) error {
ctx = log.WithTopic(ctx, "sigagg")

if len(parSigs) < a.threshold {
return errors.New("require threshold signatures")
} else if a.threshold == 0 {
Expand Down
7 changes: 0 additions & 7 deletions core/tracker/tracker2/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,4 @@ var (
Name: "inconsistent_parsigs_total",
Help: "Total number of duties that contained inconsistent partial signed data by duty type",
}, []string{"duty"})

inclusionDelay = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "core",
Subsystem: "tracker",
Name: "inclusion_delay",
Help: "Cluster's average attestation inclusion delay in slots",
})
)
Loading

0 comments on commit 14e0062

Please sign in to comment.