Skip to content

Commit

Permalink
feat: update tower comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lidatong committed Apr 29, 2024
1 parent 5b19a4a commit 21ac0ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/choreo/tower/fd_tower.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ fd_tower_threshold_check( fd_tower_t * tower,
}

int
fd_tower_switch_proof_construct( fd_tower_t * tower, fd_ghost_t * ghost, fd_fork_t * heaviest_fork, fd_fork_t * heaviest_votable_fork ) {
fd_slot_hash_t slot_hash = { .slot = heaviest_fork->slot, .hash = heaviest_fork->slot_ctx.slot_bank.banks_hash };
fd_ghost_node_t const * ghost_node = fd_ghost_node_query( ghost, &slot_hash );
fd_tower_switch_proof_construct( fd_tower_t * tower ) {
FD_LOG_ERR(("unimplemented"));
}
14 changes: 12 additions & 2 deletions src/choreo/tower/fd_tower.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ fd_tower_threshold_check( fd_tower_t * tower,
ulong threshold_depth,
float threshold_pct );

int
fd_tower_switch_proof_construct( fd_tower_t * tower, fd_ghost_t * ghost );
/* Attempt to construct a "switch proof", ie. demonstrate that at least
FD_TOWER_SWITCH_PROOF_THRESHOLD_PCT is locked out from voting for our current fork.
A validator is time-locked out from voting for other forks on a given slot n for 2^k slots, where k
is the confirmation count. Once locked out, a validator can only vote for descendants until that
lockout expires.
A switch proof is an additional constraint validators must satisfy to be able to switch forks. It is used to safeguard optimistic confirmation
*/
fd_hash_t const *
fd_tower_switch_proof_construct( fd_tower_t * tower );

#endif /* HEADER_fd_src_choreo_tower_fd_tower_h */

0 comments on commit 21ac0ab

Please sign in to comment.