Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: set-identity should change shred signing key #4224

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/app/fdctl/run/tiles/fd_shred.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,14 @@ during_housekeeping( fd_shred_ctx_t * ctx ) {
if( FD_UNLIKELY( fd_keyswitch_state_query( ctx->keyswitch )==FD_KEYSWITCH_STATE_SWITCH_PENDING ) ) {
ulong seq_must_complete = ctx->keyswitch->param;

if( FD_UNLIKELY( fd_seq_le( seq_must_complete, ctx->poh_in_expect_seq ) ) ) {
if( FD_UNLIKELY( fd_seq_lt( ctx->poh_in_expect_seq, seq_must_complete ) ) ) {
/* See fd_keyswitch.h, we need to flush any in-flight shreds from
the leader pipeline before switching key. */
FD_LOG_WARNING(( "Flushing in-flight unpublished shreds, must reach seq %lu, currently at %lu ...", seq_must_complete, ctx->poh_in_expect_seq ));
return;
}

fd_memcpy( ctx->identity_key->uc, ctx->keyswitch->bytes, 32UL );
fd_stake_ci_set_identity( ctx->stake_ci, ctx->identity_key );
fd_keyswitch_state( ctx->keyswitch, FD_KEYSWITCH_STATE_COMPLETED );
}
Expand Down
5 changes: 3 additions & 2 deletions src/app/fdctl/set_identity.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ poll_keyswitch( fd_topo_t * topo,
FD_COMPILER_MFENCE();
shred->state = FD_KEYSWITCH_STATE_SWITCH_PENDING;
FD_COMPILER_MFENCE();
FD_LOG_INFO(( "Flushing in-flight unpublished shreds..." ));
FD_LOG_INFO(( "Flushing in-flight unpublished shreds, must reach seq %lu...", *halted_seq ));
}

*state = FD_SET_IDENTITY_STATE_SHRED_FLUSH_REQUESTED;
Expand All @@ -215,8 +215,9 @@ poll_keyswitch( fd_topo_t * topo,
if( FD_LIKELY( shred->state==FD_KEYSWITCH_STATE_COMPLETED ) ) {
continue;
} else if( FD_UNLIKELY( shred->state==FD_KEYSWITCH_STATE_SWITCH_PENDING ) ) {
/* If any of the shred tiles is still pending, we need to wait. */
FD_SPIN_PAUSE();
break;
return;
} else {
FD_LOG_ERR(( "Unexpected shred:%lu keyswitch state %lu", tile->kind_id, shred->state ));
}
Expand Down
Loading