mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Add some metrics improvements (#15922)
* Define TCP and QUIC as `InternetProtocol` (no functional change). * Group types. (No functional changes) * Rename variables and use range syntax. * Add `p2pMaxPeers` and `p2pPeerCountDirectionType` metrics * `p2p_subscribed_topic_peer_total`: Reset to avoid dangling values. * `validateConfig`: - Use `Warning` with fields instead of `Warnf`. - Avoid to both modify in place the input value and return it. * Add `p2p_minimum_peers_per_subnet` metric. * `beaconConfig` => `cfg`. https://github.com/OffchainLabs/prysm/pull/15880#discussion_r2436826215 * Add changelog --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
@@ -1366,16 +1366,16 @@ func TestFetchSidecars(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Nominal", func(t *testing.T) {
|
||||
beaconConfig := params.BeaconConfig()
|
||||
numberOfColumns := beaconConfig.NumberOfColumns
|
||||
samplesPerSlot := beaconConfig.SamplesPerSlot
|
||||
cfg := params.BeaconConfig()
|
||||
numberOfColumns := cfg.NumberOfColumns
|
||||
samplesPerSlot := cfg.SamplesPerSlot
|
||||
|
||||
// Define "now" to be one epoch after genesis time + retention period.
|
||||
genesisTime := time.Date(2025, time.August, 10, 0, 0, 0, 0, time.UTC)
|
||||
secondsPerSlot := beaconConfig.SecondsPerSlot
|
||||
slotsPerEpoch := beaconConfig.SlotsPerEpoch
|
||||
secondsPerSlot := cfg.SecondsPerSlot
|
||||
slotsPerEpoch := cfg.SlotsPerEpoch
|
||||
secondsPerEpoch := uint64(slotsPerEpoch.Mul(secondsPerSlot))
|
||||
retentionEpochs := beaconConfig.MinEpochsForDataColumnSidecarsRequest
|
||||
retentionEpochs := cfg.MinEpochsForDataColumnSidecarsRequest
|
||||
nowWrtGenesisSecs := retentionEpochs.Add(1).Mul(secondsPerEpoch)
|
||||
now := genesisTime.Add(time.Duration(nowWrtGenesisSecs) * time.Second)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user