From cd51df06bcaf0a887d856e5d64594f98a9ad2a8a Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Sat, 23 Sep 2023 12:33:33 +0200 Subject: [PATCH] feat: add logs for builder validator registrations --- packages/beacon-node/src/api/impl/validator/index.ts | 7 ++++++- packages/beacon-node/src/execution/builder/http.ts | 5 ++++- packages/validator/src/services/prepareBeaconProposer.ts | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/beacon-node/src/api/impl/validator/index.ts b/packages/beacon-node/src/api/impl/validator/index.ts index 2a29c4426eeb..f50bd5e718e5 100644 --- a/packages/beacon-node/src/api/impl/validator/index.ts +++ b/packages/beacon-node/src/api/impl/validator/index.ts @@ -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, + }); + } }, }; } diff --git a/packages/beacon-node/src/execution/builder/http.ts b/packages/beacon-node/src/execution/builder/http.ts index 39ad6062edfe..3070a02dafb8 100644 --- a/packages/beacon-node/src/execution/builder/http.ts +++ b/packages/beacon-node/src/execution/builder/http.ts @@ -84,7 +84,10 @@ export class ExecutionBuilderHttp implements IExecutionBuilder { } async registerValidator(registrations: bellatrix.SignedValidatorRegistrationV1[]): Promise { - ApiError.assert(await this.api.registerValidator(registrations)); + ApiError.assert( + await this.api.registerValidator(registrations), + "Failed to submit validator registrations to builder" + ); } async getHeader( diff --git a/packages/validator/src/services/prepareBeaconProposer.ts b/packages/validator/src/services/prepareBeaconProposer.ts index 65c34e478efd..d8fec0feac01 100644 --- a/packages/validator/src/services/prepareBeaconProposer.ts +++ b/packages/validator/src/services/prepareBeaconProposer.ts @@ -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); } } }