Skip to content

Commit

Permalink
Merge pull request #217 from dappnode/pablo/do-not-remove-validator-a…
Browse files Browse the repository at this point in the history
…fter-exit

Do not remove validators on exit
  • Loading branch information
pablomendezroyo authored Apr 14, 2023
2 parents b5c2abe + 6b953a1 commit de8e882
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions packages/brain/src/calls/exitValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ValidatorExitExecute,
ValidatorExitGet,
} from "@stakingbrain/common";
import { beaconchainApi, validatorApi, signerApi, brainDb } from "../index.js";
import { beaconchainApi, signerApi } from "../index.js";
import logger from "../modules/logger/index.js";

/**
Expand Down Expand Up @@ -62,24 +62,6 @@ export async function exitValidators({
}
}

const exitedValidatorsPubkeys = exitValidatorsResponses
.filter((validator) => validator.status.exited === true)
.map((validator) => validator.pubkey);

// Delete the validator from the validator API
await validatorApi
.deleteRemoteKeys({ pubkeys: exitedValidatorsPubkeys })
.then(() => logger.debug(`Deleted pubkeys in validator API`))
.catch((err) => logger.error(`Error deleting validator pubkeys`, err));

// Delete the validator from the web3signer API
await signerApi
.deleteKeystores({ pubkeys: exitedValidatorsPubkeys })
.then(() => logger.debug(`Deleted pubkeys in web3signer API`));

// Delete the validator from the brain db
brainDb.deleteValidators(exitedValidatorsPubkeys);

return exitValidatorsResponses;
}

Expand Down

0 comments on commit de8e882

Please sign in to comment.