Skip to content

Commit 8a6920f

Browse files
committed
remove unused txn map
1 parent 7c667bb commit 8a6920f

18 files changed

+32
-731
lines changed

src/app/firedancer-dev/commands/backtest.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ setup_topo_blockstore( fd_topo_t * topo,
6666
ulong shred_max,
6767
ulong block_max,
6868
ulong idx_max,
69-
ulong txn_max,
7069
ulong alloc_max ) {
7170
fd_topo_obj_t * obj = fd_topob_obj( topo, "blockstore", wksp_name );
7271

@@ -78,12 +77,11 @@ setup_topo_blockstore( fd_topo_t * topo,
7877
FD_TEST( fd_pod_insertf_ulong( topo->props, shred_max, "obj.%lu.shred_max", obj->id ) );
7978
FD_TEST( fd_pod_insertf_ulong( topo->props, block_max, "obj.%lu.block_max", obj->id ) );
8079
FD_TEST( fd_pod_insertf_ulong( topo->props, idx_max, "obj.%lu.idx_max", obj->id ) );
81-
FD_TEST( fd_pod_insertf_ulong( topo->props, txn_max, "obj.%lu.txn_max", obj->id ) );
8280
FD_TEST( fd_pod_insertf_ulong( topo->props, alloc_max, "obj.%lu.alloc_max", obj->id ) );
8381

8482
/* DO NOT MODIFY LOOSE WITHOUT CHANGING HOW BLOCKSTORE ALLOCATES INTERNAL STRUCTURES */
8583

86-
ulong blockstore_footprint = fd_blockstore_footprint( shred_max, block_max, idx_max, txn_max ) + alloc_max;
84+
ulong blockstore_footprint = fd_blockstore_footprint( shred_max, block_max, idx_max ) + alloc_max;
8785
FD_TEST( fd_pod_insertf_ulong( topo->props, blockstore_footprint, "obj.%lu.loose", obj->id ) );
8886

8987
return obj;
@@ -344,7 +342,6 @@ backtest_topo( config_t * config ) {
344342
config->firedancer.blockstore.shred_max,
345343
config->firedancer.blockstore.block_max,
346344
config->firedancer.blockstore.idx_max,
347-
config->firedancer.blockstore.txn_max,
348345
config->firedancer.blockstore.alloc_max );
349346
fd_topob_tile_uses( topo, replay_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
350347
fd_topob_tile_uses( topo, backtest_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );

src/app/firedancer-dev/commands/sim.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ setup_topo_blockstore( fd_topo_t * topo,
6666
ulong shred_max,
6767
ulong block_max,
6868
ulong idx_max,
69-
ulong txn_max,
7069
ulong alloc_max ) {
7170
fd_topo_obj_t * obj = fd_topob_obj( topo, "blockstore", wksp_name );
7271

@@ -78,12 +77,11 @@ setup_topo_blockstore( fd_topo_t * topo,
7877
FD_TEST( fd_pod_insertf_ulong( topo->props, shred_max, "obj.%lu.shred_max", obj->id ) );
7978
FD_TEST( fd_pod_insertf_ulong( topo->props, block_max, "obj.%lu.block_max", obj->id ) );
8079
FD_TEST( fd_pod_insertf_ulong( topo->props, idx_max, "obj.%lu.idx_max", obj->id ) );
81-
FD_TEST( fd_pod_insertf_ulong( topo->props, txn_max, "obj.%lu.txn_max", obj->id ) );
8280
FD_TEST( fd_pod_insertf_ulong( topo->props, alloc_max, "obj.%lu.alloc_max", obj->id ) );
8381

8482
/* DO NOT MODIFY LOOSE WITHOUT CHANGING HOW BLOCKSTORE ALLOCATES INTERNAL STRUCTURES */
8583

86-
ulong blockstore_footprint = fd_blockstore_footprint( shred_max, block_max, idx_max, txn_max ) + alloc_max;
84+
ulong blockstore_footprint = fd_blockstore_footprint( shred_max, block_max, idx_max ) + alloc_max;
8785
FD_TEST( fd_pod_insertf_ulong( topo->props, blockstore_footprint, "obj.%lu.loose", obj->id ) );
8886

8987
return obj;
@@ -260,7 +258,6 @@ sim_topo( config_t * config ) {
260258
config->firedancer.blockstore.shred_max,
261259
config->firedancer.blockstore.block_max,
262260
config->firedancer.blockstore.idx_max,
263-
config->firedancer.blockstore.txn_max,
264261
config->firedancer.blockstore.alloc_max );
265262
fd_topo_obj_t * poh_shred_obj = fd_topob_obj( topo, "fseq", "poh_shred" );
266263
fd_topo_obj_t * root_slot_obj = fd_topob_obj( topo, "fseq", "root_slot" );

src/app/firedancer/callbacks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fd_topo_obj_callbacks_t fd_obj_cb_runtime_pub = {
4040
static ulong
4141
blockstore_footprint( fd_topo_t const * topo,
4242
fd_topo_obj_t const * obj ) {
43-
return fd_blockstore_footprint( VAL("shred_max"), VAL("block_max"), VAL("idx_max"), VAL("txn_max") ) + VAL("alloc_max");
43+
return fd_blockstore_footprint( VAL("shred_max"), VAL("block_max"), VAL("idx_max") ) + VAL("alloc_max");
4444
}
4545

4646
static ulong
@@ -52,7 +52,7 @@ blockstore_align( fd_topo_t const * topo FD_FN_UNUSED,
5252
static void
5353
blockstore_new( fd_topo_t const * topo,
5454
fd_topo_obj_t const * obj ) {
55-
FD_TEST( fd_blockstore_new( fd_topo_obj_laddr( topo, obj->id ), VAL("wksp_tag"), VAL("seed"), VAL("shred_max"), VAL("block_max"), VAL("idx_max"), VAL("txn_max") ) );
55+
FD_TEST( fd_blockstore_new( fd_topo_obj_laddr( topo, obj->id ), VAL("wksp_tag"), VAL("seed"), VAL("shred_max"), VAL("block_max"), VAL("idx_max") ) );
5656
}
5757

5858
fd_topo_obj_callbacks_t fd_obj_cb_blockstore = {

src/app/firedancer/topology.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ setup_topo_blockstore( fd_topo_t * topo,
2727
ulong shred_max,
2828
ulong block_max,
2929
ulong idx_max,
30-
ulong txn_max,
3130
ulong alloc_max ) {
3231
fd_topo_obj_t * obj = fd_topob_obj( topo, "blockstore", wksp_name );
3332

@@ -39,12 +38,11 @@ setup_topo_blockstore( fd_topo_t * topo,
3938
FD_TEST( fd_pod_insertf_ulong( topo->props, shred_max, "obj.%lu.shred_max", obj->id ) );
4039
FD_TEST( fd_pod_insertf_ulong( topo->props, block_max, "obj.%lu.block_max", obj->id ) );
4140
FD_TEST( fd_pod_insertf_ulong( topo->props, idx_max, "obj.%lu.idx_max", obj->id ) );
42-
FD_TEST( fd_pod_insertf_ulong( topo->props, txn_max, "obj.%lu.txn_max", obj->id ) );
4341
FD_TEST( fd_pod_insertf_ulong( topo->props, alloc_max, "obj.%lu.alloc_max", obj->id ) );
4442

4543
/* DO NOT MODIFY LOOSE WITHOUT CHANGING HOW BLOCKSTORE ALLOCATES INTERNAL STRUCTURES */
4644

47-
ulong blockstore_footprint = fd_blockstore_footprint( shred_max, block_max, idx_max, txn_max ) + alloc_max;
45+
ulong blockstore_footprint = fd_blockstore_footprint( shred_max, block_max, idx_max ) + alloc_max;
4846
FD_TEST( fd_pod_insertf_ulong( topo->props, blockstore_footprint, "obj.%lu.loose", obj->id ) );
4947

5048
return obj;
@@ -460,7 +458,6 @@ fd_topo_initialize( config_t * config ) {
460458
config->firedancer.blockstore.shred_max,
461459
config->firedancer.blockstore.block_max,
462460
config->firedancer.blockstore.idx_max,
463-
config->firedancer.blockstore.txn_max,
464461
config->firedancer.blockstore.alloc_max );
465462
fd_topob_tile_uses( topo, store_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
466463
fd_topob_tile_uses( topo, replay_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );

src/app/ledger/main.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ runtime_replay( fd_ledger_args_t * ledger_args ) {
358358
if( !block_exists && slot_meta.slot == slot ) {
359359
int err = fd_rocksdb_import_block_blockstore( &rocks_db,
360360
&slot_meta, blockstore,
361-
ledger_args->copy_txn_status,
362361
slot == (ledger_args->trash_hash) ? trash_hash_buf : NULL,
363362
ledger_args->valloc );
364363
if( FD_UNLIKELY( err ) ) {
@@ -761,7 +760,6 @@ ingest_rocksdb( char const * file,
761760
ulong start_slot,
762761
ulong end_slot,
763762
fd_blockstore_t * blockstore,
764-
int txn_status,
765763
ulong trash_hash,
766764
fd_valloc_t valloc ) {
767765

@@ -818,7 +816,6 @@ ingest_rocksdb( char const * file,
818816
int err = fd_rocksdb_import_block_blockstore( &rocks_db,
819817
&slot_meta,
820818
blockstore,
821-
txn_status,
822819
(slot == trash_hash) ? trash_hash_buf : NULL,
823820
valloc );
824821
if( FD_UNLIKELY( err ) ) {
@@ -935,12 +932,11 @@ init_blockstore( fd_ledger_args_t * args ) {
935932
}
936933
FD_LOG_NOTICE(( "joined blockstore" ));
937934
} else {
938-
ulong txn_max = 256UL;
939-
shmem = fd_wksp_alloc_laddr( args->wksp, fd_blockstore_align(), fd_blockstore_footprint( args->shred_max, args->slot_history_max, 16, txn_max ), blockstore_tag );
935+
shmem = fd_wksp_alloc_laddr( args->wksp, fd_blockstore_align(), fd_blockstore_footprint( args->shred_max, args->slot_history_max, 16 ), blockstore_tag );
940936
if( shmem == NULL ) {
941937
FD_LOG_ERR(( "failed to allocate a blockstore" ));
942938
}
943-
args->blockstore = fd_blockstore_join( &args->blockstore_ljoin, fd_blockstore_new( shmem, 1, args->hashseed, args->shred_max, args->slot_history_max, 16, txn_max ) );
939+
args->blockstore = fd_blockstore_join( &args->blockstore_ljoin, fd_blockstore_new( shmem, 1, args->hashseed, args->shred_max, args->slot_history_max, 16 ) );
944940
if( args->blockstore->shmem->magic != FD_BLOCKSTORE_MAGIC ) {
945941
fd_wksp_free_laddr( shmem );
946942
FD_LOG_ERR(( "failed to allocate a blockstore" ));
@@ -1050,13 +1046,9 @@ minify( fd_ledger_args_t * args ) {
10501046
args->start_slot,
10511047
args->end_slot,
10521048
args->blockstore,
1053-
0,
10541049
ULONG_MAX,
10551050
args->valloc );
10561051

1057-
fd_rocksdb_copy_over_txn_status_range( &big_rocksdb, &mini_rocksdb, args->blockstore,
1058-
args->start_slot, args->end_slot );
1059-
FD_LOG_NOTICE(( "copied over all transaction statuses" ));
10601052
} else {
10611053
FD_LOG_NOTICE(( "skipping copying of transaction statuses" ));
10621054
}
@@ -1172,7 +1164,7 @@ ingest( fd_ledger_args_t * args ) {
11721164
args->end_slot = slot_ctx->slot_bank.slot + args->slot_history_max - 1;
11731165
}
11741166
ingest_rocksdb( args->rocksdb_list[ 0UL ], args->start_slot, args->end_slot,
1175-
blockstore, args->copy_txn_status, args->trash_hash, args->valloc );
1167+
blockstore, args->trash_hash, args->valloc );
11761168
}
11771169

11781170
/* Verification */

src/app/shredcap/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ main( int argc, char ** argv ) {
8181
FD_LOG_ERR(( "failed to join a blockstore" ));
8282
}
8383
} else {
84-
shmem = fd_wksp_alloc_laddr( wksp, fd_blockstore_align(), fd_blockstore_footprint( shred_max, slot_history_max, 16, shred_max ), FD_BLOCKSTORE_MAGIC );
84+
shmem = fd_wksp_alloc_laddr( wksp, fd_blockstore_align(), fd_blockstore_footprint( shred_max, slot_history_max, 16 ), FD_BLOCKSTORE_MAGIC );
8585
if ( shmem == NULL ) {
8686
FD_LOG_ERR(( "failed to allocate a blockstore" ));
8787
}
8888

89-
blockstore = fd_blockstore_join( &blockstore_ljoin, fd_blockstore_new( shmem, 1, hashseed, shred_max, slot_history_max, 16, shred_max ) );
89+
blockstore = fd_blockstore_join( &blockstore_ljoin, fd_blockstore_new( shmem, 1, hashseed, shred_max, slot_history_max, 16 ) );
9090
if ( blockstore == NULL ) {
9191
fd_wksp_free_laddr( shmem );
9292
FD_LOG_ERR(( "failed to allocate a blockstore" ));

src/discof/rpcserver/fd_block_to_json.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,6 @@ fd_txn_to_json( fd_webserver_t * ws,
672672

673673
const char*
674674
fd_block_to_json( fd_webserver_t * ws,
675-
fd_blockstore_t * blockstore,
676-
int blockstore_fd,
677675
const char * call_id,
678676
const uchar * blk_data,
679677
ulong blk_sz,
@@ -766,8 +764,6 @@ fd_block_to_json( fd_webserver_t * ws,
766764

767765
EMIT_SIMPLE("\"transactions\":[");
768766

769-
fd_wksp_t * blockstore_wksp = fd_blockstore_wksp( blockstore );
770-
771767
int first_txn = 1;
772768
ulong blockoff = 0;
773769
while (blockoff < blk_sz) {
@@ -801,6 +797,7 @@ fd_block_to_json( fd_webserver_t * ws,
801797
} else
802798
EMIT_SIMPLE(",{");
803799

800+
/* FIXME
804801
uchar const * sig_p = raw + ((fd_txn_t *)txn_out)->signature_off;
805802
fd_txn_map_t elem;
806803
uchar flags;
@@ -809,6 +806,7 @@ fd_block_to_json( fd_webserver_t * ws,
809806
const char * err = fd_txn_meta_to_json( ws, meta, elem.meta_sz );
810807
if ( err ) return err;
811808
}
809+
*/
812810

813811
const char * err = fd_txn_to_json( ws, (fd_txn_t *)txn_out, raw, pay_sz, encoding, maxvers, detail, spad );
814812
if ( err ) return err;

src/discof/rpcserver/fd_block_to_json.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ const char* fd_txn_to_json( fd_webserver_t * ws,
2929
fd_spad_t * spad );
3030

3131
const char* fd_block_to_json( fd_webserver_t * ws,
32-
fd_blockstore_t * blockstore,
33-
int blockstore_fd,
3432
const char * call_id,
3533
const uchar * blk_data,
3634
ulong blk_sz,

src/discof/rpcserver/fd_rpc_service.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,15 @@ read_slot_bank( fd_rpc_ctx_t * ctx, ulong slot ) {
245245
return slot_bank;
246246
}
247247

248+
/*
248249
static const char *
249250
block_flags_to_confirmation_status( uchar flags ) {
250251
if( flags & (1U << FD_BLOCK_FLAG_FINALIZED) ) return "\"finalized\"";
251252
if( flags & (1U << FD_BLOCK_FLAG_CONFIRMED) ) return "\"confirmed\"";
252253
if( flags & (1U << FD_BLOCK_FLAG_PROCESSED) ) return "\"processed\"";
253254
return "null";
254255
}
256+
*/
255257

256258
// Implementation of the "getAccountInfo" method
257259
// curl http://localhost:8123 -X POST -H "Content-Type: application/json" -d '{ "jsonrpc": "2.0", "id": 1, "method": "getAccountInfo", "params": [ "21bVZhkqPJRVYDG3YpYtzHLMvkc7sa4KB7fMwGekTquG", { "encoding": "base64" } ] }'
@@ -484,8 +486,6 @@ method_getBlock(struct json_values* values, fd_rpc_ctx_t * ctx) {
484486
}
485487

486488
const char * err = fd_block_to_json(ws,
487-
blockstore,
488-
ctx->global->blockstore_fd,
489489
ctx->call_id,
490490
blk_data,
491491
blk_sz,
@@ -1305,7 +1305,6 @@ method_getSignaturesForAddress(struct json_values* values, fd_rpc_ctx_t * ctx) {
13051305
static int
13061306
method_getSignatureStatuses(struct json_values* values, fd_rpc_ctx_t * ctx) {
13071307
fd_webserver_t * ws = &ctx->global->ws;
1308-
fd_blockstore_t * blockstore = ctx->global->blockstore;
13091308
fd_web_reply_sprintf(ws, "{\"jsonrpc\":\"2.0\",\"result\":{\"context\":{\"apiVersion\":\"" FIREDANCER_VERSION "\",\"slot\":%lu},\"value\":[",
13101309
ctx->global->last_slot);
13111310

@@ -1331,6 +1330,7 @@ method_getSignatureStatuses(struct json_values* values, fd_rpc_ctx_t * ctx) {
13311330
fd_web_reply_sprintf(ws, "null");
13321331
continue;
13331332
}
1333+
/* FIXME
13341334
fd_txn_map_t elem;
13351335
uchar flags;
13361336
if( fd_blockstore_txn_query_volatile( blockstore, ctx->global->blockstore_fd, key, &elem, NULL, &flags, NULL ) ) {
@@ -1341,6 +1341,7 @@ method_getSignatureStatuses(struct json_values* values, fd_rpc_ctx_t * ctx) {
13411341
// TODO other fields
13421342
fd_web_reply_sprintf(ws, "{\"slot\":%lu,\"confirmations\":null,\"err\":null,\"status\":{\"Ok\":null},\"confirmationStatus\":%s}",
13431343
elem.slot, block_flags_to_confirmation_status(flags));
1344+
*/
13441345
}
13451346

13461347
fd_web_reply_sprintf(ws, "]},\"id\":%s}" CRLF, ctx->call_id);
@@ -1586,6 +1587,8 @@ method_getTransaction(struct json_values* values, fd_rpc_ctx_t * ctx) {
15861587
fd_web_reply_sprintf(ws, "{\"jsonrpc\":\"2.0\",\"result\":null,\"id\":%s}" CRLF, ctx->call_id);
15871588
return 0;
15881589
}
1590+
(void)enc;
1591+
#if 0 /* FIXME */
15891592
fd_txn_map_t elem;
15901593
long blk_ts;
15911594
uchar blk_flags;
@@ -1620,6 +1623,7 @@ method_getTransaction(struct json_values* values, fd_rpc_ctx_t * ctx) {
16201623
fd_method_error(ctx, -1, "%s", err);
16211624
return 0;
16221625
}
1626+
#endif
16231627
fd_web_reply_sprintf(ws, "},\"id\":%s}" CRLF, ctx->call_id);
16241628

16251629
return 0;

src/discof/writer/fd_writer_tile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ during_frag( fd_writer_tile_ctx_t * ctx,
189189
FD_SPIN_PAUSE();
190190
}
191191
FD_SPAD_FRAME_BEGIN( ctx->spad ) {
192-
fd_runtime_finalize_txn( ctx->slot_ctx, NULL, &info, ctx->spad );
192+
fd_runtime_finalize_txn( ctx->slot_ctx, &info, ctx->spad );
193193
} FD_SPAD_FRAME_END;
194194
}
195195
/* Notify the replay tile. */

0 commit comments

Comments
 (0)