Skip to content

Commit 9017cc7

Browse files
committed
feat(choreo): dup handling, gossip int, bug fixes, missing logic
1 parent 72fbcee commit 9017cc7

Some content is hidden

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

56 files changed

+3694
-4693
lines changed

book/api/metrics-generated.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,3 +1104,20 @@
11041104
| <span class="metrics-name">snapwr_&#8203;vinyl_&#8203;bytes_&#8203;written</span> | gauge | Number of bytes written so far to the vinyl snapshot file. Might decrease if snapshot creation is aborted and restarted |
11051105

11061106
</div>
1107+
1108+
## Tower Tile
1109+
1110+
<div class="metrics">
1111+
1112+
| Metric | Type | Description |
1113+
|--------|------|-------------|
1114+
| <span class="metrics-name">tower_&#8203;ancestor_&#8203;rollback</span> | counter | Rollback to an ancestor of our prev vote (can't vote) |
1115+
| <span class="metrics-name">tower_&#8203;sibling_&#8203;confirmed</span> | counter | Duplicate sibling got confirmed (can't vote) |
1116+
| <span class="metrics-name">tower_&#8203;same_&#8203;fork</span> | counter | Same fork as prev vote (can vote) |
1117+
| <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) |
1118+
| <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) |
1119+
| <span class="metrics-name">tower_&#8203;lockout_&#8203;fail</span> | counter | Locked out (can't vote) |
1120+
| <span class="metrics-name">tower_&#8203;threshold_&#8203;fail</span> | counter | Did not pass threshold check (can't vote) |
1121+
| <span class="metrics-name">tower_&#8203;propagated_&#8203;fail</span> | counter | Prev leader block did not propagate (can't vote) |
1122+
1123+
</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
@@ -467,6 +467,15 @@ user = ""
467467
# abort with an error.
468468
expected_genesis_hash = ""
469469

470+
# Firedancer can process at most this many slots without rooting in
471+
# the consensus rules before it must begin evicting.
472+
#
473+
# This is an estimate and should be set as generously as possible to
474+
# allow for brief anomalies such as the validator disconnecting from
475+
# part of the cluster due to data center issues. Roughly, at 400 ms
476+
# per slot, the default allows for 30 minutes without rooting.
477+
max_unrooted_slots = 4096
478+
470479
# This section configures the "funk" account database. Currently, funk
471480
# stores all Solana accounts. In future versions of Firedancer, most
472481
# 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"
@@ -376,6 +377,7 @@ fd_topo_initialize( config_t * config ) {
376377

377378
/* TODO: Explain this .... USHORT_MAX is not dcache max */
378379
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 */ );
380+
ulong max_unrooted_slots = config->firedancer.consensus.max_unrooted_slots;
379381

380382
/* topo, link_name, wksp_name, depth, mtu, burst */
381383
/**/ fd_topob_link( topo, "gossip_net", "net_gossip", config->net.ingress_buffer_size, FD_NET_MTU, 1UL );
@@ -438,7 +440,7 @@ fd_topo_initialize( config_t * config ) {
438440

439441
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 */
440442
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 */
441-
/**/ fd_topob_link( topo, "tower_out", "tower_out", 1024UL, sizeof(fd_tower_slot_done_t), 1UL );
443+
/**/ fd_topob_link( topo, "tower_out", "tower_out", max_unrooted_slots, sizeof(fd_tower_msg_t), 1UL );
442444
/**/ fd_topob_link( topo, "send_out", "send_out", 128UL, FD_TPU_RAW_MTU, 1UL );
443445

444446
fd_topob_link( topo, "replay_exec", "replay_exec", 16384UL, sizeof(fd_exec_task_msg_t), 1UL );
@@ -596,6 +598,7 @@ fd_topo_initialize( config_t * config ) {
596598
/**/ fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "poh_replay", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
597599
FOR(exec_tile_cnt) fd_topob_tile_in( topo, "exec", i, "metric_in", "replay_exec", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
598600
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "genesi_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
601+
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "gossip_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
599602
/**/ fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "replay_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
600603
if( snapshots_enabled ) {
601604
fd_topob_tile_in ( topo, "tower", 0UL, "metric_in", "snapin_manif", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
@@ -1071,9 +1074,10 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,
10711074

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

1074-
strncpy( tile->tower.identity_key_path, config->paths.identity_key, sizeof(tile->tower.identity_key_path) );
1075-
strncpy( tile->tower.vote_acc_path, config->paths.vote_account, sizeof(tile->tower.vote_acc_path) );
1076-
strncpy( tile->tower.ledger_path, config->paths.ledger, sizeof(tile->tower.ledger_path) );
1077+
tile->tower.slot_max = config->firedancer.consensus.max_unrooted_slots;
1078+
strncpy( tile->tower.identity_key, config->paths.identity_key, sizeof(tile->tower.identity_key) );
1079+
strncpy( tile->tower.vote_account, config->paths.vote_account, sizeof(tile->tower.vote_account) );
1080+
strncpy( tile->tower.base_path, config->paths.base, sizeof(tile->tower.base_path) );
10771081

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

src/app/shared/fd_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ struct fd_configf {
129129
char host[ 256 ];
130130
} gossip;
131131

132+
struct {
133+
ulong max_unrooted_slots;
134+
} consensus;
135+
132136
struct {
133137
struct {
134138
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.

0 commit comments

Comments
 (0)