From 3f0d39b401292c695c3f887b6e6cc1dc38dcd673 Mon Sep 17 00:00:00 2001 From: pablomendezroyo Date: Wed, 30 Oct 2024 17:10:19 +0100 Subject: [PATCH] use dnp name instead --- packages/migrations/src/removeBannedRelays.ts | 20 +++++++------------ packages/stakers/src/mevBoost.ts | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/packages/migrations/src/removeBannedRelays.ts b/packages/migrations/src/removeBannedRelays.ts index 47d780a92..37d061c9f 100644 --- a/packages/migrations/src/removeBannedRelays.ts +++ b/packages/migrations/src/removeBannedRelays.ts @@ -10,18 +10,12 @@ export async function removeBannedRelays(mevBoost: MevBoost): Promise { const bannedRelays = [ "https://0xb3ee7afcf27f1f1259ac1787876318c6584ee353097a50ed84f51a1f21a323b3736f271a895c7ce918c038e4265918be@relay.edennetwork.io" ]; - for (const network of Object.values(Network)) { - logs.info(`Removing banned relays from mevboost package for network ${network}`); - const mevBoostDnpName = MevBoost.CompatibleMevBoost[network]?.dnpName; - if (mevBoostDnpName) { - logs.info(`Checking banned relays for mevboost package ${mevBoostDnpName}`); - const relays = await mevBoost.getMevBoostCurrentRelays(mevBoostDnpName); - logs.info(`Current relays: ${relays}`); - const newRelays = relays.filter((relay) => !bannedRelays.includes(relay)); - if (newRelays.length !== relays.length) { - logs.info(`Removing banned relays: ${bannedRelays.filter((relay) => !newRelays.includes(relay))}`); - await mevBoost.setNewMevBoost(network, mevBoostDnpName, newRelays); - } - } + const mevBoostDnpName = "mevboost.dnp.dappnode.eth"; + + const relays = await mevBoost.getMevBoostCurrentRelays(mevBoostDnpName); + const newRelays = relays.filter((relay) => !bannedRelays.includes(relay)); + if (newRelays.length !== relays.length) { + logs.info(`Removing banned relays: ${bannedRelays.filter((relay) => !newRelays.includes(relay))}`); + await mevBoost.setNewMevBoost(Network.Mainnet, mevBoostDnpName, newRelays); } } diff --git a/packages/stakers/src/mevBoost.ts b/packages/stakers/src/mevBoost.ts index 935bcee48..9d57c65c1 100644 --- a/packages/stakers/src/mevBoost.ts +++ b/packages/stakers/src/mevBoost.ts @@ -15,7 +15,7 @@ export class MevBoost extends StakerComponent { [Network.Lukso]: db.mevBoostLukso }; - static readonly CompatibleMevBoost: Record = { + protected static readonly CompatibleMevBoost: Record = { [Network.Mainnet]: { dnpName: MevBoostMainnet.Mevboost, minVersion: "0.1.0"