Skip to content

Commit c7533a3

Browse files
committed
Merge remote-tracking branch 'origin/main' into asiegel/rpc-resurrect
2 parents ff44f30 + ea39afe commit c7533a3

File tree

121 files changed

+4271
-2525
lines changed

Some content is hidden

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

121 files changed

+4271
-2525
lines changed

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/src/choreo @lidatong @emwang-jump
77
/src/disco/pack @ptaffet-jump @mmcgee-jump
88
/src/disco/shred @ptaffet-jump @mmcgee-jump
9+
/src/disco/reasm @lidatong @emwang-jump
10+
/src/disco/store @lidatong @emwang-jump
911
/src/discof/repair @lidatong @emwang-jump
1012
/src/waltz/quic @nbridge-jump @ripatel-fd @akhinvasara-jumptrading
1113
/src/waltz/tls @ripatel-fd @mmcgee-jump

book/api/cli.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ $ fdctl version
142142
0.101.11814
143143
```
144144

145+
## `shred-version`
146+
Prints the current shred version of the cluster being joined, according
147+
to the entrypoints, to standard output and exits. The command writes
148+
diagnostic messages from logs to `stderr`.
149+
150+
```sh [bash]
151+
$ fdctl shred-version
152+
9065
153+
```
154+
145155
## `set-identity`
146156
Changes the identity key of a running validator. The `<keypair>`
147157
argument is required and must be the path to an Agave style

book/api/metrics-generated.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,3 +899,18 @@
899899
| <span class="metrics-name">snapin_&#8203;accounts_&#8203;inserted</span> | gauge | Number of accounts inserted during snpashot loading. Might decrease if snapshot load is aborted and restarted |
900900

901901
</div>
902+
903+
## Ipecho Tile
904+
905+
<div class="metrics">
906+
907+
| Metric | Type | Description |
908+
|--------|------|-------------|
909+
| <span class="metrics-name">ipecho_&#8203;shred_&#8203;version</span> | gauge | The current shred version used by the validator |
910+
| <span class="metrics-name">ipecho_&#8203;connection_&#8203;count</span> | gauge | The number of active connections to the ipecho service |
911+
| <span class="metrics-name">ipecho_&#8203;connections_&#8203;closed_&#8203;ok</span> | counter | The number of connections to the ipecho service that have been made and closed normally |
912+
| <span class="metrics-name">ipecho_&#8203;connections_&#8203;closed_&#8203;error</span> | counter | The number of connections to the ipecho service that have been made and closed abnormally |
913+
| <span class="metrics-name">ipecho_&#8203;bytes_&#8203;read</span> | counter | The total number of bytes read from all connections to the ipecho service |
914+
| <span class="metrics-name">ipecho_&#8203;bytes_&#8203;written</span> | counter | The total number of bytes written to all connections to the ipecho service |
915+
916+
</div>

src/app/fdctl/main.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "topology.h"
22
#include "config.h"
3+
#include "../shared/fd_config_file.h"
34
#include "../shared/boot/fd_boot.h"
45
#include "../shared/commands/configure/configure.h"
56

@@ -116,7 +117,18 @@ action_t * ACTIONS[] = {
116117
int
117118
main( int argc,
118119
char ** argv ) {
119-
return fd_main( argc, argv, 0, (char const *)fdctl_default_config, fdctl_default_config_sz, fd_topo_initialize );
120+
fd_config_file_t _default = (fd_config_file_t){
121+
.name = "default",
122+
.data = fdctl_default_config,
123+
.data_sz = fdctl_default_config_sz,
124+
};
125+
126+
fd_config_file_t * configs[] = {
127+
&_default,
128+
NULL
129+
};
130+
131+
return fd_main( argc, argv, 0, configs, fd_topo_initialize );
120132
}
121133

122134
/* Kind of a hack for now, we sometimes want to view bench generation

src/app/fddev/main.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@
33
int
44
main( int argc,
55
char ** argv ) {
6-
return fd_dev_main( argc, argv, 0, (char const *)fdctl_default_config, fdctl_default_config_sz, fd_topo_initialize );
6+
fd_config_file_t _default = (fd_config_file_t){
7+
.name = "default",
8+
.data = fdctl_default_config,
9+
.data_sz = fdctl_default_config_sz,
10+
};
11+
12+
fd_config_file_t * configs[] = {
13+
&_default,
14+
NULL
15+
};
16+
17+
return fd_dev_main( argc, argv, 0, configs, fd_topo_initialize );
718
}

src/app/fddev/tests/test_fddev.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fddev_test_run( int argc,
174174
fd_log_thread_set( "supervisor" );
175175

176176
static config_t config[1];
177-
fd_config_load( 0, 0, 1, (char const *)fdctl_default_config, fdctl_default_config_sz, NULL, 0UL, NULL, config );
177+
fd_config_load( 0, 0, 1, (char const *)fdctl_default_config, fdctl_default_config_sz, NULL, NULL, 0UL, NULL, 0UL, NULL, config );
178178
fd_topo_initialize( config );
179179
config->log.log_fd = fd_log_private_logfile_fd();
180180
config->log.lock_fd = init_log_memfd();
@@ -195,7 +195,18 @@ fddev_test_run( int argc,
195195
else if( FD_UNLIKELY( WEXITSTATUS( wstatus ) ) ) return WEXITSTATUS( wstatus );
196196
}
197197
} else {
198-
return fd_dev_main( argc, argv, 0, (char const *)fdctl_default_config, fdctl_default_config_sz, fd_topo_initialize );
198+
fd_config_file_t _default = (fd_config_file_t){
199+
.name = "default",
200+
.data = fdctl_default_config,
201+
.data_sz = fdctl_default_config_sz,
202+
};
203+
204+
fd_config_file_t * configs[] = {
205+
&_default,
206+
NULL
207+
};
208+
209+
return fd_dev_main( argc, argv, 0, configs, fd_topo_initialize );
199210
}
200211

201212
return 0;

src/app/firedancer-dev/Local.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ $(call add-objs,commands/sim,fd_firedancer_dev)
1515
$(call add-objs,commands/backtest,fd_firedancer_dev)
1616
$(call add-objs,commands/snapshot_load,fd_firedancer_dev)
1717
$(call add-objs,commands/repair,fd_firedancer_dev)
18+
$(call add-objs,commands/ipecho_server,fd_firedancer_dev)
1819

1920
$(call make-bin,firedancer-dev,main,fd_firedancer_dev fd_firedancer fddev_shared fdctl_shared fdctl_platform fd_discof fd_disco fd_choreo fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_waltz fd_tango fd_ballet fd_util firedancer_version,$(SECP256K1_LIBS) $(ROCKSDB_LIBS) $(OPENSSL_LIBS))
2021

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "../../../disco/metrics/fd_metrics.h"
2424
#include "../../../util/pod/fd_pod_format.h"
2525
#include "../../../discof/replay/fd_replay_notif.h"
26-
#include "../../../discof/repair/fd_fec_chainer.h"
26+
#include "../../../discof/reasm/fd_reasm.h"
2727
#include "../../../flamenco/runtime/fd_runtime_public.h" /* FD_RUNTIME_PUBLIC_ACCOUNT_UPDATE_MSG_MTU */
2828
#include "../main.h"
2929

@@ -109,7 +109,7 @@ backtest_topo( config_t * config ) {
109109
batches from the CLI-specified source (eg. RocksDB). */
110110

111111
fd_topob_wksp( topo, "repair_repla" );
112-
fd_topob_link( topo, "repair_repla", "repair_repla", 65536UL, sizeof(fd_fec_out_t), 1UL );
112+
fd_topob_link( topo, "repair_repla", "repair_repla", 65536UL, sizeof(fd_reasm_fec_t), 1UL );
113113
fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "repair_repla", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
114114
fd_topob_tile_out( topo, "back", 0UL, "repair_repla", 0UL );
115115

@@ -155,10 +155,10 @@ backtest_topo( config_t * config ) {
155155
This allows the replay tile to advance its watermark, and publish
156156
various data structures. This is an oversimplified barebones mock
157157
of the tower tile. */
158-
fd_topob_wksp( topo, "tower_replay" );
159-
fd_topob_link( topo, "tower_replay", "tower_replay", 128UL, 0UL, 1UL );
160-
fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "tower_replay", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
161-
fd_topob_tile_out( topo, "back", 0UL, "tower_replay", 0UL );
158+
fd_topob_wksp( topo, "root_out" );
159+
fd_topob_link( topo, "root_out", "root_out", 128UL, 0UL, 1UL );
160+
fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "root_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
161+
fd_topob_tile_out( topo, "back", 0UL, "root_out", 0UL );
162162

163163
/**********************************************************************/
164164
/* Setup replay->stake/send/poh links in topo w/o consumers */
@@ -350,7 +350,7 @@ backtest_cmd_topo( config_t * config ) {
350350
backtest_topo( config );
351351
}
352352

353-
args_t
353+
static args_t
354354
configure_args( void ) {
355355
args_t args = {
356356
.configure.command = CONFIGURE_CMD_INIT,
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
2+
#include "../../shared/commands/configure/configure.h"
3+
#include "../../shared/commands/run/run.h"
4+
#include "../../../disco/metrics/fd_metrics.h"
5+
#include "../../../disco/topo/fd_topob.h"
6+
7+
#include <time.h>
8+
#include <stdio.h>
9+
#include <unistd.h>
10+
11+
#define NAME "ipecho-server"
12+
13+
extern fd_topo_obj_callbacks_t * CALLBACKS[];
14+
15+
fd_topo_run_tile_t
16+
fdctl_tile_run( fd_topo_tile_t const * tile );
17+
18+
static void
19+
ipecho_topo( fd_topo_t * topo,
20+
char const * name ) {
21+
fd_topob_new( topo, name );
22+
topo->max_page_size = 1UL<<21UL;
23+
24+
fd_topob_wksp( topo, "all" );
25+
fd_topo_link_t * link = fd_topob_link( topo, "ipecho_out", "all", 4UL, 0UL, 1UL );
26+
link->permit_no_consumers = 1;
27+
fd_topo_tile_t * tile = fd_topob_tile( topo, "ipecho", "all", "all", 0UL, 0, 0 );
28+
tile->ipecho.expected_shred_version = 32;
29+
tile->ipecho.entrypoints_cnt = 0UL;
30+
tile->ipecho.bind_address = FD_IP4_ADDR(127,0,0,1);
31+
tile->ipecho.bind_port = 12008;
32+
fd_topob_tile_out( topo, "ipecho", 0UL, "ipecho_out", 0UL );
33+
34+
fd_topob_auto_layout( topo, 0 );
35+
fd_topob_finish( topo, CALLBACKS );
36+
}
37+
38+
extern int * fd_log_private_shared_lock;
39+
40+
static void
41+
ipecho_server_cmd_topo( config_t * config ) {
42+
ipecho_topo( &config->topo, config->name );
43+
}
44+
45+
static args_t
46+
configure_args( void ) {
47+
args_t args = {
48+
.configure.command = CONFIGURE_CMD_INIT,
49+
};
50+
51+
ulong stage_idx = 0UL;
52+
args.configure.stages[ stage_idx++ ] = &fd_cfg_stage_hugetlbfs;
53+
args.configure.stages[ stage_idx++ ] = NULL;
54+
55+
return args;
56+
}
57+
58+
void
59+
ipecho_server_cmd_perm( args_t * args FD_PARAM_UNUSED,
60+
fd_cap_chk_t * chk,
61+
config_t const * config ) {
62+
args_t c_args = configure_args();
63+
configure_cmd_perm( &c_args, chk, config );
64+
run_cmd_perm( NULL, chk, config );
65+
}
66+
67+
static void
68+
ipecho_server_cmd_fn( args_t * args,
69+
config_t * config ) {
70+
(void)args;
71+
72+
args_t c_args = configure_args();
73+
configure_cmd_fn( &c_args, config );
74+
75+
run_firedancer_init( config, 1 );
76+
77+
fd_log_private_shared_lock[ 1 ] = 0;
78+
fd_topo_join_workspaces( &config->topo, FD_SHMEM_JOIN_MODE_READ_WRITE );
79+
fd_topo_fill( &config->topo );
80+
81+
ulong tile_idx1 = fd_topo_find_tile( &config->topo, "ipecho", 0UL );
82+
fd_topo_tile_t * ipecho_tile1 = &config->topo.tiles[ tile_idx1 ];
83+
ulong volatile * const ipecho_metrics1 = fd_metrics_tile( ipecho_tile1->metrics );
84+
(void)ipecho_metrics1;
85+
86+
fd_topo_run_single_process( &config->topo, 2, config->uid, config->gid, fdctl_tile_run );
87+
88+
ulong tile_idx = fd_topo_find_tile( &config->topo, "ipecho", 0UL );
89+
FD_TEST( tile_idx!=ULONG_MAX );
90+
fd_topo_tile_t * ipecho_tile = &config->topo.tiles[ tile_idx ];
91+
92+
sleep(1);
93+
ulong volatile * const ipecho_metrics = fd_metrics_tile( ipecho_tile->metrics );
94+
95+
ulong last_conns = ULONG_MAX;
96+
ulong last_closed_ok = ULONG_MAX;
97+
ulong last_closed_error = ULONG_MAX;
98+
99+
for(;;) {
100+
ulong ipecho_conns = FD_VOLATILE_CONST( ipecho_metrics[ MIDX( GAUGE, IPECHO, CONNECTION_COUNT ) ] );
101+
ulong ipecho_closed_ok = FD_VOLATILE_CONST( ipecho_metrics[ MIDX( COUNTER, IPECHO, CONNECTIONS_CLOSED_OK ) ] );
102+
ulong ipecho_closed_error = FD_VOLATILE_CONST( ipecho_metrics[ MIDX( COUNTER, IPECHO, CONNECTIONS_CLOSED_ERROR ) ] );
103+
104+
if( FD_UNLIKELY( ipecho_conns!=last_conns || ipecho_closed_ok!=last_closed_ok || ipecho_closed_error!=last_closed_error ) ) {
105+
FD_LOG_NOTICE(( "connections=%lu closed_ok=%lu closed_err=%lu", ipecho_conns, ipecho_closed_ok, ipecho_closed_error ));
106+
last_conns = ipecho_conns;
107+
last_closed_ok = ipecho_closed_ok;
108+
last_closed_error = ipecho_closed_error;
109+
}
110+
111+
nanosleep( &(struct timespec){ .tv_sec=0, .tv_nsec=1000L*1000L }, NULL );
112+
}
113+
}
114+
115+
action_t fd_action_ipecho_server = {
116+
.name = NAME,
117+
.args = NULL,
118+
.perm = ipecho_server_cmd_perm,
119+
.fn = ipecho_server_cmd_fn,
120+
.topo = ipecho_server_cmd_topo,
121+
};

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ repair_topo( config_t * config ) {
102102
fd_topob_wksp( topo, "gossip" );
103103
fd_topob_wksp( topo, "metric" );
104104
fd_topob_wksp( topo, "fec_sets" );
105+
fd_topob_wksp( topo, "snap_out" );
105106

106107
fd_topob_wksp( topo, "slot_fseqs" ); /* fseqs for marked slots eg. turbine slot */
107108

@@ -132,14 +133,17 @@ repair_topo( config_t * config ) {
132133

133134
/**/ fd_topob_link( topo, "repair_net", "net_repair", config->net.ingress_buffer_size, FD_NET_MTU, 1UL );
134135
/**/ fd_topob_link( topo, "repair_sign", "repair_sign", 128UL, 2048UL, 1UL );
135-
FOR(shred_tile_cnt) fd_topob_link( topo, "shred_repair", "shred_repair", pending_fec_shreds_depth, FD_SHRED_REPAIR_MTU, 2UL /* at most 2 msgs per after_frag */ );
136+
FOR(shred_tile_cnt) fd_topob_link( topo, "shred_repair", "shred_repair", pending_fec_shreds_depth, FD_SHRED_REPAIR_MTU, 2UL );
136137

137138
FOR(shred_tile_cnt) fd_topob_link( topo, "repair_shred", "shred_repair", pending_fec_shreds_depth, sizeof(fd_ed25519_sig_t), 1UL );
138139
/**/ fd_topob_link( topo, "sign_repair", "sign_repair", 128UL, 64UL, 1UL );
139-
/**/ fd_topob_link( topo, "repair_repla", "repair_repla", 65536UL, sizeof(fd_fec_out_t), 1UL );
140+
/**/ fd_topob_link( topo, "repair_repla", "repair_repla", 65536UL, sizeof(fd_reasm_fec_t), 1UL );
140141
/**/ fd_topob_link( topo, "poh_shred", "poh_shred", 16384UL, USHORT_MAX, 1UL );
141142

142-
/**/ fd_topob_link( topo, "send_txns", "send_txns", 128UL, FD_TXN_MTU, 1UL );
143+
/**/ fd_topob_link( topo, "send_txns", "send_txns", 128UL, FD_TXN_MTU, 1UL );
144+
145+
FD_TEST( sizeof(fd_snapshot_manifest_t)<=(5UL*(1UL<<30UL)) );
146+
/**/ fd_topob_link( topo, "snap_out", "snap_out", 2UL, 5UL*(1UL<<30UL), 1UL );
143147

144148
ushort parsed_tile_to_cpu[ FD_TILE_MAX ];
145149
/* Unassigned tiles will be floating, unless auto topology is enabled. */
@@ -296,6 +300,7 @@ repair_topo( config_t * config ) {
296300
FOR(net_tile_cnt) fd_topob_tile_in( topo, "repair", 0UL, "metric_in", "net_repair", i, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
297301
/**/ fd_topob_tile_in( topo, "repair", 0UL, "metric_in", "gossip_repai", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
298302
/**/ fd_topob_tile_in( topo, "repair", 0UL, "metric_in", "stake_out", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
303+
fd_topob_tile_in( topo, "repair", 0UL, "metric_in", "snap_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
299304
FOR(shred_tile_cnt) fd_topob_tile_in( topo, "repair", 0UL, "metric_in", "shred_repair", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
300305
301306
/**/ fd_topob_tile_in( topo, "sign", 0UL, "metric_in", "repair_sign", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
@@ -330,7 +335,8 @@ repair_topo( config_t * config ) {
330335
fd_topob_tile_in( topo, "scap", 0UL, "metric_in", "replay_scap", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
331336

332337
fd_topob_tile_uses( topo, scap_tile, root_slot_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
333-
fd_topob_tile_out( topo, "scap", 0UL, "stake_out", 0UL );
338+
fd_topob_tile_out( topo, "scap", 0UL, "stake_out", 0UL );
339+
fd_topob_tile_out( topo, "scap", 0UL, "snap_out", 0UL );
334340
}
335341

336342
FD_TEST( link_permit_no_producers( topo, "quic_net" ) == quic_tile_cnt );
@@ -396,6 +402,7 @@ repair_cmd_fn( args_t * args,
396402
}
397403

398404
FD_LOG_NOTICE(( "Repair profiler init" ));
405+
fd_topo_print_log( 1, &config->topo );
399406

400407
args_t configure_args = {
401408
.configure.command = CONFIGURE_CMD_INIT,

0 commit comments

Comments
 (0)