Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Oct 30, 2024
1 parent ef4f606 commit 1c6ab68
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/migrations/src/removeBannedRelays.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { logs } from "@dappnode/logger";
import { MevBoost } from "@dappnode/stakers";
import { Network } from "@dappnode/types";

Expand All @@ -10,11 +11,15 @@ export async function removeBannedRelays(mevBoost: MevBoost): Promise<void> {
"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);
}
}
Expand Down

0 comments on commit 1c6ab68

Please sign in to comment.