Skip to content

Commit

Permalink
topo: add multi topology support (#1627)
Browse files Browse the repository at this point in the history
* topo: add multi topology support

* build: fix includes and target config

* config: move topology argument

---------

Co-authored-by: Liam Heeger <[email protected]>
  • Loading branch information
2 people authored and mmcgee-jump committed Apr 25, 2024
1 parent 800f8ba commit ec2b9a5
Show file tree
Hide file tree
Showing 8 changed files with 332 additions and 279 deletions.
5 changes: 4 additions & 1 deletion src/app/fdctl/Local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $(info Using FIREDANCER_VERSION=$(FIREDANCER_VERSION_MAJOR).$(FIREDANCER_VERSION

# fdctl core
$(call add-objs,main1 config caps utility keys ready mem spy help,fd_fdctl)
$(call add-objs,run/run run/run1 run/run_solana,fd_fdctl)
$(call add-objs,run/run run/run1 run/run_solana run/topos/topos,fd_fdctl)
$(call add-objs,monitor/monitor monitor/helper,fd_fdctl)

# fdctl tiles
Expand All @@ -28,6 +28,9 @@ $(call add-objs,run/tiles/fd_shred,fd_fdctl)
$(call add-objs,run/tiles/fd_store,fd_fdctl)
$(call add-objs,run/tiles/fd_sign,fd_fdctl)

# fdctl topologies
$(call add-objs,run/topos/fd_frankendancer,fd_fdctl)

# fdctl configure stages
$(call add-objs,configure/configure,fd_fdctl)
$(call add-objs,configure/hugetlbfs,fd_fdctl)
Expand Down
283 changes: 5 additions & 278 deletions src/app/fdctl/config.c

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/app/fdctl/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ typedef struct {
int no_solana_labs;
int bootstrap;
uint debug_tile;
char topology[ 32 ];

struct {
int enabled;
Expand Down
7 changes: 7 additions & 0 deletions src/app/fdctl/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,13 @@ dynamic_port_range = "8900-9000"
# if [gossip.entrypoints] is non-empty.
bootstrap = false

# The current topology type that will be set up and run. Currently the
# supported topology types are:
# - "frankendancer" The Frankendancer topology for running the
# mixed client with Firedancer networking
# and Solana runtime.
topology = "frankendancer"

# It can be convenient during development to use a network namespace
# for running Firedancer. This allows us to send packets at a local
# Firedancer instance and have them go through more of the kernel
Expand Down
1 change: 1 addition & 0 deletions src/app/fdctl/run/run.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "../fdctl.h"
#include "tiles/tiles.h"
#include "topos/topos.h"

#include "../../../waltz/xdp/fd_xsk.h"

Expand Down
290 changes: 290 additions & 0 deletions src/app/fdctl/run/topos/fd_frankendancer.c

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/app/fdctl/run/topos/topos.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "topos.h"

#define FD_TOPO_KIND_CSTR_LEN_MAX (32UL)

FD_FN_CONST fd_topo_config_fn *
fd_topo_kind_str_to_topo_config_fn( char const * topo_kind_str ) {
if( strncmp( topo_kind_str, "frankendancer", FD_TOPO_KIND_CSTR_LEN_MAX )==0 ) { return &fd_topo_frankendancer; }
else {
FD_LOG_ERR(( "unknown topo kind %s", topo_kind_str ));
}
}
13 changes: 13 additions & 0 deletions src/app/fdctl/run/topos/topos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef HEADER_fd_src_app_fdctl_run_topos_h
#define HEADER_fd_src_app_fdctl_run_topos_h

#include "../../config.h"

typedef void (fd_topo_config_fn)( config_t * config );

extern fd_topo_config_fn fd_topo_frankendancer;

FD_FN_CONST fd_topo_config_fn *
fd_topo_kind_str_to_topo_config_fn( char const * topo_kind_str );

#endif /* HEADER_fd_src_app_fdctl_run_topos_h */

0 comments on commit ec2b9a5

Please sign in to comment.