From 0dceb831ca7c44ee8ebfdb667a793a042f0b93c4 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 23 Sep 2024 17:35:45 +0100 Subject: [PATCH] chore: clean up from electra review (#7102) --- packages/beacon-node/src/api/impl/validator/index.ts | 2 +- packages/beacon-node/src/metrics/metrics/beacon.ts | 2 +- packages/beacon-node/src/metrics/metrics/lodestar.ts | 4 ++-- packages/beacon-node/test/unit/util/sszBytes.test.ts | 2 +- packages/params/src/presets/mainnet.ts | 1 - packages/params/src/presets/minimal.ts | 1 - 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/beacon-node/src/api/impl/validator/index.ts b/packages/beacon-node/src/api/impl/validator/index.ts index d2ce6672c89f..4876975c1bea 100644 --- a/packages/beacon-node/src/api/impl/validator/index.ts +++ b/packages/beacon-node/src/api/impl/validator/index.ts @@ -1087,7 +1087,7 @@ export function getValidatorApi( await waitForSlot(slot); // Must never request for a future slot > currentSlot - const dataRootHex = toHex(attestationDataRoot); + const dataRootHex = toRootHex(attestationDataRoot); const aggregate = chain.attestationPool.getAggregate(slot, null, dataRootHex); const fork = chain.config.getForkName(slot); diff --git a/packages/beacon-node/src/metrics/metrics/beacon.ts b/packages/beacon-node/src/metrics/metrics/beacon.ts index 96bb6bea4174..949999dbb1f4 100644 --- a/packages/beacon-node/src/metrics/metrics/beacon.ts +++ b/packages/beacon-node/src/metrics/metrics/beacon.ts @@ -122,7 +122,7 @@ export function createBeaconMetrics(register: RegistryMetricCreator) { headState: { unfinalizedPubkeyCacheSize: register.gauge({ - name: "head_state_unfinalized_pubkey_cache_size", + name: "beacon_head_state_unfinalized_pubkey_cache_size", help: "Current size of the unfinalizedPubkey2Index cache in the head state", }), }, diff --git a/packages/beacon-node/src/metrics/metrics/lodestar.ts b/packages/beacon-node/src/metrics/metrics/lodestar.ts index 4b076471dcab..fb4ea61b6523 100644 --- a/packages/beacon-node/src/metrics/metrics/lodestar.ts +++ b/packages/beacon-node/src/metrics/metrics/lodestar.ts @@ -381,11 +381,11 @@ export function createLodestarMetrics( epochCache: { finalizedPubkeyDuplicateInsert: register.gauge({ - name: "lodestar_epoch_cache_finalized_pubkey_duplicate_insert", + name: "lodestar_epoch_cache_finalized_pubkey_duplicate_insert_total", help: "Total count of duplicate insert of finalized pubkeys", }), newUnFinalizedPubkey: register.gauge({ - name: "lodestar_epoch_cache_new_unfinalized_pubkey", + name: "lodestar_epoch_cache_new_unfinalized_pubkey_total", help: "Total count of unfinalized pubkeys added", }), }, diff --git a/packages/beacon-node/test/unit/util/sszBytes.test.ts b/packages/beacon-node/test/unit/util/sszBytes.test.ts index 612eea5a4388..8b72c31df6c8 100644 --- a/packages/beacon-node/test/unit/util/sszBytes.test.ts +++ b/packages/beacon-node/test/unit/util/sszBytes.test.ts @@ -6,7 +6,7 @@ import {ForkName, MAX_COMMITTEES_PER_SLOT} from "@lodestar/params"; import { getAttDataFromAttestationSerialized, getAttDataFromSignedAggregateAndProofPhase0, - getAggregationBitsFromAttestationSerialized as getAggregationBitsFromAttestationSerialized, + getAggregationBitsFromAttestationSerialized, getBlockRootFromAttestationSerialized, getBlockRootFromSignedAggregateAndProofSerialized, getSlotFromAttestationSerialized, diff --git a/packages/params/src/presets/mainnet.ts b/packages/params/src/presets/mainnet.ts index a4a88aac1f58..ca599e990df4 100644 --- a/packages/params/src/presets/mainnet.ts +++ b/packages/params/src/presets/mainnet.ts @@ -127,7 +127,6 @@ export const mainnetPreset: BeaconPreset = { MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8, // 2**11 * 10**9 (= 2,048,000,000,000) Gwei MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000, - // 2**16 (= 65536) MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096, MIN_ACTIVATION_BALANCE: 32000000000, PENDING_BALANCE_DEPOSITS_LIMIT: 134217728, diff --git a/packages/params/src/presets/minimal.ts b/packages/params/src/presets/minimal.ts index 97eff53cf013..5dc8fc10d803 100644 --- a/packages/params/src/presets/minimal.ts +++ b/packages/params/src/presets/minimal.ts @@ -128,7 +128,6 @@ export const minimalPreset: BeaconPreset = { MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 1, // 2**11 * 10**9 (= 2,048,000,000,000) Gwei MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000, - // 2**16 (= 65536) MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096, MIN_ACTIVATION_BALANCE: 32000000000, PENDING_BALANCE_DEPOSITS_LIMIT: 134217728,