Skip to content

Commit c2125ef

Browse files
authored
Merge branch 'main' into cmoyes/elfmismatch
2 parents 55d749b + da6fa25 commit c2125ef

Some content is hidden

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

60 files changed

+4633
-364
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Check Generated Seccomp Files
2+
on:
3+
pull_request:
4+
5+
permissions: {}
6+
7+
jobs:
8+
check-seccomp:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 2
11+
12+
steps:
13+
- name: Checkout current commit
14+
uses: actions/checkout@v5
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Python environment
19+
run: |
20+
python -m venv venv && venv/bin/pip install edn_format
21+
22+
- name: Check generated seccomp files
23+
run: |
24+
set -e
25+
source venv/bin/activate
26+
make seccomp-policies
27+
if [ -n "$(git status --porcelain)" ]; then
28+
echo "Generated seccomp files are out of date. Please run 'make seccomp-policies' and commit the changes."
29+
git --no-pager diff
30+
exit 1
31+
else
32+
echo "All generated seccomp files are up to date."
33+
fi

NOTICE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,3 +545,24 @@ https://github.com/solana-program/token/tree/program%40v8.0.0/p-token
545545
http://www.apache.org/licenses/
546546

547547
=======================================================================
548+
549+
The flatbuffers generated code in src/flamenco/runtime/tests/flatbuffers/
550+
is generated by flatcc.
551+
552+
https://github.com/dvidelabs/flatcc/
553+
554+
Copyright 2015 Mikkel F. Jørgensen, dvide.com
555+
556+
Licensed under the Apache License, Version 2.0 (the "License");
557+
you may not use this file except in compliance with the License.
558+
You may obtain a copy of the License at
559+
560+
http://www.apache.org/licenses/LICENSE-2.0
561+
562+
Unless required by applicable law or agreed to in writing, software
563+
distributed under the License is distributed on an "AS IS" BASIS,
564+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
565+
See the License for the specific language governing permissions and
566+
limitations under the License.
567+
568+
=======================================================================

config/extra/with-arm.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ include config/extra/with-bzip2.mk
3434
include config/extra/with-lz4.mk
3535
include config/extra/with-openssl.mk
3636
include config/extra/with-rocksdb.mk
37+
include config/extra/with-flatcc.mk
3738

3839
endif
3940

config/extra/with-flatcc.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ifneq (,$(wildcard $(OPT)/lib/libflatccrt.a))
2+
FLATCC_LIBS:=$(OPT)/lib/libflatccrt.a
3+
FD_HAS_FLATCC:=1
4+
CPPFLAGS+=-DFD_HAS_FLATCC=1
5+
else
6+
$(info "flatcc not installed, skipping")
7+
endif

config/extra/with-liburing.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ifneq (,$(wildcard $(OPT)/lib/liburing.a))
2+
FD_HAS_LIBURING:=1
3+
CFLAGS+=-DFD_HAS_LIBURING=1
4+
LDFLAGS+=$(OPT)/lib/liburing.a
5+
else
6+
$(warning "liburing not installed, skipping")
7+
endif

config/extra/with-x86-64.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ include config/extra/with-ucontext.mk
1616
include config/extra/with-secp256k1.mk
1717
include config/extra/with-s2nbignum.mk
1818
include config/extra/with-zstd.mk
19+
include config/extra/with-liburing.mk
1920
include config/extra/with-bzip2.mk
2021
include config/extra/with-lz4.mk
2122
include config/extra/with-openssl.mk
2223
include config/extra/with-rocksdb.mk
24+
include config/extra/with-flatcc.mk
2325

2426
FD_ARCH_SUPPORTS_SANDBOX:=1

deps.sh

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ PREFIX="$(pwd)/opt"
3535

3636
DEVMODE=0
3737
MSAN=0
38+
LIBURING=0
3839
_CC="${CC:=gcc}"
3940
_CXX="${CXX:=g++}"
4041
EXTRA_CFLAGS="-g3 -fno-omit-frame-pointer"
@@ -133,15 +134,17 @@ fetch () {
133134
if [[ $MSAN == 1 ]]; then
134135
checkout_llvm
135136
fi
136-
checkout_repo zstd https://github.com/facebook/zstd "v1.5.7"
137-
checkout_repo lz4 https://github.com/lz4/lz4 "v1.10.0"
138-
checkout_repo s2n https://github.com/awslabs/s2n-bignum "" "4d2e22a"
139-
checkout_repo openssl https://github.com/openssl/openssl "openssl-3.6.0"
140-
checkout_repo secp256k1 https://github.com/bitcoin-core/secp256k1 "v0.7.0"
137+
checkout_repo zstd https://github.com/facebook/zstd "v1.5.7"
138+
checkout_repo lz4 https://github.com/lz4/lz4 "v1.10.0"
139+
checkout_repo liburing https://github.com/axboe/liburing "liburing-2.12"
140+
checkout_repo s2n https://github.com/awslabs/s2n-bignum "" "4d2e22a"
141+
checkout_repo openssl https://github.com/openssl/openssl "openssl-3.6.0"
142+
checkout_repo secp256k1 https://github.com/bitcoin-core/secp256k1 "v0.7.0"
143+
checkout_repo flatcc https://github.com/dvidelabs/flatcc.git "" "3ae5eda"
141144
if [[ $DEVMODE == 1 ]]; then
142-
checkout_repo bzip2 https://gitlab.com/bzip2/bzip2 "bzip2-1.0.8"
143-
checkout_repo rocksdb https://github.com/facebook/rocksdb "v10.5.1"
144-
checkout_repo snappy https://github.com/google/snappy "1.2.2"
145+
checkout_repo bzip2 https://gitlab.com/bzip2/bzip2 "bzip2-1.0.8"
146+
checkout_repo rocksdb https://github.com/facebook/rocksdb "v10.5.1"
147+
checkout_repo snappy https://github.com/google/snappy "1.2.2"
145148
fi
146149
}
147150

@@ -438,6 +441,16 @@ install_lz4 () {
438441
echo "[+] Successfully installed lz4"
439442
}
440443

444+
install_liburing () {
445+
cd "$PREFIX/git/liburing"
446+
447+
echo "[+] Installing liburing to $PREFIX"
448+
./configure --prefix="$PREFIX" --cc="$CC -fPIC $EXTRA_CFLAGS"
449+
"${MAKE[@]}"
450+
"${MAKE[@]}" install
451+
echo "[+] Successfully installed liburing"
452+
}
453+
441454
install_s2n () {
442455
cd "$PREFIX/git/s2n"
443456

@@ -610,6 +623,21 @@ install_snappy () {
610623
echo "[+] Successfully installed snappy"
611624
}
612625

626+
install_flatcc () {
627+
echo "[+] Installing flatcc"
628+
cd "$PREFIX/git/flatcc"
629+
cmake -B build \
630+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
631+
-DCMAKE_BUILD_TYPE=Release \
632+
-DFLATCC_INSTALL=ON \
633+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
634+
-DCMAKE_CXX_FLAGS="$EXTRA_CXXFLAGS" \
635+
-DCMAKE_EXE_LINKER_FLAGS="$EXTRA_LDFLAGS"
636+
cmake --build build -j
637+
cmake --install build
638+
echo "[+] Successfully installed flatcc"
639+
}
640+
613641
install () {
614642
CC="$(command -v $_CC)"
615643
cc="$CC"
@@ -629,6 +657,11 @@ install () {
629657
fi
630658
( install_zstd )
631659
( install_lz4 )
660+
if [[ $LIBURING == 1 ]]; then
661+
if [[ "$OS" == "Linux" ]]; then
662+
( install_liburing )
663+
fi
664+
fi
632665
if [[ "$(uname -m)" == x86_64 ]]; then
633666
( install_s2n )
634667
fi
@@ -638,6 +671,7 @@ install () {
638671
( install_bzip2 )
639672
( install_snappy )
640673
( install_rocksdb )
674+
( install_flatcc )
641675
fi
642676

643677
# Merge lib64 with lib
@@ -673,6 +707,10 @@ while [[ $# -gt 0 ]]; do
673707
shift
674708
DEVMODE=1
675709
;;
710+
"+uring")
711+
shift
712+
LIBURING=1
713+
;;
676714
nuke)
677715
shift
678716
nuke

src/app/firedancer-dev/commands/snapshot_load.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,6 @@ snapshot_load_topo( config_t * config,
215215

216216
fd_topob_wksp( topo, "vinyl_exec" );
217217
fd_topo_tile_t * vinyl_tile = fd_topob_tile( topo, "vinyl", "vinyl_exec", "metric_in", ULONG_MAX, 0, 0 );
218-
vinyl_tile->vinyl.vinyl_meta_map_obj_id = fd_pod_query_ulong( topo->props, "vinyl.meta_map", ULONG_MAX );
219-
vinyl_tile->vinyl.vinyl_meta_pool_obj_id = fd_pod_query_ulong( topo->props, "vinyl.meta_pool", ULONG_MAX );
220-
vinyl_tile->vinyl.vinyl_line_max = config->firedancer.vinyl.max_cache_entries;
221-
vinyl_tile->vinyl.vinyl_cnc_obj_id = vinyl_cnc->id;
222-
vinyl_tile->vinyl.vinyl_data_obj_id = vinyl_data->id;
223-
fd_cstr_ncpy( vinyl_tile->vinyl.vinyl_bstream_path, config->paths.accounts, sizeof(vinyl_tile->vinyl.vinyl_bstream_path) );
224218

225219
fd_topob_tile_uses( topo, vinyl_tile, vinyl_cnc, FD_SHMEM_JOIN_MODE_READ_WRITE );
226220
fd_topob_tile_uses( topo, vinyl_tile, vinyl_data, FD_SHMEM_JOIN_MODE_READ_WRITE );
@@ -583,6 +577,11 @@ fixup_config( config_t * config,
583577

584578
config->firedancer.funk.heap_size_gib = 0;
585579
config->firedancer.funk.max_account_records = 0;
580+
581+
char const * io_mode = args->snapshot_load.vinyl_io;
582+
if( 0==strcmp( io_mode, "ur" ) ) config->firedancer.vinyl.io_uring.enabled = 1;
583+
else if( 0==strcmp( io_mode, "bd" ) ) {}
584+
else FD_LOG_ERR(( "unsupported --vinyl-io '%s' (valid options are 'bd' and 'ur')", io_mode ));
586585
}
587586

588587
if( args->snapshot_load.offline ) {
@@ -851,15 +850,15 @@ snapshot_load_cmd_fn( args_t * args,
851850
/* Wait for vinyl tile to boot */
852851
fd_cnc_t * cnc = fd_cnc_join( fd_topo_obj_laddr( topo, fd_pod_query_ulong( topo->props, "vinyl.cnc", ULONG_MAX ) ) );
853852
FD_TEST( cnc );
854-
ulong vinyl_status = fd_cnc_wait( cnc, FD_CNC_SIGNAL_BOOT, LONG_MAX, NULL );
855-
FD_TEST( vinyl_status==FD_CNC_SIGNAL_RUN );
853+
ulong vinyl_status = fd_cnc_wait( cnc, FD_VINYL_CNC_SIGNAL_BOOT, LONG_MAX, NULL );
854+
FD_TEST( vinyl_status==FD_VINYL_CNC_SIGNAL_RUN );
856855
FD_LOG_NOTICE(( "Vinyl server running" ));
857856
for(;;) {
858857
vinyl_status = fd_cnc_wait( cnc, vinyl_status, LONG_MAX, NULL );
859858
char cnc_signal_cstr[ FD_VINYL_CNC_SIGNAL_CSTR_BUF_MAX ];
860859
fd_vinyl_cnc_signal_cstr( vinyl_status, cnc_signal_cstr );
861860
FD_LOG_NOTICE(( "Vinyl CNC signal %s", cnc_signal_cstr ));
862-
if( vinyl_status==FD_CNC_SIGNAL_BOOT ) break;
861+
//if( vinyl_status==FD_VINYL_CNC_SIGNAL_BOOT ) break;
863862
}
864863
FD_LOG_NOTICE(( "Vinyl server shut down" ));
865864
fd_cnc_leave( cnc );

src/app/firedancer/config/default.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,9 @@ user = ""
504504
file_size_gib = 16
505505
max_cache_entries = 1_000_000
506506
cache_size_gib = 2
507+
[vinyl.io_uring]
508+
enabled = false
509+
queue_depth = 2048
507510

508511
[runtime]
509512
# TODO: This is not respected, the max vote accounts seems to be

src/app/firedancer/topology.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "../../discof/restore/utils/fd_ssmsg.h"
2525
#include "../../flamenco/progcache/fd_progcache_admin.h"
2626
#include "../../vinyl/meta/fd_vinyl_meta.h"
27+
#include "../../vinyl/io/fd_vinyl_io.h" /* FD_VINYL_IO_TYPE_* */
2728

2829
#include <sys/random.h>
2930
#include <sys/types.h>
@@ -673,11 +674,7 @@ fd_topo_initialize( config_t * config ) {
673674
674675
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "dedup_resolv", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
675676
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "replay_exec", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
676-
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "genesi_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
677677
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "replay_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
678-
if( snapshots_enabled ) {
679-
fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "snapin_manif", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
680-
}
681678
/**/ fd_topob_tile_out( topo, "tower", 0UL, "tower_out", 0UL );
682679
683680
/**/ fd_topob_tile_in ( topo, "send", 0UL, "metric_in", "replay_stake", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
@@ -879,12 +876,14 @@ fd_topo_initialize( config_t * config ) {
879876
config->firedancer.funk.max_database_transactions,
880877
config->firedancer.funk.heap_size_gib );
881878
/**/ fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "replay", 0UL ) ], funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE ); /* TODO: Should be readonly? */
879+
/**/ fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "tower", 0UL ) ], funk_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
882880
FOR(exec_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "exec", i ) ], funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
883881
FOR(bank_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "bank", i ) ], funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
884882
FOR(resolv_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "resolv", i ) ], funk_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
885883

886884
fd_topo_obj_t * banks_obj = setup_topo_banks( topo, "banks", config->firedancer.runtime.max_live_slots, config->firedancer.runtime.max_fork_width, config->development.bench.larger_max_cost_per_block );
887885
/**/ fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "replay", 0UL ) ], banks_obj, FD_SHMEM_JOIN_MODE_READ_WRITE ); /* TODO: Should be readonly? */
886+
/**/ fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "tower", 0UL ) ], banks_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
888887
FOR(exec_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "exec", i ) ], banks_obj, FD_SHMEM_JOIN_MODE_READ_WRITE ); /* TODO: Should be readonly? */
889888
FOR(bank_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "bank", i ) ], banks_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
890889
FOR(resolv_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "resolv", i ) ], banks_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
@@ -1404,6 +1403,17 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,
14041403

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

1406+
tile->vinyl.vinyl_meta_map_obj_id = fd_pod_query_ulong( config->topo.props, "vinyl.meta_map", ULONG_MAX );
1407+
tile->vinyl.vinyl_meta_pool_obj_id = fd_pod_query_ulong( config->topo.props, "vinyl.meta_pool", ULONG_MAX );
1408+
tile->vinyl.vinyl_line_max = config->firedancer.vinyl.max_cache_entries;
1409+
tile->vinyl.vinyl_cnc_obj_id = fd_pod_query_ulong( config->topo.props, "vinyl.cnc", ULONG_MAX );
1410+
tile->vinyl.vinyl_data_obj_id = fd_pod_query_ulong( config->topo.props, "vinyl.data", ULONG_MAX );
1411+
fd_cstr_ncpy( tile->vinyl.vinyl_bstream_path, config->paths.accounts, sizeof(tile->vinyl.vinyl_bstream_path) );
1412+
1413+
tile->vinyl.io_type = config->firedancer.vinyl.io_uring.enabled ?
1414+
FD_VINYL_IO_TYPE_UR : FD_VINYL_IO_TYPE_BD;
1415+
tile->vinyl.uring_depth = config->firedancer.vinyl.io_uring.queue_depth;
1416+
14071417
} else {
14081418
FD_LOG_ERR(( "unknown tile name `%s`", tile->name ));
14091419
}

0 commit comments

Comments
 (0)