-
Notifications
You must be signed in to change notification settings - Fork 922
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stream Duties Client Implementation (#5867)
* include validator client stream * Update validator/client/validator_attest.go * gazelle * rem extraneous logs * fixing tests * resolve most tests * gaz * add lock * ivan feedback * pass tests for update protect * gaz * duties gaz * no need for canonical head slot * fix ctx leak * fmt * add in feature flag * add streaming subpackage * add polling/streaming separation * able to build * fix duplicate package names * fix polling * imports * confirm it works * fixed up comment * go lint comments * gaz * build * Update validator/client/streaming/service_test.go Co-authored-by: terence tsao <terence@prysmaticlabs.com> * tidy * fmt * add stream duties to e2e * add stream duties to e2e flags Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: terence tsao <terence@prysmaticlabs.com>
- Loading branch information
1 parent
10af753
commit 7067c84
Showing
45 changed files
with
4,630 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
load("@prysm//tools/go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = ["metrics.go"], | ||
importpath = "github.com/prysmaticlabs/prysm/validator/client/metrics", | ||
visibility = ["//validator/client:__subpackages__"], | ||
deps = [ | ||
"@com_github_prometheus_client_golang//prometheus:go_default_library", | ||
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
package metrics | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
||
var ( | ||
// ValidatorStatusesGaugeVec used to track validator statuses by public key. | ||
ValidatorStatusesGaugeVec = promauto.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Namespace: "validator", | ||
Name: "statuses", | ||
Help: "validator statuses: 0 UNKNOWN, 1 DEPOSITED, 2 PENDING, 3 ACTIVE, 4 EXITING, 5 SLASHING, 6 EXITED", | ||
}, | ||
[]string{ | ||
// Validator pubkey. | ||
"pubkey", | ||
}, | ||
) | ||
// ValidatorAggSuccessVec used to count successful aggregations. | ||
ValidatorAggSuccessVec = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "validator", | ||
Name: "successful_aggregations", | ||
}, | ||
[]string{ | ||
// validator pubkey | ||
"pubkey", | ||
}, | ||
) | ||
// ValidatorAggFailVec used to count failed aggregations. | ||
ValidatorAggFailVec = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "validator", | ||
Name: "failed_aggregations", | ||
}, | ||
[]string{ | ||
// validator pubkey | ||
"pubkey", | ||
}, | ||
) | ||
// ValidatorProposeSuccessVec used to count successful proposals. | ||
ValidatorProposeSuccessVec = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "validator", | ||
Name: "successful_proposals", | ||
}, | ||
[]string{ | ||
// validator pubkey | ||
"pubkey", | ||
}, | ||
) | ||
// ValidatorProposeFailVec used to count failed proposals. | ||
ValidatorProposeFailVec = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "validator", | ||
Name: "failed_proposals", | ||
}, | ||
[]string{ | ||
// validator pubkey | ||
"pubkey", | ||
}, | ||
) | ||
// ValidatorProposeFailVecSlasher used to count failed proposals by slashing protection. | ||
ValidatorProposeFailVecSlasher = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Name: "validator_proposals_rejected_total", | ||
Help: "Count the block proposals rejected by slashing protection.", | ||
}, | ||
[]string{ | ||
// validator pubkey | ||
"pubkey", | ||
}, | ||
) | ||
// ValidatorBalancesGaugeVec used to keep track of validator balances by public key. | ||
ValidatorBalancesGaugeVec = promauto.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Namespace: "validator", | ||
Name: "balance", | ||
Help: "current validator balance.", | ||
}, | ||
[]string{ | ||
// validator pubkey | ||
"pubkey", | ||
}, | ||
) | ||
// ValidatorAttestSuccessVec used to count successful attestations. | ||
ValidatorAttestSuccessVec = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "validator", | ||
Name: "successful_attestations", | ||
}, | ||
[]string{ | ||
// validator pubkey | ||
"pubkey", | ||
}, | ||
) | ||
// ValidatorAttestFailVec used to count failed attestations. | ||
ValidatorAttestFailVec = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "validator", | ||
Name: "failed_attestations", | ||
}, | ||
[]string{ | ||
// validator pubkey | ||
"pubkey", | ||
}, | ||
) | ||
// ValidatorAttestFailVecSlasher used to count failed attestations by slashing protection. | ||
ValidatorAttestFailVecSlasher = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Name: "validator_attestations_rejected_total", | ||
Help: "Count the attestations rejected by slashing protection.", | ||
}, | ||
[]string{ | ||
// validator pubkey | ||
"pubkey", | ||
}, | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
validator/client/fake_validator_test.go → ...tor/client/polling/fake_validator_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package polling | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
validator/client/runner.go → validator/client/polling/runner.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package polling | ||
|
||
import ( | ||
"context" | ||
|
2 changes: 1 addition & 1 deletion
2
validator/client/runner_test.go → validator/client/polling/runner_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package polling | ||
|
||
import ( | ||
"context" | ||
|
4 changes: 1 addition & 3 deletions
4
validator/client/service.go → validator/client/polling/service.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
validator/client/service_test.go → validator/client/polling/service_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package client | ||
package polling | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.