Skip to content

Commit

Permalink
minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
iurii-ssv committed Oct 25, 2024
1 parent 0fcb09f commit e6043e3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
3 changes: 2 additions & 1 deletion protocol/genesis/ssv/runner/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func (r *AggregatorRunner) ProcessPreConsensus(logger *zap.Logger, signedMsg *ge
}
r.metrics.ContinueDutyFullFlow()

r.metrics.StartConsensus()
byts, err := res.MarshalSSZ()
if err != nil {
return errors.Wrap(err, "could not marshal aggregate and proof")
Expand All @@ -131,6 +130,8 @@ func (r *AggregatorRunner) ProcessPreConsensus(logger *zap.Logger, signedMsg *ge
Version: ver,
DataSSZ: byts,
}

r.metrics.StartConsensus()
if err := r.BaseRunner.decide(logger, r, input); err != nil {
return errors.Wrap(err, "can't start new duty runner instance for duty")
}
Expand Down
8 changes: 3 additions & 5 deletions protocol/genesis/ssv/runner/attester.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
spectypes "github.com/ssvlabs/ssv-spec/types"
"time"

"github.com/attestantio/go-eth2-client/spec/phase0"
Expand All @@ -15,11 +14,11 @@ import (
genesisspecssv "github.com/ssvlabs/ssv-spec-pre-cc/ssv"
genesisspectypes "github.com/ssvlabs/ssv-spec-pre-cc/types"
specqbft "github.com/ssvlabs/ssv-spec/qbft"
"go.uber.org/zap"

spectypes "github.com/ssvlabs/ssv-spec/types"
"github.com/ssvlabs/ssv/logging/fields"
"github.com/ssvlabs/ssv/protocol/genesis/qbft/controller"
"github.com/ssvlabs/ssv/protocol/genesis/ssv/runner/metrics"
"go.uber.org/zap"
)

type AttesterRunner struct {
Expand Down Expand Up @@ -231,19 +230,18 @@ func (r *AttesterRunner) executeDuty(logger *zap.Logger, duty *genesisspectypes.
r.started = time.Now()

r.metrics.StartDutyFullFlow()
r.metrics.StartConsensus()

attDataByts, err := attData.MarshalSSZ()
if err != nil {
return errors.Wrap(err, "could not marshal attestation data")
}

input := &genesisspectypes.ConsensusData{
Duty: *duty,
Version: ver,
DataSSZ: attDataByts,
}

r.metrics.StartConsensus()
if err := r.BaseRunner.decide(logger, r, input); err != nil {
return errors.Wrap(err, "can't start new duty runner instance for duty")
}
Expand Down
7 changes: 3 additions & 4 deletions protocol/genesis/ssv/runner/sync_committee.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
spectypes "github.com/ssvlabs/ssv-spec/types"

"github.com/attestantio/go-eth2-client/spec/altair"
"github.com/attestantio/go-eth2-client/spec/phase0"
Expand All @@ -14,11 +13,11 @@ import (
genesisspecssv "github.com/ssvlabs/ssv-spec-pre-cc/ssv"
genesisspectypes "github.com/ssvlabs/ssv-spec-pre-cc/types"
specqbft "github.com/ssvlabs/ssv-spec/qbft"
"go.uber.org/zap"

spectypes "github.com/ssvlabs/ssv-spec/types"
"github.com/ssvlabs/ssv/logging/fields"
"github.com/ssvlabs/ssv/protocol/genesis/qbft/controller"
"github.com/ssvlabs/ssv/protocol/genesis/ssv/runner/metrics"
"go.uber.org/zap"
)

type SyncCommitteeRunner struct {
Expand Down Expand Up @@ -211,14 +210,14 @@ func (r *SyncCommitteeRunner) executeDuty(logger *zap.Logger, duty *genesisspect
}

r.metrics.StartDutyFullFlow()
r.metrics.StartConsensus()

input := &genesisspectypes.ConsensusData{
Duty: *duty,
Version: ver,
DataSSZ: root[:],
}

r.metrics.StartConsensus()
if err := r.BaseRunner.decide(logger, r, input); err != nil {
return errors.Wrap(err, "can't start new duty runner instance for duty")
}
Expand Down
2 changes: 1 addition & 1 deletion protocol/v2/ssv/runner/runner_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type State struct {
RunningInstance *instance.Instance
DecidedValue []byte //spectypes.Encoder
// StartingDuty is the duty the node pulled locally from the beacon node, might be different
// from the actual duty operators have decided upon.
// from the actual duty operators will have decided upon.
StartingDuty spectypes.Duty `json:"StartingDuty,omitempty"`
// Finished marked true when the full successful cycle (pre, consensus and post) got quorum.
Finished bool
Expand Down

0 comments on commit e6043e3

Please sign in to comment.