Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
750 changes: 8 additions & 742 deletions src/app/firedancer-dev/commands/repair.c

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/app/shared/fd_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ union fdctl_args {

/* options */

char manifest_path[256UL];
char iptable_path[256UL];
ulong slot;
int sort_by_slot;
Expand Down
3 changes: 2 additions & 1 deletion src/disco/gui/fd_gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,8 @@ fd_gui_handle_epoch_info( fd_gui_t * gui,
epoch_info->start_slot,
epoch_info->slot_cnt,
epoch_info->staked_vote_cnt,
gui->epoch.stakes_scratch ) );
gui->epoch.stakes_scratch,
fd_epoch_leaders_use_geo_aware( &epoch_info->features, &epoch_info->epoch_schedule, epoch_info->epoch ) ) );
FD_TEST( lsched );

int created = 0;
Expand Down
6 changes: 4 additions & 2 deletions src/disco/shred/fd_stake_ci.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fd_stake_ci_new( void * mem,
ei->start_slot = 0UL;
ei->slot_cnt = 0UL;

ei->lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( ei->_lsched, 0UL, 0UL, 1UL, 1UL, info->vote_stake_weight ) );
ei->lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( ei->_lsched, 0UL, 0UL, 1UL, 1UL, info->vote_stake_weight, 0 ) );
ei->sdest = fd_shred_dest_join ( fd_shred_dest_new ( ei->_sdest, info->shred_dest, 1UL, ei->lsched, identity_key, seed ) );
}
info->identity_key[ 0 ] = *identity_key;
Expand Down Expand Up @@ -66,6 +66,7 @@ fd_stake_ci_stake_msg_init( fd_stake_ci_t * info,
info->scratch->slot_cnt = msg->slot_cnt;
info->scratch->staked_vote_cnt = msg->staked_vote_cnt;
info->scratch->staked_id_cnt = msg->staked_id_cnt;
info->scratch->geo_aware_lsched = 0;

fd_memcpy( info->vote_stake_weight, fd_stake_weight_msg_stake_weights( msg ), msg->staked_vote_cnt*sizeof(fd_vote_stake_weight_t) );
fd_memcpy( info->stake_weight, fd_stake_weight_msg_id_weights( msg ), msg->staked_id_cnt*sizeof(fd_stake_weight_t) );
Expand Down Expand Up @@ -93,6 +94,7 @@ fd_stake_ci_epoch_msg_init( fd_stake_ci_t * info,
info->scratch->slot_cnt = msg->slot_cnt;
info->scratch->staked_vote_cnt = msg->staked_vote_cnt;
info->scratch->staked_id_cnt = msg->staked_id_cnt;
info->scratch->geo_aware_lsched = fd_epoch_leaders_use_geo_aware( &msg->features, &msg->epoch_schedule, msg->epoch );
Comment thread
topointon-jump marked this conversation as resolved.

fd_memcpy( info->vote_stake_weight, fd_epoch_info_msg_stake_weights( msg ), msg->staked_vote_cnt*sizeof(fd_vote_stake_weight_t) );
fd_memcpy( info->stake_weight, fd_epoch_info_msg_id_weights( msg ), msg->staked_id_cnt*sizeof(fd_stake_weight_t) );
Expand Down Expand Up @@ -197,7 +199,7 @@ fd_stake_ci_stake_msg_fini( fd_stake_ci_t * info ) {
new_ei->slot_cnt = info->scratch->slot_cnt;

new_ei->lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( new_ei->_lsched, epoch, new_ei->start_slot, new_ei->slot_cnt,
info->scratch->staked_vote_cnt, info->vote_stake_weight ) );
info->scratch->staked_vote_cnt, info->vote_stake_weight, info->scratch->geo_aware_lsched ) );
new_ei->sdest = fd_shred_dest_join ( fd_shred_dest_new ( new_ei->_sdest, info->shred_dest, j,
new_ei->lsched, info->identity_key, info->seed ) );
log_summary( "stake update", info );
Expand Down
1 change: 1 addition & 0 deletions src/disco/shred/fd_stake_ci.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct fd_stake_ci {
ulong slot_cnt;
ulong staked_vote_cnt;
ulong staked_id_cnt;
int geo_aware_lsched;
} scratch[1];

fd_vote_stake_weight_t vote_stake_weight[ MAX_STAKE_WEIGHTS ];
Expand Down
18 changes: 9 additions & 9 deletions src/disco/shred/test_shred_dest.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test_compute_first_matches_agave( void ) {
FD_TEST( fd_shred_dest_footprint ( staked, staked-cnt ) <= TEST_MAX_FOOTPRINT );
FD_TEST( fd_epoch_leaders_footprint( cnt, 10000UL ) <= TEST_MAX_FOOTPRINT );

fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 10000UL, staked, stakes ) );
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 10000UL, staked, stakes, 0 ) );
FD_TEST( lsched );

fd_shred_dest_t * sdest = fd_shred_dest_join( fd_shred_dest_new( _sd_footprint, info, cnt, lsched, src_key, TEST_HASH_SEED ) );
Expand Down Expand Up @@ -89,7 +89,7 @@ test_compute_children_matches_agave( void ) {
FD_TEST( fd_shred_dest_footprint ( staked, cnt-staked ) <= TEST_MAX_FOOTPRINT );
FD_TEST( fd_epoch_leaders_footprint( cnt, 2000UL ) <= TEST_MAX_FOOTPRINT );

fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 4000UL, staked, stakes ) );
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 4000UL, staked, stakes, 0 ) );

fd_shred_dest_t * sdest = fd_shred_dest_join( fd_shred_dest_new( _sd_footprint, info, cnt, lsched, src_key, TEST_HASH_SEED ) );

Expand Down Expand Up @@ -193,7 +193,7 @@ test_batching( void ) {
info[i].ip4 = (uint)i;
}
fd_pubkey_t * src_key = &(info[0].pubkey);
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 100UL, cnt, stakes ) );
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 100UL, cnt, stakes, 0 ) );
fd_shred_dest_t * sdest = fd_shred_dest_join( fd_shred_dest_new( _sd_footprint, info, cnt, lsched, src_key, TEST_HASH_SEED ) );

#define BATCH_CNT 5
Expand Down Expand Up @@ -270,7 +270,7 @@ test_vary_stake( void ) {
stakes[30].stake = prev-1UL;
stakes[31].stake = prev-1UL;

fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 100UL, cnt, stakes ) );
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 100UL, cnt, stakes, 0 ) );
test_distribution_is_tree( info, 32UL, lsched, 6+fd_rng_ulong_roll(r, 25UL ), fd_rng_ulong_roll( r, 100UL ), fd_rng_int_roll( r, 2 ), fd_rng_ulong_roll( r, 100UL ) );
fd_epoch_leaders_delete( fd_epoch_leaders_leave( lsched ) );
}
Expand All @@ -291,7 +291,7 @@ test_t1_vary_radix( void ) {
staked += (info[i].stake_lamports>0UL);
}

fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 4000UL, staked, stakes ) );
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 4000UL, staked, stakes, 0 ) );
for( ulong fanout=35UL; fanout<650UL; fanout+=11UL ) {
FD_LOG_NOTICE(( "Fanout: %lu", fanout ));
test_distribution_is_tree( info, cnt, lsched, fanout, fd_rng_ulong_roll( r, 4000UL ), fd_rng_int_roll( r, 2 ), fd_rng_ulong_roll( r, 100UL ) );
Expand All @@ -317,7 +317,7 @@ test_unstaked_no_dest( void ) {
stakes[i].stake = info[i].stake_lamports;
}
fd_pubkey_t const * src_key = &info[ 30 ].pubkey; /* unstaked */
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 100UL, 24UL, stakes ) );
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 100UL, 24UL, stakes, 0 ) );
fd_shred_dest_t * sdest = fd_shred_dest_join( fd_shred_dest_new( _sd_footprint, info, cnt, lsched, src_key, TEST_HASH_SEED ) );
FD_TEST( sdest );

Expand Down Expand Up @@ -378,7 +378,7 @@ test_change_contact( void ) {
staked += (info[i].stake_lamports>0UL);
}

fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 10000UL, staked, stakes ) );
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 10000UL, staked, stakes, 0 ) );

fd_shred_dest_t * sdest = fd_shred_dest_join( fd_shred_dest_new( _sd_footprint, info, cnt, lsched, src_key, TEST_HASH_SEED ) );
fd_shred_dest_idx_to_dest( sdest, (ushort)0 )->ip4 = 12U;
Expand All @@ -399,7 +399,7 @@ test_errors( void ) {
memset( &(stakes[0].vote_key), 1, 32UL );
stakes[0].stake = 100UL;
fd_pubkey_t const * src_key = (fd_pubkey_t const *)t1_pubkey;
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 10000UL, 1UL, stakes ) );
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 10000UL, 1UL, stakes, 0 ) );

fd_shred_dest_t * sdest = fd_shred_dest_join( fd_shred_dest_new( _sd_footprint, NULL, 0UL, lsched, src_key, TEST_HASH_SEED ) );
FD_TEST( sdest==NULL );
Expand Down Expand Up @@ -436,7 +436,7 @@ perf_run( char const * name,
FD_TEST( fd_epoch_leaders_footprint( staked, 10000UL ) <= TEST_MAX_FOOTPRINT );

fd_pubkey_t const * src = &info[ src_rank ].pubkey;
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 10000UL, staked, stakes ) );
fd_epoch_leaders_t * lsched = fd_epoch_leaders_join( fd_epoch_leaders_new( _l_footprint, 0UL, 0UL, 10000UL, staked, stakes, 0 ) );
fd_shred_dest_t * sdest = fd_shred_dest_join ( fd_shred_dest_new ( _sd_footprint, info, cnt, lsched, src, TEST_HASH_SEED ) );
FD_TEST( lsched && sdest );

Expand Down
47 changes: 47 additions & 0 deletions src/disco/shred/test_stake_ci.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "fd_stake_ci.h"
#include "../../flamenco/leaders/fd_multi_epoch_leaders.h"
#define SLOTS_PER_EPOCH 1000 /* Just for testing */
#define TEST_HASH_SEED (0x9b6d1f47a2c583e0UL)

Expand Down Expand Up @@ -45,6 +46,7 @@ generate_epoch_msg( uchar * _buf,
buf->slot_cnt = SLOTS_PER_EPOCH;
buf->staked_vote_cnt = strlen(stakers);
memset( &buf->features, 0, sizeof(fd_features_t) );
buf->features.geo_aware_leader_schedule = FD_FEATURE_DISABLED;

fd_vote_stake_weight_t * weights = fd_epoch_info_msg_stake_weights( buf );
for( ulong i=0UL; i<buf->staked_vote_cnt; i++ ) {
Expand Down Expand Up @@ -937,6 +939,50 @@ test_dest_remove( void ) {
fd_stake_ci_delete( fd_stake_ci_leave( info ) );
}

static uchar mleaders_mem[ FD_MULTI_EPOCH_LEADERS_FOOTPRINT ] __attribute__((aligned(FD_MULTI_EPOCH_LEADERS_ALIGN)));
static uchar ref_mem [ FD_EPOCH_LEADERS_FOOTPRINT( MAX_STAKE_WEIGHTS, SLOTS_PER_EPOCH ) ] __attribute__((aligned(FD_EPOCH_LEADERS_ALIGN)));
static uchar base_mem [ FD_EPOCH_LEADERS_FOOTPRINT( MAX_STAKE_WEIGHTS, SLOTS_PER_EPOCH ) ] __attribute__((aligned(FD_EPOCH_LEADERS_ALIGN)));

static void
test_geo_aware_consistency( void ) {
static fd_validator_location_t const city[ 4 ] = {
{ 4051542, 618526, 4870645 }, { 1333729, -4654333, 4138065 },
{ -3955214, 3355452, 3699409 }, { -4646017, 2553114, -3534483 }
};
fd_stake_ci_t * info = fd_stake_ci_join( fd_stake_ci_new( _info, identity_key, TEST_HASH_SEED ) );
fd_multi_epoch_leaders_t * mleaders = fd_multi_epoch_leaders_join( fd_multi_epoch_leaders_new( mleaders_mem ) );

fd_epoch_info_msg_t * msg = generate_epoch_msg( epoch_msg, 1UL, "ABCDEFGH" );
fd_vote_stake_weight_t * w = fd_epoch_info_msg_stake_weights( msg );
for( ulong i=0UL; i<msg->staked_vote_cnt; i++ ) w[ i ].location = city[ i%4UL ];
msg->features.geo_aware_leader_schedule = 0UL;
FD_TEST( fd_epoch_leaders_use_geo_aware( &msg->features, &msg->epoch_schedule, msg->epoch ) );

static fd_vote_stake_weight_t copy[ 8 ];
memcpy( copy, w, msg->staked_vote_cnt*sizeof(fd_vote_stake_weight_t) );
fd_epoch_leaders_t * ref = fd_epoch_leaders_join( fd_epoch_leaders_new( ref_mem, 1UL, msg->start_slot, msg->slot_cnt, msg->staked_vote_cnt, copy, 1 ) );
fd_epoch_leaders_t * base = fd_epoch_leaders_join( fd_epoch_leaders_new( base_mem, 1UL, msg->start_slot, msg->slot_cnt, msg->staked_vote_cnt, copy, 0 ) );
FD_TEST( ref && base );
FD_TEST( memcmp( ref->sched, base->sched, ref->sched_cnt*sizeof(uint) ) );

fd_stake_ci_epoch_msg_init( info, msg );
fd_stake_ci_epoch_msg_fini( info );
fd_multi_epoch_leaders_epoch_msg_init( mleaders, msg );
fd_multi_epoch_leaders_epoch_msg_fini( mleaders );

fd_epoch_leaders_t const * ci = fd_stake_ci_get_lsched_for_slot( info, msg->start_slot );
fd_epoch_leaders_t const * ml = fd_multi_epoch_leaders_get_lsched_for_epoch( mleaders, 1UL );
FD_TEST( ci && ml );
FD_TEST( ci->sched_cnt==ref->sched_cnt && ml->sched_cnt==ref->sched_cnt );
FD_TEST( !memcmp( ci->sched, ref->sched, ref->sched_cnt*sizeof(uint) ) );
FD_TEST( !memcmp( ml->sched, ref->sched, ref->sched_cnt*sizeof(uint) ) );
FD_TEST( !memcmp( ci->vote_addr, ref->vote_addr, ref->sched_cnt*sizeof(fd_pubkey_t) ) );
FD_TEST( !memcmp( ml->vote_addr, ref->vote_addr, ref->sched_cnt*sizeof(fd_pubkey_t) ) );

fd_multi_epoch_leaders_delete( fd_multi_epoch_leaders_leave( mleaders ) );
fd_stake_ci_delete( fd_stake_ci_leave( info ) );
}

int
main( int argc,
char ** argv ) {
Expand All @@ -954,6 +1000,7 @@ main( int argc,

test_stake_msg();
test_epoch_msg();
test_geo_aware_consistency();

test_changing_contact_info();
test_limits();
Expand Down
108 changes: 72 additions & 36 deletions src/discof/backup/fd_ssmanifest_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,14 @@ ENCODE_FN {

/* A zeroed key means no BLS key is registered (serialized as None) */
static uchar const no_bls_key[ FD_BLS_PUB_COMPRESSED_SZ ] = {0};
int has_bls = !fd_memeq( ele->bls_key, no_bls_key, FD_BLS_PUB_COMPRESSED_SZ );
int has_bls = !fd_memeq( ele->bls_key, no_bls_key, FD_BLS_PUB_COMPRESSED_SZ );
int has_location = ele->location.x || ele->location.y || ele->location.z;

enc->total_stake += ele->stake;

FD_TEST( ec_cnt<=FD_EPOCH_CREDITS_MAX );

ulong data_length = 186UL + fd_ulong_if( !!has_bls, FD_BLS_PUB_COMPRESSED_SZ, 0UL ) + 24UL * ec_cnt;
ulong data_length = fd_ulong_if( has_location, FD_VOTE_STATE_V5_SZ, 186UL + fd_ulong_if( !!has_bls, FD_BLS_PUB_COMPRESSED_SZ, 0UL ) + 24UL * ec_cnt );

/* Vote account key + stake */
PUSH_VAL( fd_pubkey_t, ele->pubkey );
Expand All @@ -240,43 +241,78 @@ ENCODE_FN {
PUSH_VAL( ulong, 0UL );
PUSH_VAL( ulong, data_length );

/* VoteStateV4 */
PUSH_VAL( uint, 3U ); /* variant = V4 */
PUSH_VAL( fd_pubkey_t, ele->node_account ); /* node_pubkey */
PUSH_VAL( fd_pubkey_t, (fd_pubkey_t){0} ); /* authorized_withdrawer */
PUSH_VAL( fd_pubkey_t, inflation_collector ); /* inflation_rewards_collector */
PUSH_VAL( fd_pubkey_t, block_collector ); /* block_revenue_collector */
PUSH_VAL( ushort, ele->commission ); /* inflation_rewards_commission_bps */
PUSH_VAL( ushort, ele->block_revenue_commission_bps ); /* block_revenue_commission_bps */
PUSH_VAL( ulong, ele->pending_delegator_rewards ); /* pending_delegator_rewards */
if( has_bls ) {
typedef struct { uchar b[ FD_BLS_PUB_COMPRESSED_SZ ]; } bls_key_compressed_t;
PUSH_VAL( uchar, 1 ); /* bls_pubkey_compressed = Some */
PUSH_VAL( bls_key_compressed_t, *(bls_key_compressed_t const *)ele->bls_key );
if( has_location ) {
ulong epoch_key = epoch_stakes_key( bank, enc->epoch_idx );
fd_vote_state_v5_t v5 = {
.node_pubkey = ele->node_account,
.inflation_rewards_collector = inflation_collector,
.block_revenue_collector = block_collector,
.inflation_rewards_commission_bps_len = 1,
.block_revenue_commission_bps_len = 1,
.pending_delegator_rewards = ele->pending_delegator_rewards,
.location = ele->location,
.inflation_rewards_commission_bps_epochs = { epoch_key },
.inflation_rewards_commission_bps = { ele->commission },
.block_revenue_commission_bps_epochs = { epoch_key },
.block_revenue_commission_bps = { ele->block_revenue_commission_bps },
.latest_vote = ULONG_MAX,
.root_slot = ULONG_MAX,
.accumulated_lamports_len = (uint)ec_cnt
};
memcpy( v5.bls_pubkey_compressed, ele->bls_key, FD_BLS_PUB_COMPRESSED_SZ );
for( ulong k=0UL, j=0UL; k<ec_cnt; k++ ) {
if( FD_UNLIKELY( k==ag_marker_idx ) ) {
v5.accumulated_lamports[ k ] = (fd_vote_epoch_credits_t){ ULONG_MAX, ULONG_MAX, ULONG_MAX };
continue;
}
v5.accumulated_lamports[ k ] = (fd_vote_epoch_credits_t){ (ulong)ec->epoch[j],
ec->base_credits + (ulong)ec->credits_delta[j],
ec->base_credits + (ulong)ec->prev_credits_delta[j] };
j++;
}
typedef struct { uchar b[ FD_VOTE_STATE_V5_PAD_SZ ]; } v5_tail_t;
PUSH_VAL( uint, fd_vote_state_versioned_enum_v5 );
PUSH_VAL( fd_vote_state_v5_t, v5 );
PUSH_VAL( v5_tail_t, (v5_tail_t){0} );
} else {
PUSH_VAL( uchar, 0 ); /* bls_pubkey_compressed = None */
}
PUSH_VAL( ulong, 0UL ); /* votes_length = 0 */
PUSH_VAL( uchar, 0 ); /* root_slot = None */
PUSH_VAL( ulong, 0UL ); /* authorized_voters_length = 0 */

/* Epoch credits */
PUSH_VAL( ulong, ec_cnt );
for( ulong k=0UL, j=0UL; k<ec_cnt; k++ ) {
if( FD_UNLIKELY( k==ag_marker_idx ) ) {
PUSH_VAL( ulong, ULONG_MAX );
PUSH_VAL( ulong, ULONG_MAX );
PUSH_VAL( ulong, ULONG_MAX );
continue;
/* VoteStateV4 */
PUSH_VAL( uint, 3U ); /* variant = V4 */
PUSH_VAL( fd_pubkey_t, ele->node_account ); /* node_pubkey */
PUSH_VAL( fd_pubkey_t, (fd_pubkey_t){0} ); /* authorized_withdrawer */
PUSH_VAL( fd_pubkey_t, inflation_collector ); /* inflation_rewards_collector */
PUSH_VAL( fd_pubkey_t, block_collector ); /* block_revenue_collector */
PUSH_VAL( ushort, ele->commission ); /* inflation_rewards_commission_bps */
PUSH_VAL( ushort, ele->block_revenue_commission_bps ); /* block_revenue_commission_bps */
PUSH_VAL( ulong, ele->pending_delegator_rewards ); /* pending_delegator_rewards */
if( has_bls ) {
typedef struct { uchar b[ FD_BLS_PUB_COMPRESSED_SZ ]; } bls_key_compressed_t;
PUSH_VAL( uchar, 1 ); /* bls_pubkey_compressed = Some */
PUSH_VAL( bls_key_compressed_t, *(bls_key_compressed_t const *)ele->bls_key );
} else {
PUSH_VAL( uchar, 0 ); /* bls_pubkey_compressed = None */
}
PUSH_VAL( ulong, 0UL ); /* votes_length = 0 */
PUSH_VAL( uchar, 0 ); /* root_slot = None */
PUSH_VAL( ulong, 0UL ); /* authorized_voters_length = 0 */

/* Epoch credits */
PUSH_VAL( ulong, ec_cnt );
for( ulong k=0UL, j=0UL; k<ec_cnt; k++ ) {
if( FD_UNLIKELY( k==ag_marker_idx ) ) {
PUSH_VAL( ulong, ULONG_MAX );
PUSH_VAL( ulong, ULONG_MAX );
PUSH_VAL( ulong, ULONG_MAX );
continue;
}
PUSH_VAL( ulong, (ulong)ec->epoch[j] );
PUSH_VAL( ulong, ec->base_credits + (ulong)ec->credits_delta[j] );
PUSH_VAL( ulong, ec->base_credits + (ulong)ec->prev_credits_delta[j] );
j++;
}
PUSH_VAL( ulong, (ulong)ec->epoch[j] );
PUSH_VAL( ulong, ec->base_credits + (ulong)ec->credits_delta[j] );
PUSH_VAL( ulong, ec->base_credits + (ulong)ec->prev_credits_delta[j] );
j++;
}

PUSH_VAL( ulong, 0UL ); /* last_timestamp_slot */
PUSH_VAL( ulong, 0UL ); /* last_timestamp_timestamp */
PUSH_VAL( ulong, 0UL ); /* last_timestamp_slot */
PUSH_VAL( ulong, 0UL ); /* last_timestamp_timestamp */
}

/* AccountSharedData trailer */
PUSH_VAL( fd_pubkey_t, fd_solana_vote_program_id ); /* owner */
Expand Down
Loading
Loading