Skip to content

Commit a8cfa82

Browse files
committed
feat(choreo): dup handling, gossip int, bug fixes, missing logic
1 parent 70db0c8 commit a8cfa82

Some content is hidden

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

49 files changed

+4118
-4639
lines changed

src/app/firedancer-dev/commands/send_test/send_test_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ encode_vote( send_test_ctx_t * ctx, fd_tower_slot_done_t * slot_done ) {
215215
/* Create minimal mock tower with one vote */
216216
uchar tower_mem[ FD_TOWER_FOOTPRINT ] __attribute__((aligned(FD_TOWER_ALIGN)));
217217
fd_tower_t * tower = fd_tower_join( fd_tower_new( tower_mem ) );
218-
fd_tower_votes_push_tail( tower, (fd_tower_vote_t){ .slot = vote_slot, .conf = 1 } );
218+
fd_tower_push_tail( tower, (fd_tower_vote_t){ .slot = vote_slot, .conf = 1 } );
219219

220220
/* Mock values */
221221
fd_lockout_offset_t lockouts_scratch[1];

src/app/firedancer/config/default.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,15 @@ user = ""
463463
# abort with an error.
464464
expected_genesis_hash = ""
465465

466+
# Firedancer can process at most this many slots without rooting in
467+
# the consensus rules before it must begin evicting.
468+
#
469+
# This is an estimate and should be set as generously as possible to
470+
# allow for brief anomalies such as the validator disconnecting from
471+
# part of the cluster due to data center issues. Roughly, at 400 ms
472+
# per slot, the default allows for 30 minutes without rooting.
473+
max_unrooted_slots = 4096
474+
466475
# This section configures the "funk" account database. Currently, funk
467476
# stores all Solana accounts. In future versions of Firedancer, most
468477
# accounts will be offloaded to the "groove" database.

src/app/firedancer/topology.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "topology.h"
22

33
#include "../../ballet/lthash/fd_lthash.h"
4+
#include "../../choreo/fd_choreo_base.h"
45
#include "../../discof/reasm/fd_reasm.h"
56
#include "../../discof/poh/fd_poh.h"
67
#include "../../discof/replay/fd_exec.h"
@@ -227,6 +228,7 @@ resolve_gossip_entrypoints( config_t * config ) {
227228

228229
void
229230
fd_topo_initialize( config_t * config ) {
231+
FD_LOG_NOTICE(( "max unrooted %lu", config->firedancer.consensus.max_unrooted_slots ));
230232
/* TODO: Not here ... */
231233
resolve_gossip_entrypoints( config );
232234

@@ -347,6 +349,7 @@ fd_topo_initialize( config_t * config ) {
347349

348350
/* TODO: Explain this .... USHORT_MAX is not dcache max */
349351
ulong pending_fec_shreds_depth = fd_ulong_min( fd_ulong_pow2_up( config->tiles.shred.max_pending_shred_sets * FD_REEDSOL_DATA_SHREDS_MAX ), USHORT_MAX + 1 /* dcache max */ );
352+
ulong max_unrooted_slots = config->firedancer.consensus.max_unrooted_slots;
350353

351354
/* topo, link_name, wksp_name, depth, mtu, burst */
352355
/**/ fd_topob_link( topo, "gossip_net", "net_gossip", config->net.ingress_buffer_size, FD_NET_MTU, 1UL );
@@ -405,7 +408,7 @@ fd_topo_initialize( config_t * config ) {
405408

406409
FOR(shred_tile_cnt) fd_topob_link( topo, "shred_out", "shred_out", pending_fec_shreds_depth, FD_SHRED_OUT_MTU, 3UL ); /* TODO: Pretty sure burst of 3 is incorrect here */
407410
FOR(shred_tile_cnt) fd_topob_link( topo, "repair_shred", "shred_out", pending_fec_shreds_depth, sizeof(fd_ed25519_sig_t), 1UL ); /* TODO: Also pending_fec_shreds_depth? Seems wrong */
408-
/**/ fd_topob_link( topo, "tower_out", "tower_out", 1024UL, sizeof(fd_tower_slot_done_t), 1UL );
411+
/**/ fd_topob_link( topo, "tower_out", "tower_out", max_unrooted_slots, sizeof(fd_tower_msg_t), 1UL );
409412
/**/ fd_topob_link( topo, "send_out", "send_out", 128UL, FD_TPU_RAW_MTU, 1UL );
410413

411414
fd_topob_link( topo, "replay_exec", "replay_exec", 16384UL, sizeof(fd_exec_task_msg_t), 1UL );
@@ -558,6 +561,7 @@ fd_topo_initialize( config_t * config ) {
558561
/**/ fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "poh_replay", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
559562
FOR(exec_tile_cnt) fd_topob_tile_in( topo, "exec", i, "metric_in", "replay_exec", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
560563
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "genesi_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
564+
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "gossip_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
561565
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "replay_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
562566
if( snapshots_enabled ) {
563567
fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "snapin_manif", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
@@ -1017,8 +1021,9 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,
10171021

10181022
} else if( FD_UNLIKELY( !strcmp( tile->name, "tower" ) ) ) {
10191023

1020-
strncpy( tile->tower.identity_key_path, config->paths.identity_key, sizeof(tile->tower.identity_key_path) );
1021-
strncpy( tile->tower.vote_acc_path, config->paths.vote_account, sizeof(tile->tower.vote_acc_path) );
1024+
tile->tower.slot_max = config->firedancer.consensus.max_unrooted_slots;
1025+
strncpy( tile->tower.identity_key, config->paths.identity_key, sizeof(tile->tower.identity_key) );
1026+
strncpy( tile->tower.vote_account, config->paths.vote_account, sizeof(tile->tower.vote_account) );
10221027
strncpy( tile->tower.ledger_path, config->paths.ledger, sizeof(tile->tower.ledger_path) );
10231028

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

src/app/shared/fd_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ struct fd_configf {
123123
char host[ 256 ];
124124
} gossip;
125125

126+
struct {
127+
ulong max_unrooted_slots;
128+
} consensus;
129+
126130
struct {
127131
struct {
128132
uint max_local_full_effective_age;

src/app/shared/fd_config_parse.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ fd_config_extract_podf( uchar * pod,
8080
fd_configf_t * config ) {
8181
CFG_POP ( cstr, gossip.host );
8282

83+
CFG_POP ( ulong, consensus.max_unrooted_slots );
84+
8385
CFG_POP ( uint, layout.exec_tile_count );
8486
CFG_POP ( uint, layout.sign_tile_count );
8587
CFG_POP ( uint, layout.gossvf_tile_count );

src/app/shared_dev/commands/dev.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,6 @@ update_config_for_dev( fd_config_t * config ) {
108108
shred->shred.expected_shred_version = shred_version;
109109
}
110110
}
111-
ulong store_id = fd_topo_find_tile( &config->topo, "storei", 0 );
112-
if( FD_UNLIKELY( store_id!=ULONG_MAX ) ) {
113-
fd_topo_tile_t * storei = &config->topo.tiles[ store_id ];
114-
if( FD_LIKELY( storei->store_int.expected_shred_version==(ushort)0 ) ) {
115-
storei->store_int.expected_shred_version = shred_version;
116-
}
117-
}
118111
}
119112

120113
/* Run Firedancer entirely in a single process for development and

src/choreo/epoch/Local.mk

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/choreo/epoch/fd_epoch.c

Lines changed: 0 additions & 146 deletions
This file was deleted.

src/choreo/epoch/fd_epoch.h

Lines changed: 0 additions & 133 deletions
This file was deleted.

0 commit comments

Comments
 (0)