Compare commits

...

15 Commits

Author SHA1 Message Date
satushh
4ae247e0b9 Merge branch 'develop' into eas-metric-2 2025-12-09 16:49:44 +00:00
satushh
ce55a55f30 remove some unwanted logs 2025-12-01 12:07:06 +00:00
satushh
bb8374ae31 Merge branch 'develop' into eas-metric-2 2025-12-01 12:04:35 +00:00
satushh
391c20f2ba fmt 2025-12-01 12:04:02 +00:00
satushh
c0c825d69e remove unwanted GetCustodyInfo 2025-12-01 11:49:33 +00:00
satushh
af736f6260 Merge branch 'develop' into eas-metric-2 2025-11-28 18:42:38 +00:00
satushh
b4dadc35bf naming and description changes 2025-11-28 18:42:02 +00:00
satushh
e5ab8495b0 remove common package and keep metrics in respective packages 2025-11-28 18:39:54 +00:00
satushh
2cfce7265e remove unwanted refreshCustodyMetrics and update db metric during startup 2025-11-28 13:50:31 +00:00
satushh
d4f5dc9823 tidy up 2025-11-27 18:42:23 +00:00
satushh
72c75bce83 changelog 2025-11-27 18:10:39 +00:00
satushh
37764704fe format 2025-11-27 18:09:06 +00:00
satushh
730f31d346 bazel run //:gazelle -- fix 2025-11-27 18:07:17 +00:00
satushh
170bbc166f Merge branch 'develop' into eas-metric-2 2025-11-27 18:02:35 +00:00
satushh
8167e2a22c eas metric + GetCustodyInfo for restarts 2025-11-27 17:59:19 +00:00
10 changed files with 54 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ go_library(
"//beacon-chain/db:go_default_library",
"//beacon-chain/db/filesystem:go_default_library",
"//beacon-chain/db/filters:go_default_library",
"//beacon-chain/db/kv:go_default_library",
"//beacon-chain/execution:go_default_library",
"//beacon-chain/forkchoice:go_default_library",
"//beacon-chain/forkchoice/doubly-linked-tree:go_default_library",

View File

@@ -19,6 +19,7 @@ import (
"github.com/OffchainLabs/prysm/v7/beacon-chain/core/transition"
"github.com/OffchainLabs/prysm/v7/beacon-chain/db"
"github.com/OffchainLabs/prysm/v7/beacon-chain/db/filesystem"
"github.com/OffchainLabs/prysm/v7/beacon-chain/db/kv"
"github.com/OffchainLabs/prysm/v7/beacon-chain/execution"
f "github.com/OffchainLabs/prysm/v7/beacon-chain/forkchoice"
lightClient "github.com/OffchainLabs/prysm/v7/beacon-chain/light-client"
@@ -300,6 +301,8 @@ func (s *Service) StartFromSavedState(saved state.BeaconState) error {
return errors.Wrap(err, "could not get and save custody group count")
}
kv.EarliestAvailableSlotMetric.Set(float64(earliestAvailableSlot))
if _, _, err := s.cfg.P2P.UpdateCustodyInfo(earliestAvailableSlot, custodySubnetCount); err != nil {
return errors.Wrap(err, "update custody info")
}

View File

View File

@@ -19,6 +19,7 @@ go_library(
"kv.go",
"lightclient.go",
"log.go",
"metrics.go",
"migration.go",
"migration_archived_index.go",
"migration_block_slot_index.go",

View File

@@ -70,6 +70,8 @@ func (s *Store) UpdateCustodyInfo(ctx context.Context, earliestAvailableSlot pri
"groupCount": storedGroupCount,
}).Debug("Custody info")
EarliestAvailableSlotMetric.Set(float64(storedEarliestAvailableSlot))
return storedEarliestAvailableSlot, storedGroupCount, nil
}
@@ -143,6 +145,8 @@ func (s *Store) UpdateEarliestAvailableSlot(ctx context.Context, earliestAvailab
log.WithField("earliestAvailableSlot", storedEarliestAvailableSlot).Debug("Updated earliest available slot")
EarliestAvailableSlotMetric.Set(float64(storedEarliestAvailableSlot))
return nil
}

View File

@@ -0,0 +1,14 @@
package kv
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
// EarliestAvailableSlotMetric tracks the earliest available slot in the database
EarliestAvailableSlotMetric = promauto.NewGauge(prometheus.GaugeOpts{
Name: "earliest_available_slot_db",
Help: "The earliest available slot tracked by the database",
})
)

View File

@@ -20,6 +20,7 @@ go_library(
"interfaces.go",
"log.go",
"message_id.go",
"metrics.go",
"monitoring.go",
"options.go",
"pubsub.go",

View File

@@ -22,6 +22,8 @@ func (s *Service) EarliestAvailableSlot(ctx context.Context) (primitives.Slot, e
return 0, errors.Wrap(err, "wait for custody info")
}
EarliestAvailableSlotMetric.Set(float64(custodyInfo.earliestAvailableSlot))
return custodyInfo.earliestAvailableSlot, nil
}
@@ -80,11 +82,15 @@ func (s *Service) UpdateCustodyInfo(earliestAvailableSlot primitives.Slot, custo
close(s.custodyInfoSet)
// Update P2P metric when initializing custody info
EarliestAvailableSlotMetric.Set(float64(earliestAvailableSlot))
return earliestAvailableSlot, custodyGroupCount, nil
}
inMemory := s.custodyInfo
if custodyGroupCount <= inMemory.groupCount {
EarliestAvailableSlotMetric.Set(float64(inMemory.earliestAvailableSlot))
return inMemory.earliestAvailableSlot, inMemory.groupCount, nil
}
@@ -97,6 +103,7 @@ func (s *Service) UpdateCustodyInfo(earliestAvailableSlot primitives.Slot, custo
if custodyGroupCount <= samplesPerSlot {
inMemory.groupCount = custodyGroupCount
EarliestAvailableSlotMetric.Set(float64(inMemory.earliestAvailableSlot))
return inMemory.earliestAvailableSlot, custodyGroupCount, nil
}
@@ -107,11 +114,15 @@ func (s *Service) UpdateCustodyInfo(earliestAvailableSlot primitives.Slot, custo
if earliestAvailableSlot < fuluForkSlot {
inMemory.groupCount = custodyGroupCount
EarliestAvailableSlotMetric.Set(float64(inMemory.earliestAvailableSlot))
return inMemory.earliestAvailableSlot, custodyGroupCount, nil
}
inMemory.earliestAvailableSlot = earliestAvailableSlot
inMemory.groupCount = custodyGroupCount
EarliestAvailableSlotMetric.Set(float64(earliestAvailableSlot))
return earliestAvailableSlot, custodyGroupCount, nil
}
@@ -133,6 +144,7 @@ func (s *Service) UpdateEarliestAvailableSlot(earliestAvailableSlot primitives.S
// Allow decrease (for backfill scenarios)
if earliestAvailableSlot < s.custodyInfo.earliestAvailableSlot {
s.custodyInfo.earliestAvailableSlot = earliestAvailableSlot
EarliestAvailableSlotMetric.Set(float64(earliestAvailableSlot))
return nil
}
@@ -163,6 +175,7 @@ func (s *Service) UpdateEarliestAvailableSlot(earliestAvailableSlot primitives.S
}
s.custodyInfo.earliestAvailableSlot = earliestAvailableSlot
EarliestAvailableSlotMetric.Set(float64(earliestAvailableSlot))
return nil
}

View File

@@ -0,0 +1,14 @@
package p2p
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
// EarliestAvailableSlotMetric tracks the earliest available slot in the p2p service
EarliestAvailableSlotMetric = promauto.NewGauge(prometheus.GaugeOpts{
Name: "earliest_available_slot_p2p",
Help: "The earliest available slot tracked by the p2p service",
})
)

View File

@@ -0,0 +1,3 @@
### Added
- Metric for earliest available slot.