From 97edffaff5e368c28fc8094e0193848676db557d Mon Sep 17 00:00:00 2001 From: terence Date: Tue, 26 Mar 2024 07:58:41 -0700 Subject: [PATCH] Add bid value metrics (#13804) --- .../v1alpha1/validator/proposer_bellatrix.go | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go index 87b91d46d..c7baa85b3 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go @@ -27,11 +27,20 @@ import ( "go.opencensus.io/trace" ) -// builderGetPayloadMissCount tracks the number of misses when validator tries to get a payload from builder -var builderGetPayloadMissCount = promauto.NewCounter(prometheus.CounterOpts{ - Name: "builder_get_payload_miss_count", - Help: "The number of get payload misses for validator requests to builder", -}) +var ( + builderValueGweiGauge = promauto.NewGauge(prometheus.GaugeOpts{ + Name: "builder_value_gwei", + Help: "Builder payload value in gwei", + }) + localValueGweiGauge = promauto.NewGauge(prometheus.GaugeOpts{ + Name: "local_value_gwei", + Help: "Local payload value in gwei", + }) + builderGetPayloadMissCount = promauto.NewCounter(prometheus.CounterOpts{ + Name: "builder_get_payload_miss_count", + Help: "The number of get payload misses for validator requests to builder", + }) +) // emptyTransactionsRoot represents the returned value of ssz.TransactionsRoot([][]byte{}) and // can be used as a constant to avoid recomputing this value in every call. @@ -92,6 +101,8 @@ func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, loc "builderBoostFactor": builderBoostFactor, }).Warn("Proposer: both local boost and builder boost are using non default values") } + builderValueGweiGauge.Set(float64(builderValueGwei)) + localValueGweiGauge.Set(float64(localValueGwei)) // If we can't get the builder value, just use local block. if higherValueBuilder && withdrawalsMatched { // Builder value is higher and withdrawals match.