Skip to content

Commit a762b27

Browse files
committed
bank: add tmp state timestamps for bundles
1 parent 59b85bb commit a762b27

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/discof/bank/fd_bank_tile.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ handle_bundle( fd_bank_ctx_t * ctx,
360360

361361
int execution_success = 1;
362362

363+
/* TODO: this is a temporary hack to get bundles split out in the gui
364+
while timestamps are properly plumbed through. */
365+
long out_timestamp[ FD_PACK_MAX_TXN_PER_BUNDLE ] = { 0 };
366+
363367
/* Every transaction in the bundle should be executed in order against
364368
different transaciton contexts. */
365369
for( ulong i=0UL; i<txn_cnt; i++ ) {
@@ -378,6 +382,7 @@ handle_bundle( fd_bank_ctx_t * ctx,
378382
fd_bank_t * bank = fd_banks_bank_query( ctx->banks, ctx->_bank_idx );
379383
FD_TEST( bank );
380384
txn_ctx->bundle.is_bundle = 1;
385+
out_timestamp[ i ] = fd_tickcount();
381386
txn_ctx->err.exec_err = fd_runtime_prepare_and_execute_txn( bank, txn_ctx, txn, NULL, &ctx->exec_stack, &ctx->exec_accounts[ i ], NULL, NULL );
382387
txn->flags = (txn->flags & 0x00FFFFFFU) | ((uint)(-txn_ctx->err.exec_err)<<24);
383388
if( FD_UNLIKELY( !txn_ctx->err.is_committable || txn_ctx->err.exec_err!=FD_RUNTIME_EXECUTE_SUCCESS ) ) {
@@ -465,10 +470,10 @@ handle_bundle( fd_bank_ctx_t * ctx,
465470
long microblock_start_ticks = fd_frag_meta_ts_decomp( begin_tspub, tickcount );
466471
long microblock_duration_ticks = fd_long_max(tickcount - microblock_start_ticks, 0L);
467472

468-
long tx_start_ticks = microblock_start_ticks; // (long)out_timestamps[ 4*i + 0 ];
469-
long tx_load_end_ticks = microblock_start_ticks; // (long)out_timestamps[ 4*i + 1 ];
470-
long tx_end_ticks = microblock_start_ticks; // (long)out_timestamps[ 4*i + 2 ];
471-
long tx_preload_end_ticks = microblock_start_ticks; // (long)out_timestamps[ 4*i + 3 ];
473+
long tx_start_ticks = out_timestamp[ i ]; // (long)out_timestamps[ 4*i + 0 ];
474+
long tx_load_end_ticks = out_timestamp[ i ]; // (long)out_timestamps[ 4*i + 1 ];
475+
long tx_end_ticks = out_timestamp[ i ]; // (long)out_timestamps[ 4*i + 2 ];
476+
long tx_preload_end_ticks = out_timestamp[ i ]; // (long)out_timestamps[ 4*i + 3 ];
472477

473478
trailer->txn_start_pct = (uchar)(((double)(tx_start_ticks - microblock_start_ticks) * (double)UCHAR_MAX) / (double)microblock_duration_ticks);
474479
trailer->txn_load_end_pct = (uchar)(((double)(tx_load_end_ticks - microblock_start_ticks) * (double)UCHAR_MAX) / (double)microblock_duration_ticks);

0 commit comments

Comments
 (0)