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
2 changes: 0 additions & 2 deletions src/app/fdctl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ add_bench_topo( fd_topo_t * topo,
uint send_to_ip_addr,
ushort rpc_port,
uint rpc_ip_addr,
int no_quic,
int reserve_agave_cores ) {
(void)topo;
(void)affinity;
Expand All @@ -164,6 +163,5 @@ add_bench_topo( fd_topo_t * topo,
(void)send_to_ip_addr;
(void)rpc_port;
(void)rpc_ip_addr;
(void)no_quic;
(void)reserve_agave_cores;
}
4 changes: 3 additions & 1 deletion src/app/fddev/commands/bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ agave_thread_main( void * _args ) {
void
fddev_bench_cmd_fn( args_t * args,
config_t * config ) {
bench_cmd_fn( args, config, 0 );
args->load.no_watch = 1;
bench_cmd_fn( args, config );

pthread_t agave;
pthread_create( &agave, NULL, agave_thread_main, (void *)config );
Expand All @@ -32,6 +33,7 @@ fddev_bench_cmd_fn( args_t * args,
action_t fd_action_bench = {
.name = "bench",
.args = bench_cmd_args,
.topo = bench_topo,
.fn = fddev_bench_cmd_fn,
.perm = dev_cmd_perm,
.is_local_cluster = 1,
Expand Down
10 changes: 2 additions & 8 deletions src/app/firedancer-dev/commands/bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@

#include <unistd.h>

static void
bench_cmd_topo( config_t * config ) {
config->development.sandbox = 0;
config->development.no_clone = 1;
}

void
firedancer_dev_bench_cmd_fn( args_t * args,
config_t * config ) {
bench_cmd_fn( args, config, 1 );
bench_cmd_fn( args, config );

/* Sleep parent thread forever, Ctrl+C will terminate. */
for(;;) pause();
Expand All @@ -21,9 +15,9 @@ firedancer_dev_bench_cmd_fn( args_t * args,
action_t fd_action_bench = {
.name = "bench",
.args = bench_cmd_args,
.topo = bench_topo,
.fn = firedancer_dev_bench_cmd_fn,
.perm = dev_cmd_perm,
.topo = bench_cmd_topo,
.is_local_cluster = 1,
.description = "Test validator TPS benchmark"
};
2 changes: 0 additions & 2 deletions src/app/firedancer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ add_bench_topo( fd_topo_t * topo,
uint send_to_ip_addr,
ushort rpc_port,
uint rpc_ip_addr,
int no_quic,
int reserve_agave_cores ) {
(void)topo;
(void)affinity;
Expand All @@ -255,6 +254,5 @@ add_bench_topo( fd_topo_t * topo,
(void)send_to_ip_addr;
(void)rpc_port;
(void)rpc_ip_addr;
(void)no_quic;
(void)reserve_agave_cores;
}
1 change: 0 additions & 1 deletion src/app/shared/commands/monitor/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@ monitor_cmd_fn( args_t * args,
0U,
0,
0U,
1,
!config->is_firedancer );
}

Expand Down
1 change: 1 addition & 0 deletions src/app/shared/fd_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ union fdctl_args {
ulong benchg;
ulong benchs;
int no_quic;
int no_watch;
int transaction_mode;
float contending_fraction;
float cu_price_spread;
Expand Down
40 changes: 28 additions & 12 deletions src/app/shared_dev/commands/bench/bench.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define _GNU_SOURCE
#include "bench.h"
#include "../../../shared/commands/configure/configure.h"
#include "../../../shared/commands/run/run.h"

Expand Down Expand Up @@ -32,7 +33,8 @@ void
bench_cmd_args( int * pargc,
char *** pargv,
args_t * args ) {
args->load.no_quic = fd_env_strip_cmdline_contains( pargc, pargv, "--no-quic" );
args->load.no_quic = fd_env_strip_cmdline_contains( pargc, pargv, "--no-quic" );
args->load.no_watch = fd_env_strip_cmdline_contains( pargc, pargv, "--no-watch" );
}

void
Expand All @@ -49,7 +51,6 @@ add_bench_topo( fd_topo_t * topo,
uint send_to_ip_addr,
ushort rpc_port,
uint rpc_ip_addr,
int no_quic,
int reserve_agave_cores ) {

fd_topob_wksp( topo, "bench" );
Expand Down Expand Up @@ -101,7 +102,6 @@ add_bench_topo( fd_topo_t * topo,
benchs->benchs.send_to_ip_addr = send_to_ip_addr;
benchs->benchs.send_to_port = send_to_port;
benchs->benchs.conn_cnt = conn_cnt;
benchs->benchs.no_quic = no_quic;
}

fd_topob_tile_out( topo, "bencho", 0UL, "bencho_out", 0UL );
Expand All @@ -123,13 +123,11 @@ add_bench_topo( fd_topo_t * topo,
extern int * fd_log_private_shared_lock;

void
bench_cmd_fn( args_t * args,
config_t * config,
int watch ) {
fd_topo_initialize( config_t * config );

ushort dest_port = fd_ushort_if( args->load.no_quic,
config->tiles.quic.regular_transaction_listen_port,
config->tiles.quic.quic_transaction_listen_port );
void
bench_topo( config_t * config ) {
fd_topo_initialize( config );
Comment on lines 125 to +130
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The fd_ushort_if call in the new bench_topo function has redundant arguments - both the condition c and the true-branch value t are config->frankendancer.rpc.port, making the expression equivalent to config->frankendancer.rpc.port ? config->frankendancer.rpc.port : 8899. This could be written more clearly as a simple conditional assignment: if( !config->frankendancer.rpc.port ) config->frankendancer.rpc.port = 8899;. The intent is to set a default port of 8899 when none is configured.

Copilot uses AI. Check for mistakes.

ushort rpc_port;
uint rpc_ip_addr;
Expand Down Expand Up @@ -166,12 +164,26 @@ bench_cmd_fn( args_t * args,
config->development.genesis.fund_initial_accounts,
0, 0.0f, 0.0f,
config->layout.quic_tile_count,
dest_port,
config->tiles.quic.quic_transaction_listen_port,
config->net.ip_addr,
rpc_port,
rpc_ip_addr,
args->load.no_quic,
!config->is_firedancer );
}

void
bench_cmd_fn( args_t * args,
config_t * config ) {

if( args->load.no_quic ) {
ushort port = config->tiles.quic.regular_transaction_listen_port;
ulong benchs_tile_cnt = fd_topo_tile_name_cnt( &config->topo, "benchs" );
for( ulong i=0UL; i<benchs_tile_cnt; i++ ) {
fd_topo_tile_t * benchs = &config->topo.tiles[ fd_topo_find_tile( &config->topo, "benchs", i ) ];
benchs->benchs.no_quic = 1;
benchs->benchs.send_to_port = port;
}
}

args_t configure_args = {
.configure.command = CONFIGURE_CMD_INIT,
Expand All @@ -192,7 +204,11 @@ bench_cmd_fn( args_t * args,
fd_log_private_shared_lock[ 1 ] = 0;
fd_topo_join_workspaces( &config->topo, FD_SHMEM_JOIN_MODE_READ_WRITE, FD_TOPO_CORE_DUMP_LEVEL_DISABLED );

if( watch ) {
if( !args->load.no_watch ) {
/* watch incompatible with sandbox */
config->development.sandbox = 0;
config->development.no_clone = 1;

int pipefd[2];
if( FD_UNLIKELY( pipe2( pipefd, O_NONBLOCK ) ) ) FD_LOG_ERR(( "pipe2() failed (%i-%s)", errno, fd_io_strerror( errno ) ));

Expand Down
4 changes: 2 additions & 2 deletions src/app/shared_dev/commands/bench/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

FD_PROTOTYPES_BEGIN

void bench_cmd_fn( args_t * args, config_t * config, int watch );
void bench_topo( config_t * config );
void bench_cmd_fn( args_t * args, config_t * config );
void bench_cmd_args( int * pargc, char *** pargv, args_t * args );

void
Expand All @@ -23,7 +24,6 @@ add_bench_topo( fd_topo_t * topo,
uint send_to_ip_addr,
ushort rpc_port,
uint rpc_ip_addr,
int no_quic,
int reserve_agave_cores );

FD_PROTOTYPES_END
Expand Down
4 changes: 3 additions & 1 deletion src/app/shared_dev/commands/bench/fd_bencho.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ service_block_hash( fd_bencho_ctx_t * ctx,
return did_work;
}

if( FD_UNLIKELY( fd_log_wallclock()<ctx->rpc_ready_deadline && response->status==FD_RPC_CLIENT_ERR_NETWORK ) ) {
if( FD_UNLIKELY( fd_log_wallclock()<ctx->rpc_ready_deadline &&
( response->status==FD_RPC_CLIENT_ERR_NETWORK ||
response->status==FD_RPC_CLIENT_ERR_MALFORMED ) ) ) {
/* RPC server not yet responding, give it some more time... */
ctx->blockhash_state = FD_BENCHO_STATE_WAIT;
ctx->blockhash_deadline = fd_log_wallclock() + 100L * 1000L * 1000L; /* 100 millis to retry */
Expand Down
1 change: 0 additions & 1 deletion src/app/shared_dev/commands/load.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ load_cmd_fn( args_t * args,
args->load.tpu_ip,
args->load.rpc_port,
args->load.rpc_ip,
args->load.no_quic,
0 );
config->topo = *topo;

Expand Down
Loading