Skip to content

Commit 7d02bbe

Browse files
committed
feat(choreo): dup handling, gossip int, bug fixes, missing logic
1 parent f4eb088 commit 7d02bbe

Some content is hidden

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

55 files changed

+3691
-4688
lines changed

book/api/metrics-generated.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,3 +1152,20 @@
11521152
| <span class="metrics-name">snapls_&#8203;incremental_&#8203;accounts_&#8203;hashed</span> | gauge | Number of accounts hashed for the incremental snapshot during snapshot loading. Might decrease if snapshot load is aborted and restarted |
11531153

11541154
</div>
1155+
1156+
## Tower Tile
1157+
1158+
<div class="metrics">
1159+
1160+
| Metric | Type | Description |
1161+
|--------|------|-------------|
1162+
| <span class="metrics-name">tower_&#8203;ancestor_&#8203;rollback</span> | counter | Rollback to an ancestor of our prev vote (can't vote) |
1163+
| <span class="metrics-name">tower_&#8203;sibling_&#8203;confirmed</span> | counter | Duplicate sibling got confirmed (can't vote) |
1164+
| <span class="metrics-name">tower_&#8203;same_&#8203;fork</span> | counter | Same fork as prev vote (can vote) |
1165+
| <span class="metrics-name">tower_&#8203;switch_&#8203;pass</span> | counter | Prev vote was on a different fork, but we are allowed to switch (can vote) |
1166+
| <span class="metrics-name">tower_&#8203;switch_&#8203;fail</span> | counter | Prev vote was on a different fork, and we are not allowed to switch (can't vote) |
1167+
| <span class="metrics-name">tower_&#8203;lockout_&#8203;fail</span> | counter | Locked out (can't vote) |
1168+
| <span class="metrics-name">tower_&#8203;threshold_&#8203;fail</span> | counter | Did not pass threshold check (can't vote) |
1169+
| <span class="metrics-name">tower_&#8203;propagated_&#8203;fail</span> | counter | Prev leader block did not propagate (can't vote) |
1170+
1171+
</div>

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
@@ -472,6 +472,15 @@ user = ""
472472
# abort with an error.
473473
expected_genesis_hash = ""
474474

475+
# Firedancer can process at most this many slots without rooting in
476+
# the consensus rules before it must begin evicting.
477+
#
478+
# This is an estimate and should be set as generously as possible to
479+
# allow for brief anomalies such as the validator disconnecting from
480+
# part of the cluster due to data center issues. Roughly, at 400 ms
481+
# per slot, the default allows for 30 minutes without rooting.
482+
max_unrooted_slots = 4096
483+
475484
# This section configures the "funk" account database. Currently, funk
476485
# stores all Solana accounts. In future versions of Firedancer, most
477486
# accounts will be offloaded to the "groove" database.

src/app/firedancer/topology.c

Lines changed: 8 additions & 4 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"
@@ -408,6 +409,7 @@ fd_topo_initialize( config_t * config ) {
408409

409410
/* TODO: Explain this .... USHORT_MAX is not dcache max */
410411
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 */ );
412+
ulong max_unrooted_slots = config->firedancer.consensus.max_unrooted_slots;
411413

412414
/* topo, link_name, wksp_name, depth, mtu, burst */
413415
/**/ fd_topob_link( topo, "gossip_net", "net_gossip", 32768UL, FD_NET_MTU, 1UL );
@@ -481,7 +483,7 @@ fd_topo_initialize( config_t * config ) {
481483

482484
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 */
483485
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 */
484-
/**/ fd_topob_link( topo, "tower_out", "tower_out", 1024UL, sizeof(fd_tower_slot_done_t), 1UL );
486+
/**/ fd_topob_link( topo, "tower_out", "tower_out", max_unrooted_slots, sizeof(fd_tower_msg_t), 1UL );
485487
/**/ fd_topob_link( topo, "send_out", "send_out", 128UL, FD_TPU_RAW_MTU, 1UL );
486488

487489
fd_topob_link( topo, "replay_exec", "replay_exec", 16384UL, sizeof(fd_exec_task_msg_t), 1UL );
@@ -668,6 +670,7 @@ fd_topo_initialize( config_t * config ) {
668670
/**/ fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "poh_replay", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
669671
FOR(exec_tile_cnt) fd_topob_tile_in( topo, "exec", i, "metric_in", "replay_exec", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
670672
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "genesi_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
673+
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "gossip_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
671674
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "replay_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
672675
if( snapshots_enabled ) {
673676
fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "snapin_manif", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
@@ -1205,9 +1208,10 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,
12051208

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

1208-
strncpy( tile->tower.identity_key_path, config->paths.identity_key, sizeof(tile->tower.identity_key_path) );
1209-
strncpy( tile->tower.vote_acc_path, config->paths.vote_account, sizeof(tile->tower.vote_acc_path) );
1210-
strncpy( tile->tower.ledger_path, config->paths.base, sizeof(tile->tower.ledger_path) );
1211+
tile->tower.slot_max = config->firedancer.consensus.max_unrooted_slots;
1212+
strncpy( tile->tower.identity_key, config->paths.identity_key, sizeof(tile->tower.identity_key) );
1213+
strncpy( tile->tower.vote_account, config->paths.vote_account, sizeof(tile->tower.vote_account) );
1214+
strncpy( tile->tower.base_path, config->paths.base, sizeof(tile->tower.base_path) );
12111215

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

src/app/shared/fd_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ struct fd_configf {
133133
char host[ 256 ];
134134
} gossip;
135135

136+
struct {
137+
ulong max_unrooted_slots;
138+
} consensus;
139+
136140
struct {
137141
struct {
138142
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
@@ -109,13 +109,6 @@ update_config_for_dev( fd_config_t * config ) {
109109
shred->shred.expected_shred_version = shred_version;
110110
}
111111
}
112-
ulong store_id = fd_topo_find_tile( &config->topo, "storei", 0 );
113-
if( FD_UNLIKELY( store_id!=ULONG_MAX ) ) {
114-
fd_topo_tile_t * storei = &config->topo.tiles[ store_id ];
115-
if( FD_LIKELY( storei->store_int.expected_shred_version==(ushort)0 ) ) {
116-
storei->store_int.expected_shred_version = shred_version;
117-
}
118-
}
119112
}
120113

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

src/choreo/epoch/fd_epoch.c

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

0 commit comments

Comments
 (0)