Skip to content

Commit 2f00d2c

Browse files
committed
gui: fix query_rankings on full client
1 parent cdc7ef2 commit 2f00d2c

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/disco/gui/fd_gui.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,17 +1368,26 @@ fd_gui_try_insert_ranking( fd_gui_t * gui,
13681368
ulong dur = fd_gui_slot_duration( gui, slot );
13691369
if( FD_LIKELY( dur!=ULONG_MAX ) ) TRY_INSERT_SLOT( duration, slot->slot, dur );
13701370
TRY_INSERT_SLOT( tips, slot->slot, slot->tips );
1371-
TRY_INSERT_SLOT( fees, slot->slot, slot->priority_fee );
1372-
TRY_INSERT_SLOT( rewards, slot->slot, slot->tips + slot->priority_fee );
1373-
TRY_INSERT_SLOT( rewards_per_cu, slot->slot, slot->compute_units==0UL ? 0UL : (slot->tips + slot->priority_fee) / slot->compute_units );
1371+
TRY_INSERT_SLOT( fees, slot->slot, slot->priority_fee + slot->transaction_fee );
1372+
TRY_INSERT_SLOT( rewards, slot->slot, slot->tips + slot->priority_fee + slot->transaction_fee );
1373+
TRY_INSERT_SLOT( rewards_per_cu, slot->slot, slot->compute_units==0UL ? 0UL : (slot->tips + slot->priority_fee + slot->transaction_fee) / slot->compute_units );
13741374
TRY_INSERT_SLOT( compute_units, slot->slot, slot->compute_units );
13751375
#undef TRY_INSERT_SLOT
13761376
}
13771377

13781378
static void
13791379
fd_gui_update_slot_rankings( fd_gui_t * gui ) {
1380-
if( FD_UNLIKELY( gui->summary.startup_progress.startup_ledger_max_slot==ULONG_MAX ) ) return;
1381-
if( FD_UNLIKELY( gui->summary.slot_rooted==ULONG_MAX ) ) return;
1380+
ulong first_replay_slot = ULONG_MAX;
1381+
if( FD_LIKELY( gui->summary.is_full_client ) ) {
1382+
ulong slot_caught_up = gui->summary.slot_caught_up;
1383+
ulong slot_incremental = gui->summary.boot_progress.loading_snapshot[ FD_GUI_BOOT_PROGRESS_INCREMENTAL_SNAPSHOT_IDX ].slot;
1384+
ulong slot_full = gui->summary.boot_progress.loading_snapshot[ FD_GUI_BOOT_PROGRESS_FULL_SNAPSHOT_IDX ].slot;
1385+
first_replay_slot = fd_ulong_if( slot_caught_up!=ULONG_MAX, fd_ulong_if( slot_incremental!=ULONG_MAX, slot_incremental+1UL, fd_ulong_if( slot_full!=ULONG_MAX, slot_full+1UL, ULONG_MAX ) ), ULONG_MAX );
1386+
} else {
1387+
first_replay_slot = gui->summary.startup_progress.startup_ledger_max_slot;
1388+
}
1389+
if( FD_UNLIKELY( first_replay_slot==ULONG_MAX ) ) return;
1390+
if( FD_UNLIKELY( gui->summary.slot_rooted ==ULONG_MAX ) ) return;
13821391

13831392
ulong epoch_start_slot = ULONG_MAX;
13841393
ulong epoch = ULONG_MAX;
@@ -1396,8 +1405,8 @@ fd_gui_update_slot_rankings( fd_gui_t * gui ) {
13961405
/* No new slots since the last update */
13971406
if( FD_UNLIKELY( gui->epoch.epochs[ epoch_idx ].rankings_slot>gui->summary.slot_rooted ) ) return;
13981407

1399-
/* Slots before startup_ledger_max_slot are unavailable. */
1400-
gui->epoch.epochs[ epoch_idx ].rankings_slot = fd_ulong_max( gui->epoch.epochs[ epoch_idx ].rankings_slot, gui->summary.startup_progress.startup_ledger_max_slot+1UL );
1408+
/* Slots before first_replay_slot are unavailable. */
1409+
gui->epoch.epochs[ epoch_idx ].rankings_slot = fd_ulong_max( gui->epoch.epochs[ epoch_idx ].rankings_slot, first_replay_slot );
14011410

14021411
/* Update the rankings. Only look through slots we haven't already. */
14031412
for( ulong s = gui->summary.slot_rooted; s>=gui->epoch.epochs[ epoch_idx ].rankings_slot; s--) {

src/disco/gui/fd_gui_tile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ after_frag( fd_gui_ctx_t * ctx,
405405
slot_completed.parent_slot = fd_bank_parent_slot_get( bank );
406406
slot_completed.max_compute_units = fd_uint_if( replay->cost_tracker.block_cost_limit==0UL, UINT_MAX, (uint)replay->cost_tracker.block_cost_limit );
407407
slot_completed.transaction_fee = fd_bank_execution_fees_get( bank );
408+
slot_completed.transaction_fee = slot_completed.transaction_fee - (slot_completed.transaction_fee>>1); /* burn */
408409
slot_completed.priority_fee = fd_bank_priority_fees_get( bank );
409410
slot_completed.tips = fd_bank_tips_get( bank );
410411
slot_completed.compute_units = fd_uint_if( replay->cost_tracker.block_cost==0UL, UINT_MAX, (uint)replay->cost_tracker.block_cost );

0 commit comments

Comments
 (0)