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

fix(forks): update sync b/w ghost and blockstore #3898

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion src/app/fdctl/run/tiles/fd_replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ during_housekeeping( void * _ctx ) {
ulong wmk = fd_ulong_min( ctx->tower->root , ctx->blockstore->smr );
fd_blockstore_end_read( ctx->blockstore );

if ( FD_LIKELY( wmk <= fd_fseq_query( ctx->wmk ) ) ) return;
if( FD_LIKELY( wmk <= fd_fseq_query( ctx->wmk ) ) ) return;
FD_LOG_NOTICE(( "wmk %lu => %lu", fd_fseq_query( ctx->wmk ), wmk ));

fd_blockstore_start_read( ctx->blockstore );
Expand Down
15 changes: 11 additions & 4 deletions src/choreo/forks/fd_forks.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,16 @@ fd_forks_update( fd_forks_t * forks,

ulong root = fd_voter_state_root( state );

/* Check if this voter's root >= ghost root. We can't process
other voters' roots that precede the ghost root. */
/* Only process if voter's root > blockstore->smr because if the
root <= blockstore->smr it is by definition already finalized
(finalizing a slot also finalizes its entire ancestry).

if( FD_UNLIKELY( root >= fd_ghost_root( ghost )->slot ) ) {
Also it is possible the ghost root is lagging the supermajority
root because our tower has fallen behind the rest of the cluster.
So this prevents any issues with differences in slot retention
between ghost and blockstore. */

if( FD_UNLIKELY( root > fd_ghost_root( ghost )->slot && root > blockstore->smr ) ) {
fd_ghost_node_t const * node = fd_ghost_query( ghost, root );
if( FD_UNLIKELY( !node ) ) {

Expand All @@ -404,7 +410,8 @@ fd_forks_update( fd_forks_t * forks,

fd_ghost_rooted_vote( ghost, voter, root );

/* Check if it has crossed finalized threshold. */
/* Check if it has crossed the supermajority threshold (and can be
marked finalized in the blockstore). */

fd_blockstore_start_write( blockstore );
fd_block_map_t * block_map_entry = fd_blockstore_block_map_query( blockstore, root );
Expand Down
Loading