Skip to content

Commit 54bd073

Browse files
jherrera-jumpmmcgee-jump
authored andcommitted
gui: fix CU pct for replayed slots
1 parent 11a7ced commit 54bd073

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

agave

src/disco/gui/fd_gui.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ fd_gui_clear_slot( fd_gui_t * gui,
987987

988988
slot->slot = _slot;
989989
slot->parent_slot = _parent_slot;
990+
slot->max_compute_units = UINT_MAX;
990991
slot->mine = mine;
991992
slot->skipped = 0;
992993
slot->must_republish = 1;
@@ -1004,7 +1005,6 @@ fd_gui_clear_slot( fd_gui_t * gui,
10041005

10051006
slot->txs.leader_start_time = LONG_MAX;
10061007
slot->txs.leader_end_time = LONG_MAX;
1007-
slot->txs.max_compute_units = UINT_MAX;
10081008
slot->txs.microblocks_upper_bound = USHORT_MAX;
10091009
slot->txs.begin_microblocks = 0U;
10101010
slot->txs.end_microblocks = 0U;
@@ -1300,12 +1300,14 @@ fd_gui_handle_completed_slot( fd_gui_t * gui,
13001300
ulong priority_fee = msg[ 7 ];
13011301
ulong tips = msg[ 8 ];
13021302
ulong _parent_slot = msg[ 9 ];
1303+
ulong max_compute_units = msg[ 10 ];
13031304

13041305
fd_gui_slot_t * slot = gui->slots[ _slot % FD_GUI_SLOTS_CNT ];
13051306
if( FD_UNLIKELY( slot->slot!=_slot ) ) fd_gui_clear_slot( gui, _slot, _parent_slot );
13061307

13071308
slot->completed_time = fd_log_wallclock();
13081309
slot->parent_slot = _parent_slot;
1310+
slot->max_compute_units = (uint)max_compute_units;
13091311
if( FD_LIKELY( slot->level<FD_GUI_SLOT_LEVEL_COMPLETED ) ) {
13101312
/* Typically a slot goes from INCOMPLETE to COMPLETED but it can
13111313
happen that it starts higher. One such case is when we
@@ -1675,10 +1677,10 @@ fd_gui_became_leader( fd_gui_t * gui,
16751677
ulong max_microblocks ) {
16761678
fd_gui_init_slot_txns( gui, tickcount, _slot );
16771679
fd_gui_slot_t * slot = gui->slots[ _slot % FD_GUI_SLOTS_CNT ];
1680+
slot->max_compute_units = (uint)max_compute_units;
16781681

16791682
slot->txs.leader_start_time = start_time_nanos;
16801683
slot->txs.leader_end_time = end_time_nanos;
1681-
slot->txs.max_compute_units = (uint)max_compute_units;
16821684
if( FD_LIKELY( slot->txs.microblocks_upper_bound==USHORT_MAX ) ) slot->txs.microblocks_upper_bound = (ushort)max_microblocks;
16831685
}
16841686

src/disco/gui/fd_gui.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ typedef struct fd_gui_tile_stats fd_gui_tile_stats_t;
181181
struct fd_gui_slot {
182182
ulong slot;
183183
ulong parent_slot;
184+
uint max_compute_units;
184185
long completed_time;
185186
int mine;
186187
int skipped;
@@ -217,9 +218,6 @@ struct fd_gui_slot {
217218
slot is only considered over if the begin and end microblocks seen are both equal
218219
to the microblock upper bound. */
219220

220-
uint max_compute_units; /* The maximum number of compute units allowed in the slot. Currently fixed at 48M
221-
but will increase dynamically in future according to some feature gates. */
222-
223221
ulong start_offset; /* The smallest pack transaction index for this slot. The first transaction for this slot will
224222
be written to gui->txs[ start_offset%FD_GUI_TXN_HISTORY_SZ ]. */
225223
ulong end_offset; /* The largest pack transaction index for this slot, plus 1. The last transaction for this

src/disco/gui/fd_gui_printf.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,8 +1053,8 @@ fd_gui_printf_slot( fd_gui_t * gui,
10531053
else jsonp_ulong( gui, "vote_transactions", slot->vote_txn_cnt );
10541054
if( FD_UNLIKELY( slot->failed_txn_cnt==UINT_MAX ) ) jsonp_null( gui, "failed_transactions" );
10551055
else jsonp_ulong( gui, "failed_transactions", slot->failed_txn_cnt );
1056-
if( FD_UNLIKELY( slot->txs.max_compute_units==UINT_MAX ) ) jsonp_null( gui, "max_compute_units" );
1057-
else jsonp_ulong( gui, "max_compute_units", slot->txs.max_compute_units );
1056+
if( FD_UNLIKELY( slot->max_compute_units==UINT_MAX ) ) jsonp_null( gui, "max_compute_units" );
1057+
else jsonp_ulong( gui, "max_compute_units", slot->max_compute_units );
10581058
if( FD_UNLIKELY( slot->compute_units==UINT_MAX ) ) jsonp_null( gui, "compute_units" );
10591059
else jsonp_ulong( gui, "compute_units", slot->compute_units );
10601060
if( FD_UNLIKELY( slot->transaction_fee==ULONG_MAX ) ) jsonp_null( gui, "transaction_fee" );
@@ -1120,8 +1120,8 @@ fd_gui_printf_slot_request( fd_gui_t * gui,
11201120
else jsonp_ulong( gui, "vote_transactions", slot->vote_txn_cnt );
11211121
if( FD_UNLIKELY( slot->failed_txn_cnt==UINT_MAX ) ) jsonp_null( gui, "failed_transactions" );
11221122
else jsonp_ulong( gui, "failed_transactions", slot->failed_txn_cnt );
1123-
if( FD_UNLIKELY( slot->txs.max_compute_units==UINT_MAX ) ) jsonp_null( gui, "max_compute_units" );
1124-
else jsonp_ulong( gui, "max_compute_units", slot->txs.max_compute_units );
1123+
if( FD_UNLIKELY( slot->max_compute_units==UINT_MAX ) ) jsonp_null( gui, "max_compute_units" );
1124+
else jsonp_ulong( gui, "max_compute_units", slot->max_compute_units );
11251125
if( FD_UNLIKELY( slot->compute_units==UINT_MAX ) ) jsonp_null( gui, "compute_units" );
11261126
else jsonp_ulong( gui, "compute_units", slot->compute_units );
11271127
if( FD_UNLIKELY( slot->transaction_fee==ULONG_MAX ) ) jsonp_null( gui, "transaction_fee" );
@@ -1179,8 +1179,8 @@ fd_gui_printf_slot_transactions_request( fd_gui_t * gui,
11791179
else jsonp_ulong( gui, "vote_transactions", slot->vote_txn_cnt );
11801180
if( FD_UNLIKELY( slot->failed_txn_cnt==UINT_MAX ) ) jsonp_null( gui, "failed_transactions" );
11811181
else jsonp_ulong( gui, "failed_transactions", slot->failed_txn_cnt );
1182-
if( FD_UNLIKELY( slot->txs.max_compute_units==UINT_MAX ) ) jsonp_null( gui, "max_compute_units" );
1183-
else jsonp_ulong( gui, "max_compute_units", slot->txs.max_compute_units );
1182+
if( FD_UNLIKELY( slot->max_compute_units==UINT_MAX ) ) jsonp_null( gui, "max_compute_units" );
1183+
else jsonp_ulong( gui, "max_compute_units", slot->max_compute_units );
11841184
if( FD_UNLIKELY( slot->compute_units==UINT_MAX ) ) jsonp_null( gui, "compute_units" );
11851185
else jsonp_ulong( gui, "compute_units", slot->compute_units );
11861186
if( FD_UNLIKELY( slot->transaction_fee==ULONG_MAX ) ) jsonp_null( gui, "transaction_fee" );
@@ -1322,8 +1322,8 @@ fd_gui_printf_slot_request_detailed( fd_gui_t * gui,
13221322
else jsonp_ulong( gui, "vote_transactions", slot->vote_txn_cnt );
13231323
if( FD_UNLIKELY( slot->failed_txn_cnt==UINT_MAX ) ) jsonp_null( gui, "failed_transactions" );
13241324
else jsonp_ulong( gui, "failed_transactions", slot->failed_txn_cnt );
1325-
if( FD_UNLIKELY( slot->txs.max_compute_units==UINT_MAX ) ) jsonp_null( gui, "max_compute_units" );
1326-
else jsonp_ulong( gui, "max_compute_units", slot->txs.max_compute_units );
1325+
if( FD_UNLIKELY( slot->max_compute_units==UINT_MAX ) ) jsonp_null( gui, "max_compute_units" );
1326+
else jsonp_ulong( gui, "max_compute_units", slot->max_compute_units );
13271327
if( FD_UNLIKELY( slot->compute_units==UINT_MAX ) ) jsonp_null( gui, "compute_units" );
13281328
else jsonp_ulong( gui, "compute_units", slot->compute_units );
13291329
if( FD_UNLIKELY( slot->transaction_fee==ULONG_MAX ) ) jsonp_null( gui, "transaction_fee" );

src/discof/replay/fd_replay_tile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ publish_slot_notifications( fd_replay_tile_ctx_t * ctx,
13051305
.parent_slot = ctx->parent_slot,
13061306
};
13071307
*/
1308-
ulong msg[10];
1308+
ulong msg[11];
13091309
msg[ 0 ] = ctx->curr_slot;
13101310
msg[ 1 ] = fork->slot_ctx->txn_count;
13111311
msg[ 2 ] = fork->slot_ctx->nonvote_txn_count;
@@ -1316,6 +1316,7 @@ publish_slot_notifications( fd_replay_tile_ctx_t * ctx,
13161316
msg[ 7 ] = fork->slot_ctx->slot_bank.collected_priority_fees;
13171317
msg[ 8 ] = 0UL; /* todo ... track tips */
13181318
msg[ 9 ] = ctx->parent_slot;
1319+
msg[ 10 ] = 0UL; /* todo ... max compute units */
13191320
replay_plugin_publish( ctx, stem, FD_PLUGIN_MSG_SLOT_COMPLETED, (uchar const *)msg, sizeof(msg) );
13201321
}
13211322
}

0 commit comments

Comments
 (0)