LCOV - code coverage report
Current view: top level - choreo - fd_choreo_base.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 1 5 20.0 %
Date: 2025-12-06 04:45:29 Functions: 0 0 -

          Line data    Source code
       1             : #ifndef HEADER_fd_src_choreo_fd_choreo_base_h
       2             : #define HEADER_fd_src_choreo_fd_choreo_base_h
       3             : 
       4             : /* Choreo consensus library:
       5             : 
       6             :   - eqvoc: Block and vote equivocation.
       7             : 
       8             :   - forks: Frontier of banks.
       9             : 
      10             :   - ghost: Fork choice rule.
      11             : 
      12             :   - tower: TowerBFT algorithm.
      13             : 
      14             :   - voter: Voter tracking.
      15             : 
      16             :   */
      17             : 
      18             : #include "../flamenco/fd_flamenco.h"
      19             : #include "../flamenco/types/fd_types.h"
      20             : 
      21             : /* clang-format off */
      22          51 : #define FD_VOTER_MAX                  (4096) /* the maximum # of unique voters ie. node pubkeys. */
      23             : #define FD_EQVOCSAFE_PCT              (0.52)
      24             : #define FD_CONFIRMED_PCT              (2.0 / 3.0)
      25             : #define FD_FINALIZED_PCT              FD_CONFIRMED_PCT
      26             : #define FD_SLOT_HASH_CMP(k0,k1)       (fd_int_if(((k0)->slot)<((k1)->slot),-1,fd_int_if(((k0)->slot)>((k1)->slot),1),memcmp((k0),(k1),sizeof(fd_slot_hash_t))))
      27           0 : #define FD_SLOT_HASH_EQ(k0,k1)        ((((k0)->slot)==((k1)->slot)) & !(memcmp(((k0)->hash.uc),((k1)->hash.uc),sizeof(fd_hash_t))))
      28           0 : #define FD_SLOT_HASH_HASH(key,seed)   fd_ulong_hash( ((key)->slot) ^ ((key)->hash.ul[0]) ^ (seed) )
      29             : #define FD_SLOT_PUBKEY_CMP(a,b)       FD_SLOT_HASH_CMP(a,b)
      30           0 : #define FD_SLOT_PUBKEY_EQ(k0,k1)      FD_SLOT_HASH_EQ(k0,k1)
      31           0 : #define FD_SLOT_PUBKEY_HASH(key,seed) FD_SLOT_HASH_HASH(key,seed)
      32             : /* clang-format on */
      33             : 
      34             : typedef uchar fd_block_id_t[ 32UL ];
      35             : 
      36             : typedef fd_slot_hash_t fd_slot_pubkey_t;
      37             : 
      38             : static const fd_pubkey_t pubkey_null = {{ 0 }};
      39             : static const fd_hash_t hash_null = {{ 0 }};
      40             : 
      41             : #endif /* HEADER_fd_src_choreo_fd_choreo_base_h */

Generated by: LCOV version 1.14