Skip to content
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
7 changes: 0 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ jobs:
source /opt/${{ matrix.compiler }}/${{ matrix.compiler }}-${{ matrix.compiler-version }}/activate
make run-test-vectors

- name: run solcap tests
if: ${{ matrix.run-unit-tests && matrix.test-case == 'native' }}
run: |
sudo prlimit --pid $$ --memlock=-1:-1
source /opt/${{ matrix.compiler }}/${{ matrix.compiler }}-${{ matrix.compiler-version }}/activate
DUMP=../dump make run-solcap-tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests ensured that the solcap infra itself works. Let's make sure we keep an integration test


- name: run integration tests
if: ${{ matrix.run-integration-tests }}
run: |
Expand Down
5 changes: 0 additions & 5 deletions config/everything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,6 @@ LLVM_PROFILE_FILE="$(OBJDIR)/cov/raw/test_vectors-%p.profraw" \
LOG_PATH="$(OBJDIR)/log/fd-test-vectors-report" \
contrib/test/run_test_vectors.sh

run-solcap-tests: bin unit-test
OBJDIR=$(OBJDIR) \
MACHINE=$(MACHINE) \
contrib/test/run_solcap_tests.sh

seccomp-policies:
$(FIND) . -name '*.seccomppolicy' -exec $(PYTHON) contrib/codegen/generate_filters.py {} \;

Expand Down
89 changes: 0 additions & 89 deletions contrib/test/run_solcap_tests.sh

This file was deleted.

32 changes: 22 additions & 10 deletions src/app/firedancer-dev/commands/backtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "../../../discof/tower/fd_tower_tile.h"
#include "../../../discof/replay/fd_exec.h"
#include "../../../ballet/lthash/fd_lthash.h"
#include "../../../flamenco/runtime/context/fd_capture_ctx.h"
#include "../../../discof/capture/fd_capture_ctx.h"
#include "../../../disco/pack/fd_pack_cost.h"
#include "../../../flamenco/progcache/fd_progcache_admin.h"

Expand Down Expand Up @@ -102,6 +102,14 @@ backtest_topo( config_t * config ) {
#define FOR(cnt) for( ulong i=0UL; i<cnt; i++ )
FOR(exec_tile_cnt) fd_topob_tile( topo, "exec", "exec", "metric_in", cpu_idx++, 0, 0 );

/**********************************************************************/
/* Add the capture tile to topo */
/**********************************************************************/
if( solcap_enabled ) {
fd_topob_wksp( topo, "captur" );
fd_topob_tile( topo, "captur", "captur", "metric_in", cpu_idx++, 0, 0 );
}

/**********************************************************************/
/* Add the snapshot tiles to topo */
/**********************************************************************/
Expand Down Expand Up @@ -283,15 +291,7 @@ backtest_topo( config_t * config ) {
/**********************************************************************/
fd_topob_wksp( topo, "exec_replay" );

/* If solcap is enabled, we need to overload this link to also send
solcap account updates to the replay tile. We can't use a separate
link for this without introducing a race. This will get removed with solcap V2. */
if( FD_UNLIKELY( solcap_enabled ) ) {
/* TODO: remove this with solcap V2 */
FOR(exec_tile_cnt) fd_topob_link( topo, "exec_replay", "exec_replay", 1024UL, FD_CAPTURE_CTX_ACCOUNT_UPDATE_MSG_FOOTPRINT, 1UL );
} else {
FOR(exec_tile_cnt) fd_topob_link( topo, "exec_replay", "exec_replay", 16384UL, sizeof(fd_exec_task_done_msg_t), 1UL );
}
FOR(exec_tile_cnt) fd_topob_link( topo, "exec_replay", "exec_replay", 16384UL, sizeof(fd_exec_task_done_msg_t), 1UL );

FOR(exec_tile_cnt) fd_topob_tile_out( topo, "exec", i, "exec_replay", i );
FOR(exec_tile_cnt) fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "exec_replay", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
Expand All @@ -300,6 +300,18 @@ backtest_topo( config_t * config ) {
/* Setup the shared objs used by replay and exec tiles */
/**********************************************************************/

if( FD_UNLIKELY( solcap_enabled ) ) {
/* 32 sections of SOLCAP_WRITE_ACCOUNT_DATA_MTU bytes each ≈ 4MB.
This is done to ideally avoid cache thrashing and allow for all
the links to sit on L3 cache. */
fd_topob_link( topo, "cap_repl", "captur", 32UL, SOLCAP_WRITE_ACCOUNT_DATA_MTU, 1UL );
fd_topob_tile_out( topo, "replay", 0UL, "cap_repl", 0UL );
fd_topob_tile_in( topo, "captur", 0UL, "metric_in", "cap_repl", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
FOR(exec_tile_cnt) fd_topob_link( topo, "cap_exec", "captur", 32UL, SOLCAP_WRITE_ACCOUNT_DATA_MTU, 1UL );
FOR(exec_tile_cnt) fd_topob_tile_out( topo, "exec", i, "cap_exec", i );
FOR(exec_tile_cnt) fd_topob_tile_in( topo, "captur", 0UL, "metric_in", "cap_exec", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
}

fd_topob_wksp( topo, "store" );
fd_topo_obj_t * store_obj = setup_topo_store( topo, "store", config->firedancer.store.max_completed_shred_sets, 1 );
fd_topob_tile_uses( topo, backt_tile, store_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
Expand Down
2 changes: 2 additions & 0 deletions src/app/firedancer-dev/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ extern fd_topo_run_tile_t fd_tile_archiver_writer;
extern fd_topo_run_tile_t fd_tile_archiver_playback;
extern fd_topo_run_tile_t fd_tile_shredcap;
extern fd_topo_run_tile_t fd_tile_vinyl;
extern fd_topo_run_tile_t fd_tile_capture;

extern fd_topo_run_tile_t fd_tile_snapct;
extern fd_topo_run_tile_t fd_tile_snapld;
Expand Down Expand Up @@ -172,6 +173,7 @@ fd_topo_run_tile_t * TILES[] = {
&fd_tile_genesi,
&fd_tile_ipecho,
&fd_tile_vinyl,
&fd_tile_capture,
NULL,
};

Expand Down
24 changes: 24 additions & 0 deletions src/app/firedancer/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "../../util/tile/fd_tile_private.h"
#include "../../discof/restore/utils/fd_ssctrl.h"
#include "../../discof/restore/utils/fd_ssmsg.h"
#include "../../flamenco/capture/fd_solcap_writer.h"
#include "../../flamenco/progcache/fd_progcache_admin.h"
#include "../../vinyl/meta/fd_vinyl_meta.h"
#include "../../vinyl/io/fd_vinyl_io.h" /* FD_VINYL_IO_TYPE_* */
Expand Down Expand Up @@ -285,6 +286,8 @@ fd_topo_initialize( config_t * config ) {
topo->max_page_size = fd_cstr_to_shmem_page_sz( config->hugetlbfs.max_page_size );
topo->gigantic_page_threshold = config->hugetlbfs.gigantic_page_threshold_mib << 20;

int solcap_enabled = strlen( config->capture.solcap_capture ) > 0;

/* topo, name */
fd_topob_wksp( topo, "metric" );
fd_topob_wksp( topo, "genesi" );
Expand Down Expand Up @@ -560,6 +563,11 @@ fd_topo_initialize( config_t * config ) {
/**/ fd_topob_tile( topo, "poh", "poh", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 1 );
FOR(sign_tile_cnt) fd_topob_tile( topo, "sign", "sign", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 1 );

if( FD_UNLIKELY( solcap_enabled ) ) {
fd_topob_wksp( topo, "captur" );
fd_topob_tile( topo, "captur", "captur", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
}

/* topo, tile_name, tile_kind_id, fseq_wksp, link_name, link_kind_id, reliable, polled */
FOR(gossvf_tile_cnt) for( ulong j=0UL; j<net_tile_cnt; j++ )
fd_topob_tile_in( topo, "gossvf", i, "metric_in", "net_gossvf", j, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
Expand Down Expand Up @@ -839,6 +847,15 @@ fd_topo_initialize( config_t * config ) {
fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "rpc_replay", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
}

if( FD_UNLIKELY( solcap_enabled ) ) {
fd_topob_link( topo, "cap_repl", "captur", 32UL, SOLCAP_WRITE_ACCOUNT_DATA_MTU, 1UL );
fd_topob_tile_out( topo, "replay", 0UL, "cap_repl", 0UL );
fd_topob_tile_in( topo, "captur", 0UL, "metric_in", "cap_repl", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
FOR(exec_tile_cnt) fd_topob_link( topo, "cap_exec", "captur", 32UL, SOLCAP_WRITE_ACCOUNT_DATA_MTU, 1UL );
FOR(exec_tile_cnt) fd_topob_tile_out( topo, "exec", i, "cap_exec", i );
FOR(exec_tile_cnt) fd_topob_tile_in( topo, "captur", 0UL, "metric_in", "cap_exec", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
}

if( FD_LIKELY( !is_auto_affinity ) ) {
if( FD_UNLIKELY( affinity_tile_cnt<topo->tile_cnt ) )
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. "
Expand Down Expand Up @@ -1395,6 +1412,13 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,

} else if( FD_UNLIKELY( !strcmp( tile->name, "vinyl" ) ) ) {

} else if( FD_UNLIKELY( !strcmp( tile->name, "captur" ) ) ) {

tile->capctx.capture_start_slot = config->capture.capture_start_slot;
strncpy( tile->capctx.solcap_capture, config->capture.solcap_capture, sizeof(tile->capctx.solcap_capture) );
tile->capctx.recent_only = config->capture.recent_only;
tile->capctx.recent_slots_per_file = config->capture.recent_slots_per_file;

tile->vinyl.vinyl_meta_map_obj_id = fd_pod_query_ulong( config->topo.props, "vinyl.meta_map", ULONG_MAX );
tile->vinyl.vinyl_meta_pool_obj_id = fd_pod_query_ulong( config->topo.props, "vinyl.meta_pool", ULONG_MAX );
tile->vinyl.vinyl_line_max = config->firedancer.vinyl.max_cache_entries;
Expand Down
2 changes: 1 addition & 1 deletion src/app/ledger/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "../../flamenco/types/fd_types.h"
#include "../../flamenco/runtime/fd_rocksdb.h"
#include "../../flamenco/runtime/context/fd_capture_ctx.h"
#include "../../discof/capture/fd_capture_ctx.h"
#include <unistd.h>
#include <sys/stat.h>

Expand Down
6 changes: 6 additions & 0 deletions src/app/shared/fd_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ struct fd_configf {
struct {
ulong max_completed_shred_sets;
} store;

struct {
char path[ PATH_MAX ];
} capctx;
};

typedef struct fd_configf fd_configf_t;
Expand Down Expand Up @@ -499,6 +503,8 @@ struct fd_config {
ulong capture_start_slot;
char dump_proto_dir[ PATH_MAX ];
char solcap_capture[ PATH_MAX ];
int recent_only;
ulong recent_slots_per_file;
int dump_elf_to_pb;
int dump_syscall_to_pb;
int dump_instr_to_pb;
Expand Down
2 changes: 2 additions & 0 deletions src/app/shared/fd_config_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ fd_config_extract_pod( uchar * pod,

CFG_POP ( ulong, capture.capture_start_slot );
CFG_POP ( cstr, capture.solcap_capture );
CFG_POP ( bool, capture.recent_only );
CFG_POP ( ulong, capture.recent_slots_per_file );
CFG_POP ( cstr, capture.dump_proto_dir );
CFG_POP ( bool, capture.dump_elf_to_pb );
CFG_POP ( bool, capture.dump_syscall_to_pb );
Expand Down
7 changes: 7 additions & 0 deletions src/disco/topo/fd_topo.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,13 @@ struct fd_topo_tile {
int io_type; /* FD_VINYL_IO_TYPE_* */
uint uring_depth;
} vinyl;

struct {
ulong capture_start_slot;
char solcap_capture[ PATH_MAX ];
int recent_only;
ulong recent_slots_per_file;
} capctx;
};
};

Expand Down
6 changes: 6 additions & 0 deletions src/discof/capture/Local.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ifdef FD_HAS_INT128
ifdef FD_HAS_ALLOCA
$(call add-hdrs,fd_capture_ctx.h)
$(call add-objs,fd_capture_ctx fd_capture_tile,fd_discof)
endif
endif
Loading