Skip to content

Commit

Permalink
feat: add logs for builder validator registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Sep 23, 2023
1 parent 9618dd1 commit cd51df0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,12 @@ export function getValidatorApi({
);
});

return chain.executionBuilder?.registerValidator(filteredRegistrations);
if (chain.executionBuilder) {
await chain.executionBuilder.registerValidator(filteredRegistrations);
logger.debug("Submitted validator registrations to builder", {
count: filteredRegistrations.length,
});
}
},
};
}
5 changes: 4 additions & 1 deletion packages/beacon-node/src/execution/builder/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export class ExecutionBuilderHttp implements IExecutionBuilder {
}

async registerValidator(registrations: bellatrix.SignedValidatorRegistrationV1[]): Promise<void> {
ApiError.assert(await this.api.registerValidator(registrations));
ApiError.assert(
await this.api.registerValidator(registrations),
"Failed to submit validator registrations to builder"
);
}

async getHeader(
Expand Down
3 changes: 2 additions & 1 deletion packages/validator/src/services/prepareBeaconProposer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ export function pollBuilderValidatorRegistration(
})
);
ApiError.assert(await api.validator.registerValidator(registrations));
logger.info("Published validator registrations to builder", {epoch, count: registrations.length});
} catch (e) {
logger.error("Failed to register validator registrations with builder", {epoch}, e as Error);
logger.error("Failed to publish validator registrations to builder", {epoch}, e as Error);
}
}
}
Expand Down

0 comments on commit cd51df0

Please sign in to comment.