Skip to content

Commit d1ee563

Browse files
flamenco, groove: initial Funk/Groove wiring
1 parent 9c0bbf1 commit d1ee563

Some content is hidden

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

55 files changed

+2063
-410
lines changed

src/app/firedancer-dev/Local.mk

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@
2222
repair_intake_listen_port = 9294
2323
repair_serve_listen_port = 8034
2424
[tiles.replay]
25-
snapshot_url = "http://{validator_ip}:8899/snapshot.tar.bz2"
26-
incremental_url = "http://{validator_ip}:8899/incremental-snapshot.tar.bz2"
25+
snapshot_url = "{snapshot_endpoint}/snapshot.tar.bz2"
26+
incremental_url = "{snapshot_endpoint}/incremental-snapshot.tar.bz2"
2727
funk_sz_gb = 140
2828
funk_rec_max = 150000000
2929
funk_txn_max = 2000
30+
snapshot_http_header = "{snapshot_http_header}"
3031
funk_file = "{funk_path}"
32+
[tiles.groove]
33+
cold_store_dir = "{ledger_dir}/cold_store"
3134
[tiles.metric]
3235
prometheus_listen_address = "0.0.0.0"
3336
prometheus_listen_port = 7999

src/app/firedancer-dev/main.c

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ setup_snapshots( config_t * config,
187187
if( FD_LIKELY( snapshot_is_url ) ) {
188188
strncpy( tile->replay.snapshot, config->tiles.replay.snapshot_url, sizeof(tile->replay.snapshot) );
189189
tile->replay.snapshot_src_type = FD_SNAPSHOT_SRC_HTTP;
190+
strncpy( tile->replay.snapshot_http_header, config->tiles.replay.snapshot_http_header, sizeof(tile->replay.snapshot_http_header) );
190191
}
191192
if( FD_UNLIKELY( snapshot_is_file ) ) {
192193
strncpy( tile->replay.snapshot, config->tiles.replay.snapshot, sizeof(tile->replay.snapshot) );
@@ -247,6 +248,7 @@ fd_topo_initialize( config_t * config ) {
247248

248249
fd_topob_wksp( topo, "replay_exec" );
249250
fd_topob_wksp( topo, "replay_wtr" );
251+
fd_topob_wksp( topo, "replay_grv" );
250252
fd_topob_wksp( topo, "exec_writer" );
251253

252254
fd_topob_wksp( topo, "voter_sign" );
@@ -297,6 +299,7 @@ fd_topo_initialize( config_t * config ) {
297299
fd_topob_wksp( topo, "runtime_pub" );
298300
fd_topob_wksp( topo, "exec" );
299301
fd_topob_wksp( topo, "writer" );
302+
fd_topob_wksp( topo, "groove" );
300303
fd_topob_wksp( topo, "bstore" );
301304
fd_topob_wksp( topo, "tcache" );
302305
fd_topob_wksp( topo, "poh" );
@@ -310,6 +313,7 @@ fd_topo_initialize( config_t * config ) {
310313
fd_topob_wksp( topo, "exec_spad" );
311314
fd_topob_wksp( topo, "exec_fseq" );
312315
fd_topob_wksp( topo, "writer_fseq" );
316+
fd_topob_wksp( topo, "groove_fseq" );
313317

314318
if( enable_rpc ) fd_topob_wksp( topo, "rpcsrv" );
315319

@@ -341,6 +345,7 @@ fd_topo_initialize( config_t * config ) {
341345
message that is outbound from the replay to exec. */
342346
FOR(exec_tile_cnt) fd_topob_link( topo, "replay_exec", "replay_exec", 128UL, 10240UL, exec_tile_cnt );
343347
FOR(writer_tile_cnt) fd_topob_link( topo, "replay_wtr", "replay_wtr", 128UL, FD_REPLAY_WRITER_MTU, 1UL );
348+
/**/ fd_topob_link( topo, "replay_grv", "replay_grv", 128UL, FD_REPLAY_GROOVE_MTU, 1UL );
344349
/* Assuming the number of writer tiles is sufficient to keep up with
345350
the number of exec tiles, under equilibrium, we should have at least
346351
enough link space to buffer worst case input shuffling done by the
@@ -448,6 +453,7 @@ fd_topo_initialize( config_t * config ) {
448453
FOR(exec_tile_cnt) fd_topob_tile( topo, "exec", "exec", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
449454
FOR(writer_tile_cnt) fd_topob_tile( topo, "writer", "writer", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
450455
fd_topo_tile_t * batch_tile = fd_topob_tile( topo, "batch", "batch", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
456+
fd_topo_tile_t * groove_tile = fd_topob_tile( topo, "groove", "groove", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
451457

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

@@ -562,6 +568,12 @@ fd_topo_initialize( config_t * config ) {
562568
fd_topob_tile_uses( topo, batch_tile, constipated_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
563569
FD_TEST( fd_pod_insertf_ulong( topo->props, constipated_obj->id, "constipate" ) );
564570

571+
/* This fseq communicates the progress Groove is making to the Replay tile */
572+
fd_topo_obj_t * groove_fseq_obj = fd_topob_obj( topo, "fseq", "groove_fseq" );
573+
fd_topob_tile_uses( topo, groove_tile, groove_fseq_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
574+
fd_topob_tile_uses( topo, replay_tile, groove_fseq_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
575+
FD_TEST( fd_pod_insertf_ulong( topo->props, groove_fseq_obj->id, "groove_fseq" ) );
576+
565577
if( FD_LIKELY( !is_auto_affinity ) ) {
566578
if( FD_UNLIKELY( affinity_tile_cnt<topo->tile_cnt ) )
567579
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 +676,7 @@ fd_topo_initialize( config_t * config ) {
664676
FOR(bank_tile_cnt) fd_topob_tile_out( topo, "replay", 0UL, "replay_poh", i );
665677
FOR(exec_tile_cnt) fd_topob_tile_out( topo, "replay", 0UL, "replay_exec", i ); /* TODO check order in fd_replay.c macros*/
666678
FOR(writer_tile_cnt) fd_topob_tile_out( topo, "replay", 0UL, "replay_wtr", i );
679+
/**/ fd_topob_tile_out( topo, "replay", 0UL, "replay_grv", 0UL );
667680

668681
FOR(exec_tile_cnt) fd_topob_tile_in( topo, "exec", i, "metric_in", "replay_exec", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
669682
FOR(exec_tile_cnt) fd_topob_tile_out( topo, "exec", i, "exec_writer", i );
@@ -672,6 +685,7 @@ fd_topo_initialize( config_t * config ) {
672685
FOR(writer_tile_cnt) for( ulong j=0UL; j<exec_tile_cnt; j++ )
673686
fd_topob_tile_in( topo, "writer", i, "metric_in", "exec_writer", j, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
674687
FOR(writer_tile_cnt) fd_topob_tile_in( topo, "writer", i, "metric_in", "replay_wtr", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
688+
/**/ fd_topob_tile_in( topo, "groove", 0UL, "metric_in", "replay_grv", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
675689
676690
/**/ 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 */
677691
/**/ 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 +968,9 @@ fd_topo_initialize( config_t * config ) {
954968
strncpy( tile->exec.funk_file, config->tiles.replay.funk_file, sizeof(tile->exec.funk_file) );
955969
} else if( FD_UNLIKELY( !strcmp( tile->name, "writer" ) ) ) {
956970
strncpy( tile->writer.funk_file, config->tiles.replay.funk_file, sizeof(tile->writer.funk_file) );
971+
} else if( FD_UNLIKELY( !strcmp( tile->name, "groove" ) ) ) {
972+
strncpy( tile->groove.funk_file, config->tiles.replay.funk_file, sizeof(tile->groove.funk_file) );
973+
strncpy( tile->groove.cold_store_dir, config->tiles.groove.cold_store_dir, sizeof(tile->groove.cold_store_dir) );
957974
} else if( FD_UNLIKELY( !strcmp( tile->name, "rstart" ) ) ) {
958975
strncpy( tile->restart.funk_file, config->tiles.replay.funk_file, sizeof(tile->replay.funk_file) );
959976
strncpy( tile->restart.tower_checkpt, config->tiles.replay.tower_checkpt, sizeof(tile->replay.tower_checkpt) );

src/app/ledger/Local.mk

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,9 +1125,8 @@ 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,
1130-
args->runtime_spad );
1128+
args->runtime_spad,
1129+
NULL );
11311130
FD_LOG_NOTICE(( "imported records from snapshot" ));
11321131
}
11331132
if( args->incremental ) {
@@ -1140,9 +1139,8 @@ ingest( fd_ledger_args_t * args ) {
11401139
args->verify_acc_hash,
11411140
args->check_acc_hash,
11421141
FD_SNAPSHOT_TYPE_INCREMENTAL,
1143-
args->exec_spads,
1144-
args->exec_spad_cnt,
1145-
args->runtime_spad );
1142+
args->runtime_spad,
1143+
NULL );
11461144
FD_LOG_NOTICE(( "imported records from incremental snapshot" ));
11471145
}
11481146

@@ -1316,9 +1314,8 @@ replay( fd_ledger_args_t * args ) {
13161314
args->verify_acc_hash,
13171315
args->check_acc_hash,
13181316
FD_SNAPSHOT_TYPE_FULL,
1319-
args->exec_spads,
1320-
args->exec_spad_cnt,
1321-
args->runtime_spad );
1317+
args->runtime_spad,
1318+
NULL );
13221319
FD_LOG_NOTICE(( "imported from snapshot" ));
13231320
if( args->incremental ) {
13241321
fd_snapshot_load_all( args->incremental,
@@ -1330,9 +1327,8 @@ replay( fd_ledger_args_t * args ) {
13301327
args->verify_acc_hash,
13311328
args->check_acc_hash,
13321329
FD_SNAPSHOT_TYPE_INCREMENTAL,
1333-
args->exec_spads,
1334-
args->exec_spad_cnt,
1335-
args->runtime_spad );
1330+
args->runtime_spad,
1331+
NULL );
13361332
FD_LOG_NOTICE(( "imported from snapshot" ));
13371333
}
13381334
}

src/app/rpcserver/Local.mk

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ struct fd_config {
376376
char snapshot[ PATH_MAX ];
377377
char snapshot_url[ PATH_MAX ];
378378
char snapshot_dir[ PATH_MAX ];
379+
char snapshot_http_header[ PATH_MAX ];
379380
char status_cache[ PATH_MAX ];
380381
char cluster_version[ 32 ];
381382
char tower_checkpt[ PATH_MAX ];
@@ -408,6 +409,10 @@ struct fd_config {
408409
char archiver_path[ PATH_MAX ];
409410
} archiver;
410411

412+
struct {
413+
char cold_store_dir[ PATH_MAX ];
414+
} groove;
415+
411416
} tiles;
412417
};
413418

src/app/shared/fd_config_parse.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ fd_config_extract_pod( uchar * pod,
453453
CFG_POP ( cstr, tiles.replay.snapshot );
454454
CFG_POP ( cstr, tiles.replay.snapshot_url );
455455
CFG_POP ( cstr, tiles.replay.snapshot_dir );
456+
CFG_POP ( cstr, tiles.replay.snapshot_http_header );
456457
CFG_POP ( cstr, tiles.replay.status_cache );
457458
CFG_POP ( cstr, tiles.replay.cluster_version );
458459
CFG_POP ( cstr, tiles.replay.tower_checkpt );
@@ -475,6 +476,8 @@ fd_config_extract_pod( uchar * pod,
475476
CFG_POP ( ulong, tiles.archiver.end_slot );
476477
CFG_POP ( cstr, tiles.archiver.archiver_path );
477478

479+
CFG_POP ( cstr, tiles.groove.cold_store_dir );
480+
478481
CFG_POP ( bool, development.sandbox );
479482
CFG_POP ( bool, development.no_clone );
480483
CFG_POP ( bool, development.core_dump );

src/disco/fd_disco_base.h

Lines changed: 2 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ typedef struct {
283283
char slots_replayed[ PATH_MAX ];
284284
char snapshot[ PATH_MAX ];
285285
char snapshot_dir[ PATH_MAX ];
286+
char snapshot_http_header[ PATH_MAX ];
286287
char status_cache[ PATH_MAX ];
287288
char cluster_version[ 32 ];
288289
char tower_checkpt[ PATH_MAX ];
@@ -435,6 +436,11 @@ typedef struct {
435436
int archive_fd;
436437
} archiver;
437438

439+
struct {
440+
char funk_file[ PATH_MAX ];
441+
char cold_store_dir[ PATH_MAX ];
442+
} groove;
443+
438444
};
439445
} fd_topo_tile_t;
440446

src/disco/topo/fd_topob.c

Lines changed: 1 addition & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
char snapshot_http_header[PATH_MAX];
17+
ulong req_id;
18+
};
19+
typedef struct fd_msg_groove_replay_load_snapshot_req fd_msg_groove_replay_load_snapshot_req_t;
20+
21+
struct fd_msg_groove_prefetch_account_req {
22+
fd_pubkey_t pubkey;
23+
fd_funk_txn_xid_t funk_txn_xid;
24+
ulong req_id;
25+
};
26+
typedef struct fd_msg_groove_prefetch_account_req fd_msg_groove_prefetch_account_req_t;

0 commit comments

Comments
 (0)