Skip to content

Commit a45cba0

Browse files
flamenco, groove: initial Funk/Groove wiring
1 parent e28147b commit a45cba0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1993
-386
lines changed

src/app/firedancer-dev/Local.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $(call add-objs,commands/dev,fd_firedancer_dev)
1515
$(call add-objs,commands/sim,fd_firedancer_dev)
1616
$(call add-objs,commands/backtest,fd_firedancer_dev)
1717

18-
$(call make-bin,firedancer-dev,main,fd_firedancer_dev fd_firedancer fddev_shared fdctl_shared fd_discof fd_disco fd_choreo fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util firedancer_version, $(SECP256K1_LIBS) $(ROCKSDB_LIBS))
18+
$(call make-bin,firedancer-dev,main,fd_firedancer_dev fd_firedancer fddev_shared fdctl_shared fd_discof fd_disco fd_choreo fd_flamenco fd_funk fd_groove fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util firedancer_version, $(SECP256K1_LIBS) $(ROCKSDB_LIBS))
1919

2020
firedancer-dev: $(OBJDIR)/bin/firedancer-dev
2121

src/app/firedancer-dev/config/default.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
repair_intake_listen_port = 9294
2222
repair_serve_listen_port = 8034
2323
[tiles.replay]
24-
snapshot_url = "http://{validator_ip}:8899/snapshot.tar.bz2"
25-
incremental_url = "http://{validator_ip}:8899/incremental-snapshot.tar.bz2"
24+
snapshot_url = "{snapshot_endpoint}/snapshot.tar.bz2"
25+
incremental_url = "{snapshot_endpoint}/incremental-snapshot.tar.bz2"
2626
funk_sz_gb = 140
2727
funk_rec_max = 150000000
2828
funk_txn_max = 2000
2929
funk_file = "{funk_path}"
30+
[tiles.groove]
31+
cold_store_dir = "{ledger_dir}/cold_store"
3032
[tiles.metric]
3133
prometheus_listen_address = "0.0.0.0"
3234
prometheus_listen_port = 7999

src/app/firedancer-dev/main.c

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ extern fd_topo_run_tile_t fd_tile_gossip;
8484
extern fd_topo_run_tile_t fd_tile_repair;
8585
extern fd_topo_run_tile_t fd_tile_storei;
8686
extern fd_topo_run_tile_t fd_tile_replay;
87+
extern fd_topo_run_tile_t fd_tile_groove;
8788
extern fd_topo_run_tile_t fd_tile_execor;
8889
extern fd_topo_run_tile_t fd_tile_writer;
8990
extern fd_topo_run_tile_t fd_tile_batch;
@@ -123,6 +124,7 @@ fd_topo_run_tile_t * TILES[] = {
123124
&fd_tile_repair,
124125
&fd_tile_storei,
125126
&fd_tile_replay,
127+
&fd_tile_groove,
126128
&fd_tile_execor,
127129
&fd_tile_writer,
128130
&fd_tile_batch,

src/app/firedancer/Local.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $(call add-objs,callbacks,fd_firedancer)
3737
$(call make-lib,firedancer_version)
3838
$(call add-objs,version,firedancer_version)
3939

40-
$(call make-bin,firedancer,main,fd_firedancer fdctl_shared fd_discof fd_disco fd_choreo fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util firedancer_version, $(SECP256K1_LIBS))
40+
$(call make-bin,firedancer,main,fd_firedancer fdctl_shared fd_discof fd_disco fd_choreo fd_flamenco fd_funk fd_groove fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util firedancer_version, $(SECP256K1_LIBS))
4141

4242
firedancer: $(OBJDIR)/bin/firedancer
4343
else

src/app/firedancer/main.c

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ extern fd_topo_run_tile_t fd_tile_gossip;
7171
extern fd_topo_run_tile_t fd_tile_repair;
7272
extern fd_topo_run_tile_t fd_tile_storei;
7373
extern fd_topo_run_tile_t fd_tile_replay;
74+
extern fd_topo_run_tile_t fd_tile_groove;
7475
extern fd_topo_run_tile_t fd_tile_execor;
7576
extern fd_topo_run_tile_t fd_tile_writer;
7677
extern fd_topo_run_tile_t fd_tile_batch;
@@ -99,6 +100,7 @@ fd_topo_run_tile_t * TILES[] = {
99100
&fd_tile_repair,
100101
&fd_tile_storei,
101102
&fd_tile_replay,
103+
&fd_tile_groove,
102104
&fd_tile_execor,
103105
&fd_tile_writer,
104106
&fd_tile_batch,

src/app/firedancer/topology.c

+16
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ fd_topo_initialize( config_t * config ) {
247247

248248
fd_topob_wksp( topo, "replay_exec" );
249249
fd_topob_wksp( topo, "replay_wtr" );
250+
fd_topob_wksp( topo, "replay_grv" );
250251
fd_topob_wksp( topo, "exec_writer" );
251252

252253
fd_topob_wksp( topo, "voter_sign" );
@@ -297,6 +298,7 @@ fd_topo_initialize( config_t * config ) {
297298
fd_topob_wksp( topo, "runtime_pub" );
298299
fd_topob_wksp( topo, "exec" );
299300
fd_topob_wksp( topo, "writer" );
301+
fd_topob_wksp( topo, "groove" );
300302
fd_topob_wksp( topo, "bstore" );
301303
fd_topob_wksp( topo, "tcache" );
302304
fd_topob_wksp( topo, "poh" );
@@ -310,6 +312,7 @@ fd_topo_initialize( config_t * config ) {
310312
fd_topob_wksp( topo, "exec_spad" );
311313
fd_topob_wksp( topo, "exec_fseq" );
312314
fd_topob_wksp( topo, "writer_fseq" );
315+
fd_topob_wksp( topo, "groove_fseq" );
313316

314317
if( enable_rpc ) fd_topob_wksp( topo, "rpcsrv" );
315318

@@ -341,6 +344,7 @@ fd_topo_initialize( config_t * config ) {
341344
message that is outbound from the replay to exec. */
342345
FOR(exec_tile_cnt) fd_topob_link( topo, "replay_exec", "replay_exec", 128UL, 10240UL, exec_tile_cnt );
343346
FOR(writer_tile_cnt) fd_topob_link( topo, "replay_wtr", "replay_wtr", 128UL, FD_REPLAY_WRITER_MTU, 1UL );
347+
/**/ fd_topob_link( topo, "replay_grv", "replay_grv", 128UL, FD_REPLAY_GROOVE_MTU, 1UL );
344348
/* Assuming the number of writer tiles is sufficient to keep up with
345349
the number of exec tiles, under equilibrium, we should have at least
346350
enough link space to buffer worst case input shuffling done by the
@@ -448,6 +452,7 @@ fd_topo_initialize( config_t * config ) {
448452
FOR(exec_tile_cnt) fd_topob_tile( topo, "exec", "exec", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
449453
FOR(writer_tile_cnt) fd_topob_tile( topo, "writer", "writer", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
450454
fd_topo_tile_t * batch_tile = fd_topob_tile( topo, "batch", "batch", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
455+
fd_topo_tile_t * groove_tile = fd_topob_tile( topo, "groove", "groove", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
451456

452457
if( enable_rstart ) /* */ fd_topob_tile( topo, "rstart", "restart", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
453458

@@ -562,6 +567,12 @@ fd_topo_initialize( config_t * config ) {
562567
fd_topob_tile_uses( topo, batch_tile, constipated_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
563568
FD_TEST( fd_pod_insertf_ulong( topo->props, constipated_obj->id, "constipate" ) );
564569

570+
/* This fseq communicates the progress Groove is making to the Replay tile */
571+
fd_topo_obj_t * groove_fseq_obj = fd_topob_obj( topo, "fseq", "groove_fseq" );
572+
fd_topob_tile_uses( topo, groove_tile, groove_fseq_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
573+
fd_topob_tile_uses( topo, replay_tile, groove_fseq_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
574+
FD_TEST( fd_pod_insertf_ulong( topo->props, groove_fseq_obj->id, "groove_fseq" ) );
575+
565576
if( FD_LIKELY( !is_auto_affinity ) ) {
566577
if( FD_UNLIKELY( affinity_tile_cnt<topo->tile_cnt ) )
567578
FD_LOG_ERR(( "The topology you are using has %lu tiles, but the CPU affinity specified in the config tile as [layout.affinity] only provides for %lu cores. "
@@ -664,6 +675,7 @@ fd_topo_initialize( config_t * config ) {
664675
FOR(bank_tile_cnt) fd_topob_tile_out( topo, "replay", 0UL, "replay_poh", i );
665676
FOR(exec_tile_cnt) fd_topob_tile_out( topo, "replay", 0UL, "replay_exec", i ); /* TODO check order in fd_replay.c macros*/
666677
FOR(writer_tile_cnt) fd_topob_tile_out( topo, "replay", 0UL, "replay_wtr", i );
678+
/**/ fd_topob_tile_out( topo, "replay", 0UL, "replay_grv", 0UL );
667679

668680
FOR(exec_tile_cnt) fd_topob_tile_in( topo, "exec", i, "metric_in", "replay_exec", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
669681
FOR(exec_tile_cnt) fd_topob_tile_out( topo, "exec", i, "exec_writer", i );
@@ -672,6 +684,7 @@ fd_topo_initialize( config_t * config ) {
672684
FOR(writer_tile_cnt) for( ulong j=0UL; j<exec_tile_cnt; j++ )
673685
fd_topob_tile_in( topo, "writer", i, "metric_in", "exec_writer", j, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
674686
FOR(writer_tile_cnt) fd_topob_tile_in( topo, "writer", i, "metric_in", "replay_wtr", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
687+
/**/ fd_topob_tile_in( topo, "groove", 0UL, "metric_in", "replay_grv", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
675688
676689
/**/ fd_topob_tile_in( topo, "sender", 0UL, "metric_in", "stake_out", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
677690
/**/ fd_topob_tile_in( topo, "sender", 0UL, "metric_in", "gossip_voter", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
@@ -954,6 +967,9 @@ fd_topo_initialize( config_t * config ) {
954967
strncpy( tile->exec.funk_file, config->tiles.replay.funk_file, sizeof(tile->exec.funk_file) );
955968
} else if( FD_UNLIKELY( !strcmp( tile->name, "writer" ) ) ) {
956969
strncpy( tile->writer.funk_file, config->tiles.replay.funk_file, sizeof(tile->writer.funk_file) );
970+
} else if( FD_UNLIKELY( !strcmp( tile->name, "groove" ) ) ) {
971+
strncpy( tile->groove.funk_file, config->tiles.replay.funk_file, sizeof(tile->groove.funk_file) );
972+
strncpy( tile->groove.cold_store_dir, config->tiles.groove.cold_store_dir, sizeof(tile->groove.cold_store_dir) );
957973
} else if( FD_UNLIKELY( !strcmp( tile->name, "rstart" ) ) ) {
958974
strncpy( tile->restart.funk_file, config->tiles.replay.funk_file, sizeof(tile->replay.funk_file) );
959975
strncpy( tile->restart.tower_checkpt, config->tiles.replay.tower_checkpt, sizeof(tile->replay.tower_checkpt) );

src/app/ledger/Local.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ifdef FD_HAS_ROCKSDB
22

33
ifdef FD_HAS_SECP256K1
4-
$(call make-bin,fd_ledger,main,fd_flamenco fd_ballet fd_reedsol fd_funk fd_tango fd_choreo fd_waltz fd_util fd_disco,$(ROCKSDB_LIBS) $(SECP256K1_LIBS))
4+
$(call make-bin,fd_ledger,main,fd_flamenco fd_ballet fd_reedsol fd_funk fd_groove fd_tango fd_choreo fd_waltz fd_util fd_disco,$(ROCKSDB_LIBS) $(SECP256K1_LIBS))
55
else
66
$(warning ledger tool build disabled due to lack of secp256k1)
77
endif

src/app/ledger/main.c

-8
Original file line numberDiff line numberDiff line change
@@ -1125,8 +1125,6 @@ ingest( fd_ledger_args_t * args ) {
11251125
args->verify_acc_hash,
11261126
args->check_acc_hash ,
11271127
FD_SNAPSHOT_TYPE_FULL,
1128-
args->exec_spads,
1129-
args->exec_spad_cnt,
11301128
args->runtime_spad );
11311129
FD_LOG_NOTICE(( "imported records from snapshot" ));
11321130
}
@@ -1140,8 +1138,6 @@ ingest( fd_ledger_args_t * args ) {
11401138
args->verify_acc_hash,
11411139
args->check_acc_hash,
11421140
FD_SNAPSHOT_TYPE_INCREMENTAL,
1143-
args->exec_spads,
1144-
args->exec_spad_cnt,
11451141
args->runtime_spad );
11461142
FD_LOG_NOTICE(( "imported records from incremental snapshot" ));
11471143
}
@@ -1316,8 +1312,6 @@ replay( fd_ledger_args_t * args ) {
13161312
args->verify_acc_hash,
13171313
args->check_acc_hash,
13181314
FD_SNAPSHOT_TYPE_FULL,
1319-
args->exec_spads,
1320-
args->exec_spad_cnt,
13211315
args->runtime_spad );
13221316
FD_LOG_NOTICE(( "imported from snapshot" ));
13231317
if( args->incremental ) {
@@ -1330,8 +1324,6 @@ replay( fd_ledger_args_t * args ) {
13301324
args->verify_acc_hash,
13311325
args->check_acc_hash,
13321326
FD_SNAPSHOT_TYPE_INCREMENTAL,
1333-
args->exec_spads,
1334-
args->exec_spad_cnt,
13351327
args->runtime_spad );
13361328
FD_LOG_NOTICE(( "imported from snapshot" ));
13371329
}

src/app/rpcserver/Local.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ifdef FD_HAS_HOSTED
22
ifdef FD_HAS_INT128
33
ifdef FD_HAS_SSE
4-
$(call make-bin,fd_rpcserver,main,fd_discof fd_disco fd_flamenco fd_reedsol fd_ballet fd_funk fd_tango fd_choreo fd_waltz fd_util, $(SECP256K1_LIBS))
4+
$(call make-bin,fd_rpcserver,main,fd_discof fd_disco fd_flamenco fd_reedsol fd_ballet fd_funk fd_groove fd_tango fd_choreo fd_waltz fd_util, $(SECP256K1_LIBS))
55
endif
66
endif
77
endif

src/app/shared/fd_config.h

+4
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,10 @@ struct fd_config {
408408
char archiver_path[ PATH_MAX ];
409409
} archiver;
410410

411+
struct {
412+
char cold_store_dir[ PATH_MAX ];
413+
} groove;
414+
411415
} tiles;
412416
};
413417

src/app/shared/fd_config_parse.c

+2
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ fd_config_extract_pod( uchar * pod,
475475
CFG_POP ( ulong, tiles.archiver.end_slot );
476476
CFG_POP ( cstr, tiles.archiver.archiver_path );
477477

478+
CFG_POP ( cstr, tiles.groove.cold_store_dir );
479+
478480
CFG_POP ( bool, development.sandbox );
479481
CFG_POP ( bool, development.no_clone );
480482
CFG_POP ( bool, development.core_dump );

src/disco/fd_disco_base.h

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ FD_STATIC_ASSERT( FD_SHRED_REPAIR_MTU == 120 , update FD_SHRED_REPAIR_MTU );
6262
#define FD_REPLAY_WRITER_MTU (128UL)
6363
#define FD_EXEC_WRITER_MTU (128UL)
6464

65+
/* Maximum size of frags going into the Groove tile. */
66+
#define FD_REPLAY_GROOVE_MTU (48UL)
6567

6668
#define FD_NETMUX_SIG_MIN_HDR_SZ ( 42UL) /* The default header size, which means no vlan tags and no IP options. */
6769
#define FD_NETMUX_SIG_IGNORE_HDR_SZ (102UL) /* Outside the allowable range, but still fits in 4 bits when compressed */

src/disco/topo/fd_topo.h

+5
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ typedef struct {
435435
int archive_fd;
436436
} archiver;
437437

438+
struct {
439+
char funk_file[ PATH_MAX ];
440+
char cold_store_dir[ PATH_MAX ];
441+
} groove;
442+
438443
};
439444
} fd_topo_tile_t;
440445

src/disco/topo/fd_topob.c

+1
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ fd_topob_auto_layout( fd_topo_t * topo,
373373
"eqvoc", /* FIREDANCER only */
374374
"rpcsrv", /* FIREDANCER only */
375375
"batch", /* FIREDANCER only */
376+
"groove", /* FIREDANCER only */
376377
"pktgen",
377378
};
378379

src/discof/groove/Local.mk

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ifdef FD_HAS_INT128
2+
$(call add-objs,fd_groove_tile,fd_discof)
3+
endif
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <linux/limits.h>
2+
#include "../../flamenco/types/fd_types.h"
3+
#include "../../funk/fd_funk_txn.h"
4+
5+
/******************************** Groove Tile API **************************************/
6+
7+
/* Signatures */
8+
#define FD_GROOVE_TILE_LOAD_SNAPSHOT_SIGNATURE (0UL)
9+
#define FD_GROOVE_TILE_PREFETCH_SIGNATURE (1UL)
10+
11+
/* Tango Messages */
12+
struct fd_msg_groove_replay_load_snapshot_req {
13+
char snapshot_path[PATH_MAX];
14+
char snapshot_dir[PATH_MAX];
15+
int snapshot_src_type;
16+
ulong req_id;
17+
};
18+
typedef struct fd_msg_groove_replay_load_snapshot_req fd_msg_groove_replay_load_snapshot_req_t;
19+
20+
struct fd_msg_groove_prefetch_account_req {
21+
fd_pubkey_t pubkey;
22+
fd_funk_txn_xid_t funk_txn_xid;
23+
ulong req_id;
24+
};
25+
typedef struct fd_msg_groove_prefetch_account_req fd_msg_groove_prefetch_account_req_t;

0 commit comments

Comments
 (0)