Skip to content

Commit

Permalink
use dnp name instead
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Oct 30, 2024
1 parent 1c6ab68 commit 3f0d39b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
20 changes: 7 additions & 13 deletions packages/migrations/src/removeBannedRelays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ export async function removeBannedRelays(mevBoost: MevBoost): Promise<void> {
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);
}
}
2 changes: 1 addition & 1 deletion packages/stakers/src/mevBoost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class MevBoost extends StakerComponent {
[Network.Lukso]: db.mevBoostLukso
};

static readonly CompatibleMevBoost: Record<Network, { dnpName: string; minVersion: string } | null> = {
protected static readonly CompatibleMevBoost: Record<Network, { dnpName: string; minVersion: string } | null> = {
[Network.Mainnet]: {
dnpName: MevBoostMainnet.Mevboost,
minVersion: "0.1.0"
Expand Down

0 comments on commit 3f0d39b

Please sign in to comment.