Skip to content

Commit

Permalink
snapshot: snapshot_service
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhatt-jumptrading committed Dec 19, 2024
1 parent d886637 commit ee47a89
Show file tree
Hide file tree
Showing 50 changed files with 5,819 additions and 617 deletions.
3 changes: 3 additions & 0 deletions src/app/fdctl/Local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ $(call add-objs,run/tiles/fd_poh_int,fd_fdctl)
$(call add-objs,run/tiles/fd_sender,fd_fdctl)
$(call add-objs,run/tiles/fd_eqvoc,fd_fdctl)
$(call add-objs,run/tiles/fd_rpcserv,fd_fdctl)
$(call add-objs,run/tiles/fd_snapshot,fd_fdctl)
$(call add-objs,run/tiles/fd_snapshot_thread,fd_fdctl)
endif

# fdctl topologies
Expand Down Expand Up @@ -104,6 +106,7 @@ $(OBJDIR)/obj/app/fdctl/run/tiles/fd_replay.o: src/app/fdctl/run/tiles/generated
$(OBJDIR)/obj/app/fdctl/run/tiles/fd_sender.o: src/app/fdctl/run/tiles/generated/sender_seccomp.h
$(OBJDIR)/obj/app/fdctl/run/tiles/fd_eqvoc.o: src/app/fdctl/run/tiles/generated/eqvoc_seccomp.h
$(OBJDIR)/obj/app/fdctl/run/tiles/fd_rpcserv.o: src/app/fdctl/run/tiles/generated/rpcserv_seccomp.h
$(OBJDIR)/obj/app/fdctl/run/tiles/fd_snaps.o: src/app/fdctl/run/tiles/generated/snapshot_seccomp.h
endif

check-agave-hash:
Expand Down
2 changes: 1 addition & 1 deletion src/app/fdctl/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ fdctl_obj_footprint( fd_topo_t const * topo,
} else if( FD_UNLIKELY( !strcmp( obj->name, "funk" ) ) ) {
return fd_funk_footprint();
} else if( FD_UNLIKELY( !strcmp( obj->name, "txncache" ) ) ) {
return fd_txncache_footprint( VAL("max_rooted_slots"), VAL("max_live_slots"), VAL("max_txn_per_slot") );
return fd_txncache_footprint( VAL("max_rooted_slots"), VAL("max_live_slots"), VAL("max_txn_per_slot"), FD_TXNCACHE_DEFAULT_MAX_CONSTIPATED_SLOTS );
} else {
FD_LOG_ERR(( "unknown object `%s`", obj->name ));
return 0UL;
Expand Down
7 changes: 7 additions & 0 deletions src/app/fdctl/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ typedef struct {
char shred_cap_replay[ PATH_MAX ];
} store_int;

struct {
ulong full_interval;
ulong incremental_interval;
char out_dir[ PATH_MAX ];
ulong hash_tpool_thread_count;
} snaps;

} tiles;
} config_t;

Expand Down
2 changes: 2 additions & 0 deletions src/app/fdctl/config/default-firedancer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
cluster_version = "1.18.0"
[tiles.pack]
use_consumed_cus = false
[tiles.snaps]
hash_tpool_thread_count = 2

[consensus]
vote = true
Expand Down
5 changes: 5 additions & 0 deletions src/app/fdctl/config_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ fdctl_pod_to_cfg( config_t * config,
CFG_POP ( cstr, tiles.store_int.shred_cap_archive );
CFG_POP ( cstr, tiles.store_int.shred_cap_replay );

CFG_POP ( ulong, tiles.snaps.full_interval );
CFG_POP ( ulong, tiles.snaps.incremental_interval );
CFG_POP ( cstr, tiles.snaps.out_dir );
CFG_POP ( ulong, tiles.snaps.hash_tpool_thread_count );

# undef CFG_POP
# undef CFG_ARRAY

Expand Down
1 change: 1 addition & 0 deletions src/app/fdctl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern fd_topo_run_tile_t fd_tile_repair;
extern fd_topo_run_tile_t fd_tile_store_int;
extern fd_topo_run_tile_t fd_tile_replay;
extern fd_topo_run_tile_t fd_tile_replay_thread;
extern fd_topo_run_tile_t fd_tile_snaps_thread;
extern fd_topo_run_tile_t fd_tile_poh_int;
extern fd_topo_run_tile_t fd_tile_sender;
extern fd_topo_run_tile_t fd_tile_eqvoc;
Expand Down
5 changes: 3 additions & 2 deletions src/app/fdctl/ready.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ ready_cmd_fn( args_t * args,
anyway. */
if( FD_UNLIKELY( tile->is_agave ) ) continue;

/* Don't wait for thread tiles, they will not report ready. */
if( strncmp( tile->name, "thread", 7 )==0 ) continue;
/* Don't wait for rtpool/stpool tiles, they will not report ready. */
if( strncmp( tile->name, "rtpool", 7 )==0 ) continue;
if( strncmp( tile->name, "stpool", 7 )==0 ) continue;

long start = fd_log_wallclock();
int printed = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/app/fdctl/run/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "../../../waltz/xdp/fd_xdp1.h"
#include "../../../flamenco/runtime/fd_blockstore.h"
#include "../../../flamenco/runtime/fd_txncache.h"
#include "../../../funk/fd_funk_filemap.h"
#include "../../../funk/fd_funk.h"
#include "../configure/configure.h"

Expand Down Expand Up @@ -538,7 +539,7 @@ fdctl_obj_new( fd_topo_t const * topo,
} else if( FD_UNLIKELY( !strcmp( obj->name, "funk" ) ) ) {
FD_TEST( fd_funk_new( laddr, VAL("wksp_tag"), VAL("seed"), VAL("txn_max"), VAL("rec_max") ) );
} else if( FD_UNLIKELY( !strcmp( obj->name, "txncache" ) ) ) {
FD_TEST( fd_txncache_new( laddr, VAL("max_rooted_slots"), VAL("max_live_slots"), VAL("max_txn_per_slot") ) );
FD_TEST( fd_txncache_new( laddr, VAL("max_rooted_slots"), VAL("max_live_slots"), VAL("max_txn_per_slot"), FD_TXNCACHE_DEFAULT_MAX_CONSTIPATED_SLOTS ) );
} else {
FD_LOG_ERR(( "unknown object `%s`", obj->name ));
}
Expand Down
Loading

0 comments on commit ee47a89

Please sign in to comment.