Skip to content

removed legacy transaction map #5149

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 1 addition & 4 deletions src/app/firedancer-dev/commands/backtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ setup_topo_blockstore( fd_topo_t * topo,
ulong shred_max,
ulong block_max,
ulong idx_max,
ulong txn_max,
ulong alloc_max ) {
fd_topo_obj_t * obj = fd_topob_obj( topo, "blockstore", wksp_name );

Expand All @@ -78,12 +77,11 @@ setup_topo_blockstore( fd_topo_t * topo,
FD_TEST( fd_pod_insertf_ulong( topo->props, shred_max, "obj.%lu.shred_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, block_max, "obj.%lu.block_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, idx_max, "obj.%lu.idx_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, txn_max, "obj.%lu.txn_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, alloc_max, "obj.%lu.alloc_max", obj->id ) );

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

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

return obj;
Expand Down Expand Up @@ -344,7 +342,6 @@ backtest_topo( config_t * config ) {
config->firedancer.blockstore.shred_max,
config->firedancer.blockstore.block_max,
config->firedancer.blockstore.idx_max,
config->firedancer.blockstore.txn_max,
config->firedancer.blockstore.alloc_max );
fd_topob_tile_uses( topo, replay_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
fd_topob_tile_uses( topo, backtest_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
Expand Down
5 changes: 1 addition & 4 deletions src/app/firedancer-dev/commands/sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ setup_topo_blockstore( fd_topo_t * topo,
ulong shred_max,
ulong block_max,
ulong idx_max,
ulong txn_max,
ulong alloc_max ) {
fd_topo_obj_t * obj = fd_topob_obj( topo, "blockstore", wksp_name );

Expand All @@ -78,12 +77,11 @@ setup_topo_blockstore( fd_topo_t * topo,
FD_TEST( fd_pod_insertf_ulong( topo->props, shred_max, "obj.%lu.shred_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, block_max, "obj.%lu.block_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, idx_max, "obj.%lu.idx_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, txn_max, "obj.%lu.txn_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, alloc_max, "obj.%lu.alloc_max", obj->id ) );

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

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

return obj;
Expand Down Expand Up @@ -260,7 +258,6 @@ sim_topo( config_t * config ) {
config->firedancer.blockstore.shred_max,
config->firedancer.blockstore.block_max,
config->firedancer.blockstore.idx_max,
config->firedancer.blockstore.txn_max,
config->firedancer.blockstore.alloc_max );
fd_topo_obj_t * poh_shred_obj = fd_topob_obj( topo, "fseq", "poh_shred" );
fd_topo_obj_t * root_slot_obj = fd_topob_obj( topo, "fseq", "root_slot" );
Expand Down
4 changes: 2 additions & 2 deletions src/app/firedancer/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fd_topo_obj_callbacks_t fd_obj_cb_runtime_pub = {
static ulong
blockstore_footprint( fd_topo_t const * topo,
fd_topo_obj_t const * obj ) {
return fd_blockstore_footprint( VAL("shred_max"), VAL("block_max"), VAL("idx_max"), VAL("txn_max") ) + VAL("alloc_max");
return fd_blockstore_footprint( VAL("shred_max"), VAL("block_max"), VAL("idx_max") ) + VAL("alloc_max");
}

static ulong
Expand All @@ -52,7 +52,7 @@ blockstore_align( fd_topo_t const * topo FD_FN_UNUSED,
static void
blockstore_new( fd_topo_t const * topo,
fd_topo_obj_t const * obj ) {
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") ) );
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") ) );
}

fd_topo_obj_callbacks_t fd_obj_cb_blockstore = {
Expand Down
5 changes: 1 addition & 4 deletions src/app/firedancer/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ setup_topo_blockstore( fd_topo_t * topo,
ulong shred_max,
ulong block_max,
ulong idx_max,
ulong txn_max,
ulong alloc_max ) {
fd_topo_obj_t * obj = fd_topob_obj( topo, "blockstore", wksp_name );

Expand All @@ -39,12 +38,11 @@ setup_topo_blockstore( fd_topo_t * topo,
FD_TEST( fd_pod_insertf_ulong( topo->props, shred_max, "obj.%lu.shred_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, block_max, "obj.%lu.block_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, idx_max, "obj.%lu.idx_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, txn_max, "obj.%lu.txn_max", obj->id ) );
FD_TEST( fd_pod_insertf_ulong( topo->props, alloc_max, "obj.%lu.alloc_max", obj->id ) );

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

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

return obj;
Expand Down Expand Up @@ -460,7 +458,6 @@ fd_topo_initialize( config_t * config ) {
config->firedancer.blockstore.shred_max,
config->firedancer.blockstore.block_max,
config->firedancer.blockstore.idx_max,
config->firedancer.blockstore.txn_max,
config->firedancer.blockstore.alloc_max );
fd_topob_tile_uses( topo, store_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
fd_topob_tile_uses( topo, replay_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
Expand Down
14 changes: 3 additions & 11 deletions src/app/ledger/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ runtime_replay( fd_ledger_args_t * ledger_args ) {
if( !block_exists && slot_meta.slot == slot ) {
int err = fd_rocksdb_import_block_blockstore( &rocks_db,
&slot_meta, blockstore,
ledger_args->copy_txn_status,
slot == (ledger_args->trash_hash) ? trash_hash_buf : NULL,
ledger_args->valloc );
if( FD_UNLIKELY( err ) ) {
Expand Down Expand Up @@ -761,7 +760,6 @@ ingest_rocksdb( char const * file,
ulong start_slot,
ulong end_slot,
fd_blockstore_t * blockstore,
int txn_status,
ulong trash_hash,
fd_valloc_t valloc ) {

Expand Down Expand Up @@ -818,7 +816,6 @@ ingest_rocksdb( char const * file,
int err = fd_rocksdb_import_block_blockstore( &rocks_db,
&slot_meta,
blockstore,
txn_status,
(slot == trash_hash) ? trash_hash_buf : NULL,
valloc );
if( FD_UNLIKELY( err ) ) {
Expand Down Expand Up @@ -935,12 +932,11 @@ init_blockstore( fd_ledger_args_t * args ) {
}
FD_LOG_NOTICE(( "joined blockstore" ));
} else {
ulong txn_max = 256UL;
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 );
shmem = fd_wksp_alloc_laddr( args->wksp, fd_blockstore_align(), fd_blockstore_footprint( args->shred_max, args->slot_history_max, 16 ), blockstore_tag );
if( shmem == NULL ) {
FD_LOG_ERR(( "failed to allocate a blockstore" ));
}
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 ) );
args->blockstore = fd_blockstore_join( &args->blockstore_ljoin, fd_blockstore_new( shmem, 1, args->hashseed, args->shred_max, args->slot_history_max, 16 ) );
if( args->blockstore->shmem->magic != FD_BLOCKSTORE_MAGIC ) {
fd_wksp_free_laddr( shmem );
FD_LOG_ERR(( "failed to allocate a blockstore" ));
Expand Down Expand Up @@ -1050,13 +1046,9 @@ minify( fd_ledger_args_t * args ) {
args->start_slot,
args->end_slot,
args->blockstore,
0,
ULONG_MAX,
args->valloc );

fd_rocksdb_copy_over_txn_status_range( &big_rocksdb, &mini_rocksdb, args->blockstore,
args->start_slot, args->end_slot );
FD_LOG_NOTICE(( "copied over all transaction statuses" ));
} else {
FD_LOG_NOTICE(( "skipping copying of transaction statuses" ));
}
Expand Down Expand Up @@ -1172,7 +1164,7 @@ ingest( fd_ledger_args_t * args ) {
args->end_slot = slot_ctx->slot_bank.slot + args->slot_history_max - 1;
}
ingest_rocksdb( args->rocksdb_list[ 0UL ], args->start_slot, args->end_slot,
blockstore, args->copy_txn_status, args->trash_hash, args->valloc );
blockstore, args->trash_hash, args->valloc );
}

/* Verification */
Expand Down
4 changes: 2 additions & 2 deletions src/app/shredcap/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ main( int argc, char ** argv ) {
FD_LOG_ERR(( "failed to join a blockstore" ));
}
} else {
shmem = fd_wksp_alloc_laddr( wksp, fd_blockstore_align(), fd_blockstore_footprint( shred_max, slot_history_max, 16, shred_max ), FD_BLOCKSTORE_MAGIC );
shmem = fd_wksp_alloc_laddr( wksp, fd_blockstore_align(), fd_blockstore_footprint( shred_max, slot_history_max, 16 ), FD_BLOCKSTORE_MAGIC );
if ( shmem == NULL ) {
FD_LOG_ERR(( "failed to allocate a blockstore" ));
}

blockstore = fd_blockstore_join( &blockstore_ljoin, fd_blockstore_new( shmem, 1, hashseed, shred_max, slot_history_max, 16, shred_max ) );
blockstore = fd_blockstore_join( &blockstore_ljoin, fd_blockstore_new( shmem, 1, hashseed, shred_max, slot_history_max, 16 ) );
if ( blockstore == NULL ) {
fd_wksp_free_laddr( shmem );
FD_LOG_ERR(( "failed to allocate a blockstore" ));
Expand Down
6 changes: 2 additions & 4 deletions src/discof/rpcserver/fd_block_to_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,6 @@ fd_txn_to_json( fd_webserver_t * ws,

const char*
fd_block_to_json( fd_webserver_t * ws,
fd_blockstore_t * blockstore,
int blockstore_fd,
const char * call_id,
const uchar * blk_data,
ulong blk_sz,
Expand Down Expand Up @@ -766,8 +764,6 @@ fd_block_to_json( fd_webserver_t * ws,

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

fd_wksp_t * blockstore_wksp = fd_blockstore_wksp( blockstore );

int first_txn = 1;
ulong blockoff = 0;
while (blockoff < blk_sz) {
Expand Down Expand Up @@ -801,6 +797,7 @@ fd_block_to_json( fd_webserver_t * ws,
} else
EMIT_SIMPLE(",{");

/* FIXME
uchar const * sig_p = raw + ((fd_txn_t *)txn_out)->signature_off;
fd_txn_map_t elem;
uchar flags;
Expand All @@ -809,6 +806,7 @@ fd_block_to_json( fd_webserver_t * ws,
const char * err = fd_txn_meta_to_json( ws, meta, elem.meta_sz );
if ( err ) return err;
}
*/

const char * err = fd_txn_to_json( ws, (fd_txn_t *)txn_out, raw, pay_sz, encoding, maxvers, detail, spad );
if ( err ) return err;
Expand Down
2 changes: 0 additions & 2 deletions src/discof/rpcserver/fd_block_to_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ const char* fd_txn_to_json( fd_webserver_t * ws,
fd_spad_t * spad );

const char* fd_block_to_json( fd_webserver_t * ws,
fd_blockstore_t * blockstore,
int blockstore_fd,
const char * call_id,
const uchar * blk_data,
ulong blk_sz,
Expand Down
10 changes: 7 additions & 3 deletions src/discof/rpcserver/fd_rpc_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,15 @@ read_slot_bank( fd_rpc_ctx_t * ctx, ulong slot ) {
return slot_bank;
}

/*
static const char *
block_flags_to_confirmation_status( uchar flags ) {
if( flags & (1U << FD_BLOCK_FLAG_FINALIZED) ) return "\"finalized\"";
if( flags & (1U << FD_BLOCK_FLAG_CONFIRMED) ) return "\"confirmed\"";
if( flags & (1U << FD_BLOCK_FLAG_PROCESSED) ) return "\"processed\"";
return "null";
}
*/

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

const char * err = fd_block_to_json(ws,
blockstore,
ctx->global->blockstore_fd,
ctx->call_id,
blk_data,
blk_sz,
Expand Down Expand Up @@ -1305,7 +1305,6 @@ method_getSignaturesForAddress(struct json_values* values, fd_rpc_ctx_t * ctx) {
static int
method_getSignatureStatuses(struct json_values* values, fd_rpc_ctx_t * ctx) {
fd_webserver_t * ws = &ctx->global->ws;
fd_blockstore_t * blockstore = ctx->global->blockstore;
fd_web_reply_sprintf(ws, "{\"jsonrpc\":\"2.0\",\"result\":{\"context\":{\"apiVersion\":\"" FIREDANCER_VERSION "\",\"slot\":%lu},\"value\":[",
ctx->global->last_slot);

Expand All @@ -1331,6 +1330,7 @@ method_getSignatureStatuses(struct json_values* values, fd_rpc_ctx_t * ctx) {
fd_web_reply_sprintf(ws, "null");
continue;
}
/* FIXME
fd_txn_map_t elem;
uchar flags;
if( fd_blockstore_txn_query_volatile( blockstore, ctx->global->blockstore_fd, key, &elem, NULL, &flags, NULL ) ) {
Expand All @@ -1341,6 +1341,7 @@ method_getSignatureStatuses(struct json_values* values, fd_rpc_ctx_t * ctx) {
// TODO other fields
fd_web_reply_sprintf(ws, "{\"slot\":%lu,\"confirmations\":null,\"err\":null,\"status\":{\"Ok\":null},\"confirmationStatus\":%s}",
elem.slot, block_flags_to_confirmation_status(flags));
*/
}

fd_web_reply_sprintf(ws, "]},\"id\":%s}" CRLF, ctx->call_id);
Expand Down Expand Up @@ -1586,6 +1587,8 @@ method_getTransaction(struct json_values* values, fd_rpc_ctx_t * ctx) {
fd_web_reply_sprintf(ws, "{\"jsonrpc\":\"2.0\",\"result\":null,\"id\":%s}" CRLF, ctx->call_id);
return 0;
}
(void)enc;
#if 0 /* FIXME */
fd_txn_map_t elem;
long blk_ts;
uchar blk_flags;
Expand Down Expand Up @@ -1620,6 +1623,7 @@ method_getTransaction(struct json_values* values, fd_rpc_ctx_t * ctx) {
fd_method_error(ctx, -1, "%s", err);
return 0;
}
#endif
fd_web_reply_sprintf(ws, "},\"id\":%s}" CRLF, ctx->call_id);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/discof/writer/fd_writer_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ during_frag( fd_writer_tile_ctx_t * ctx,
FD_SPIN_PAUSE();
}
FD_SPAD_FRAME_BEGIN( ctx->spad ) {
fd_runtime_finalize_txn( ctx->slot_ctx, NULL, &info, ctx->spad );
fd_runtime_finalize_txn( ctx->slot_ctx, &info, ctx->spad );
} FD_SPAD_FRAME_END;
}
/* Notify the replay tile. */
Expand Down
Loading
Loading