diff --git a/src/app/fdctl/run/tiles/fd_sign.c b/src/app/fdctl/run/tiles/fd_sign.c index 4acfa5ff46..1d14b2d9d7 100644 --- a/src/app/fdctl/run/tiles/fd_sign.c +++ b/src/app/fdctl/run/tiles/fd_sign.c @@ -28,6 +28,8 @@ typedef struct { ulong public_key_base58_sz; uchar concat[ FD_BASE58_ENCODED_32_SZ+1UL+9UL ]; + uchar event_concat[ 18UL+32UL ]; + int in_role[ MAX_IN ]; uchar * in_data[ MAX_IN ]; ushort in_mtu [ MAX_IN ]; @@ -135,6 +137,11 @@ after_frag_sensitive( void * _ctx, fd_ed25519_sign( ctx->out[ in_idx ].data, ctx->concat, ctx->public_key_base58_sz+1UL+9UL, ctx->public_key, ctx->private_key, ctx->sha512 ); break; } + case FD_KEYGUARD_SIGN_TYPE_FD_METRICS_REPORT_CONCAT_ED25519: { + memcpy( ctx->event_concat+18UL, ctx->_data, 32UL ); + fd_ed25519_sign( ctx->out[ in_idx ].data, ctx->event_concat, 18UL+32UL, ctx->public_key, ctx->private_key, ctx->sha512 ); + break; + } default: FD_LOG_EMERG(( "invalid sign type: %d", sign_type )); } @@ -211,6 +218,8 @@ unprivileged_init_sensitive( fd_topo_t * topo, fd_base58_encode_32( ctx->public_key, &ctx->public_key_base58_sz, (char *)ctx->concat ); ctx->concat[ ctx->public_key_base58_sz ] = '-'; + memcpy( ctx->event_concat, "FD_METRICS_REPORT-", 18UL ); + for( ulong i=0; iin_role[ i ] = -1; for( ulong i=0; iin_cnt; i++ ) { @@ -250,6 +259,11 @@ unprivileged_init_sensitive( fd_topo_t * topo, FD_TEST( !strcmp( out_link->name, "sign_bundle" ) ); FD_TEST( in_link->mtu==9UL ); FD_TEST( out_link->mtu==64UL ); + } else if( !strcmp(in_link->name, "event_sign" ) ) { + ctx->in_role[ i ] = FD_KEYGUARD_ROLE_EVENT; + FD_TEST( !strcmp( out_link->name, "sign_event" ) ); + FD_TEST( in_link->mtu==32UL ); + FD_TEST( out_link->mtu==64UL ); } else { FD_LOG_CRIT(( "unexpected link %s", in_link->name )); } diff --git a/src/disco/keyguard/fd_keyguard.h b/src/disco/keyguard/fd_keyguard.h index 85e4253605..cdb53be768 100644 --- a/src/disco/keyguard/fd_keyguard.h +++ b/src/disco/keyguard/fd_keyguard.h @@ -21,7 +21,8 @@ FD_PROTOTYPES_BEGIN #define FD_KEYGUARD_ROLE_LEADER (2) /* block producer (shreds) */ #define FD_KEYGUARD_ROLE_REPAIR (4) /* Repair tile */ #define FD_KEYGUARD_ROLE_BUNDLE (5) /* Bundle tile */ -#define FD_KEYGUARD_ROLE_CNT (6) /* number of known roles */ +#define FD_KEYGUARD_ROLE_EVENT (6) /* Event tile */ +#define FD_KEYGUARD_ROLE_CNT (7) /* number of known roles */ /* Payload types ******************************************************/ @@ -33,6 +34,7 @@ FD_PROTOTYPES_BEGIN #define FD_KEYGUARD_PAYLOAD_LG_REPAIR (6) /* RepairProtocol */ #define FD_KEYGUARD_PAYLOAD_LG_PING (7) /* Gossip/Repair ping protocol */ #define FD_KEYGUARD_PAYLOAD_LG_BUNDLE (8) /* Bundle block producer authentication */ +#define FD_KEYGUARD_PAYLOAD_LG_EVENT (9) /* Event reporter authentication */ #define FD_KEYGUARD_PAYLOAD_TXN (1UL<