Skip to content

Commit f306677

Browse files
wip
1 parent 4952c36 commit f306677

File tree

7 files changed

+96
-89
lines changed

7 files changed

+96
-89
lines changed

src/flamenco/rewards/fd_rewards.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ calculate_stake_points_and_credits_recalculation( fd_stake_history_t const *
169169
fd_delegation_t delegation = {
170170
.voter_pubkey = stake->vote_account,
171171
.stake = stake->stake,
172-
.activation_epoch = stake->activation_epoch,
173-
.deactivation_epoch = stake->deactivation_epoch,
174-
.warmup_cooldown_rate = stake->warmup_cooldown_rate,
172+
.activation_epoch = stake->activation_epoch==USHORT_MAX ? ULONG_MAX : stake->activation_epoch,
173+
.deactivation_epoch = stake->deactivation_epoch==USHORT_MAX ? ULONG_MAX : stake->deactivation_epoch,
174+
.warmup_cooldown_rate = fd_stake_delegations_warmup_cooldown_rate_to_double( stake->warmup_cooldown_rate ),
175175
};
176176

177177
ulong stake_amount = fd_stake_activating_and_deactivating(
@@ -263,9 +263,9 @@ calculate_stake_points_and_credits( fd_accdb_user_t * accdb,
263263
fd_delegation_t delegation = {
264264
.voter_pubkey = stake->vote_account,
265265
.stake = stake->stake,
266-
.activation_epoch = stake->activation_epoch,
267-
.deactivation_epoch = stake->deactivation_epoch,
268-
.warmup_cooldown_rate = stake->warmup_cooldown_rate,
266+
.activation_epoch = stake->activation_epoch==USHORT_MAX ? ULONG_MAX : stake->activation_epoch,
267+
.deactivation_epoch = stake->deactivation_epoch==USHORT_MAX ? ULONG_MAX : stake->deactivation_epoch,
268+
.warmup_cooldown_rate = fd_stake_delegations_warmup_cooldown_rate_to_double( stake->warmup_cooldown_rate ),
269269
};
270270

271271
ulong stake_amount = fd_stake_activating_and_deactivating(

src/flamenco/runtime/fd_bank.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ fd_banks_stake_delegations_apply_delta( fd_bank_data_t * bank,
865865
stake_delegation->activation_epoch,
866866
stake_delegation->deactivation_epoch,
867867
stake_delegation->credits_observed,
868-
stake_delegation->warmup_cooldown_rate
868+
fd_stake_delegations_warmup_cooldown_rate_to_double( stake_delegation->warmup_cooldown_rate )
869869
);
870870
} else {
871871
fd_stake_delegations_remove( stake_delegations_base, &stake_delegation->stake_account );

src/flamenco/runtime/test_bank.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ main( int argc, char ** argv ) {
332332
the larger combined frontier state. */
333333

334334
fd_stake_delegations_t * stake_delegations = fd_bank_stake_delegations_delta_locking_modify( bank );
335-
fd_stake_delegations_update( stake_delegations, &key_0, &key_9, 100UL, 100UL, 100UL, 100UL, 100UL );
335+
fd_stake_delegations_update( stake_delegations, &key_0, &key_9, 100UL, 100UL, 100UL, 100UL, 0.09 );
336336

337337
fd_stake_delegation_t const * stake_delegation = fd_stake_delegations_query( stake_delegations, &key_0 );
338338
FD_TEST( fd_stake_delegations_cnt( stake_delegations ) == 1UL );
@@ -382,8 +382,8 @@ main( int argc, char ** argv ) {
382382
/* Make updates to delta */
383383

384384
stake_delegations = fd_bank_stake_delegations_delta_locking_modify( bank2 );
385-
fd_stake_delegations_update( stake_delegations, &key_0, &key_0, 200UL, 100UL, 100UL, 100UL, 100UL );
386-
fd_stake_delegations_update( stake_delegations, &key_1, &key_8, 100UL, 100UL, 100UL, 100UL, 100UL );
385+
fd_stake_delegations_update( stake_delegations, &key_0, &key_0, 200UL, 100UL, 100UL, 100UL, 0.09 );
386+
fd_stake_delegations_update( stake_delegations, &key_1, &key_8, 100UL, 100UL, 100UL, 100UL, 0.09 );
387387
FD_TEST( fd_stake_delegations_cnt( stake_delegations ) == 2UL );
388388
stake_delegation = fd_stake_delegations_query( stake_delegations, &key_0 );
389389
FD_TEST( stake_delegation );
@@ -417,7 +417,7 @@ main( int argc, char ** argv ) {
417417
the updates don't get incorrectly applied. */
418418

419419
stake_delegations = fd_bank_stake_delegations_delta_locking_modify( bank3 );
420-
fd_stake_delegations_update( stake_delegations, &key_2, &key_7, 10UL, 100UL, 100UL, 100UL, 100UL );
420+
fd_stake_delegations_update( stake_delegations, &key_2, &key_7, 10UL, 100UL, 100UL, 100UL, 0.09 );
421421
FD_TEST( fd_stake_delegations_cnt( stake_delegations ) == 1UL );
422422
stake_delegation = fd_stake_delegations_query( stake_delegations, &key_2 );
423423
FD_TEST( stake_delegation );
@@ -483,7 +483,7 @@ main( int argc, char ** argv ) {
483483
FD_TEST( fd_bank_capitalization_get( bank7 ) == 2100UL );
484484

485485
stake_delegations = fd_bank_stake_delegations_delta_locking_modify( bank7 );
486-
fd_stake_delegations_update( stake_delegations, &key_3, &key_6, 7UL, 100UL, 100UL, 100UL, 100UL );
486+
fd_stake_delegations_update( stake_delegations, &key_3, &key_6, 7UL, 100UL, 100UL, 100UL, 0.09 );
487487
stake_delegation = fd_stake_delegations_query( stake_delegations, &key_3 );
488488
FD_TEST( stake_delegation );
489489
FD_TEST( stake_delegation->stake == 7UL );
@@ -516,7 +516,7 @@ main( int argc, char ** argv ) {
516516
FD_TEST( fd_bank_capitalization_get( bank8 ) == 2100UL );
517517

518518
stake_delegations = fd_bank_stake_delegations_delta_locking_modify( bank8 );
519-
fd_stake_delegations_update( stake_delegations, &key_4, &key_5, 4UL, 100UL, 100UL, 100UL, 100UL );
519+
fd_stake_delegations_update( stake_delegations, &key_4, &key_5, 4UL, 100UL, 100UL, 100UL, 0.09 );
520520
fd_bank_stake_delegations_delta_end_locking_modify( bank8 );
521521

522522
stake_delegations = fd_bank_stake_delegations_frontier_query( banks, bank8 );

src/flamenco/stakes/fd_stake_delegations.c

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
#include "../accdb/fd_accdb_pipe.h"
33
#include "../runtime/program/fd_stake_program.h"
44

5-
#define POOL_NAME fd_stake_delegation_pool
6-
#define POOL_T fd_stake_delegation_t
7-
#define POOL_NEXT next_
5+
#define POOL_NAME fd_stake_delegation_pool
6+
#define POOL_T fd_stake_delegation_t
7+
#define POOL_NEXT next_
8+
#define POOL_IDX_T uint
89
#include "../../util/tmpl/fd_pool.c"
910

1011
#define MAP_NAME fd_stake_delegation_map
@@ -14,8 +15,20 @@
1415
#define MAP_KEY_EQ(k0,k1) (fd_pubkey_eq( k0, k1 ))
1516
#define MAP_KEY_HASH(key,seed) (fd_funk_rec_key_hash1( key->uc, seed ))
1617
#define MAP_NEXT next_
18+
#define MAP_IDX_T uint
1719
#include "../../util/tmpl/fd_map_chain.c"
1820

21+
static inline uchar
22+
fd_stake_delegations_warmup_cooldown_rate_enum( double warmup_cooldown_rate ) {
23+
if( FD_LIKELY( warmup_cooldown_rate == FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_025 ) ) {
24+
return FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_ENUM_025;
25+
} else if( FD_LIKELY( warmup_cooldown_rate == FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_009 ) ) {
26+
return FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_ENUM_009;
27+
} else {
28+
FD_LOG_CRIT(( "Invalid warmup cooldown rate %f", warmup_cooldown_rate ));
29+
}
30+
}
31+
1932
static inline fd_stake_delegation_t *
2033
fd_stake_delegations_get_pool( fd_stake_delegations_t const * stake_delegations ) {
2134
return fd_stake_delegation_pool_join( (uchar *)stake_delegations + stake_delegations->pool_offset_ );
@@ -227,10 +240,10 @@ fd_stake_delegations_update( fd_stake_delegations_t * stake_delegations,
227240
ulong idx = fd_stake_delegation_map_idx_query_const(
228241
stake_delegation_map,
229242
stake_account,
230-
ULONG_MAX,
243+
UINT_MAX,
231244
stake_delegation_pool );
232245

233-
if( idx!=ULONG_MAX ) {
246+
if( idx!=UINT_MAX ) {
234247

235248
fd_stake_delegation_t * stake_delegation = fd_stake_delegation_pool_ele( stake_delegation_pool, idx );
236249
if( FD_UNLIKELY( !stake_delegation ) ) {
@@ -239,10 +252,10 @@ fd_stake_delegations_update( fd_stake_delegations_t * stake_delegations,
239252

240253
stake_delegation->vote_account = *vote_account;
241254
stake_delegation->stake = stake;
242-
stake_delegation->activation_epoch = activation_epoch;
243-
stake_delegation->deactivation_epoch = deactivation_epoch;
255+
stake_delegation->activation_epoch = (ushort)fd_ulong_min( activation_epoch, USHORT_MAX );
256+
stake_delegation->deactivation_epoch = (ushort)fd_ulong_min( deactivation_epoch, USHORT_MAX );
244257
stake_delegation->credits_observed = credits_observed;
245-
stake_delegation->warmup_cooldown_rate = warmup_cooldown_rate;
258+
stake_delegation->warmup_cooldown_rate = fd_stake_delegations_warmup_cooldown_rate_enum( warmup_cooldown_rate );
246259
stake_delegation->is_tombstone = 0;
247260
return;
248261
}
@@ -257,10 +270,10 @@ fd_stake_delegations_update( fd_stake_delegations_t * stake_delegations,
257270
stake_delegation->stake_account = *stake_account;
258271
stake_delegation->vote_account = *vote_account;
259272
stake_delegation->stake = stake;
260-
stake_delegation->activation_epoch = activation_epoch;
261-
stake_delegation->deactivation_epoch = deactivation_epoch;
273+
stake_delegation->activation_epoch = (ushort)fd_ulong_min( activation_epoch, USHORT_MAX );
274+
stake_delegation->deactivation_epoch = (ushort)fd_ulong_min( deactivation_epoch, USHORT_MAX );
262275
stake_delegation->credits_observed = credits_observed;
263-
stake_delegation->warmup_cooldown_rate = warmup_cooldown_rate;
276+
stake_delegation->warmup_cooldown_rate = fd_stake_delegations_warmup_cooldown_rate_enum( warmup_cooldown_rate );
264277
stake_delegation->is_tombstone = 0;
265278

266279
if( FD_UNLIKELY( !fd_stake_delegation_map_ele_insert(
@@ -287,15 +300,15 @@ fd_stake_delegations_remove( fd_stake_delegations_t * stake_delegations,
287300
ulong delegation_idx = fd_stake_delegation_map_idx_query(
288301
stake_delegation_map,
289302
stake_account,
290-
ULONG_MAX,
303+
UINT_MAX,
291304
stake_delegation_pool );
292305

293306
if( stake_delegations->leave_tombstones_==1 ) {
294307
/* If we are configured to leave tombstones, we need to either
295308
update the entry's is_tombstone flag or insert a new entry. */
296309

297310
fd_stake_delegation_t * stake_delegation = NULL;
298-
if( delegation_idx!=ULONG_MAX ) {
311+
if( delegation_idx!=UINT_MAX ) {
299312
/* The delegation was found, update the is_tombstone flag. */
300313
stake_delegation = fd_stake_delegation_pool_ele( stake_delegation_pool, delegation_idx );
301314
} else {
@@ -310,7 +323,7 @@ fd_stake_delegations_remove( fd_stake_delegations_t * stake_delegations,
310323
} else {
311324
/* If we are not configured to leave tombstones, we need to remove
312325
the entry from the map and release it from the pool. */
313-
if( FD_UNLIKELY( delegation_idx == ULONG_MAX ) ) {
326+
if( FD_UNLIKELY( delegation_idx == UINT_MAX ) ) {
314327
/* The delegation was not found, nothing to do. */
315328
return;
316329
}
@@ -322,12 +335,12 @@ fd_stake_delegations_remove( fd_stake_delegations_t * stake_delegations,
322335
FD_LOG_CRIT(( "unable to retrieve stake delegation" ));
323336
}
324337

325-
ulong idx = fd_stake_delegation_map_idx_remove( stake_delegation_map, stake_account, ULONG_MAX, stake_delegation_pool );
326-
if( FD_UNLIKELY( idx==ULONG_MAX ) ) {
338+
ulong idx = fd_stake_delegation_map_idx_remove( stake_delegation_map, stake_account, UINT_MAX, stake_delegation_pool );
339+
if( FD_UNLIKELY( idx==UINT_MAX ) ) {
327340
FD_LOG_CRIT(( "unable to remove stake delegation" ));
328341
}
329342

330-
stake_delegation->next_ = fd_stake_delegation_pool_idx_null( stake_delegation_pool );
343+
stake_delegation->next_ = UINT_MAX;
331344

332345
fd_stake_delegation_pool_idx_release( stake_delegation_pool, delegation_idx );
333346
}
@@ -385,7 +398,7 @@ fd_stake_delegations_refresh( fd_stake_delegations_t * stake_delegations,
385398
continue; /* ok */
386399

387400
remove:
388-
fd_stake_delegation_map_idx_remove( map, address, ULONG_MAX, pool );
401+
fd_stake_delegation_map_idx_remove( map, address, UINT_MAX, pool );
389402
fd_stake_delegation_pool_ele_release( pool, delegation );
390403
}
391404
}

src/flamenco/stakes/fd_stake_delegations.h

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -60,47 +60,30 @@
6060
reward distribution.
6161
The stake accounts are read-only during the epoch boundary. */
6262

63-
/* The max number of stake accounts that can be modified in a current
64-
slot from transactions can be bounded based on CU consumption. The
65-
best strategy to maximize the max number of stake accounts modified
66-
in a single transaction. A stake program instruction can either
67-
modify one or two stake accounts. Stake program instructions that
68-
modify two stake accounts (merge/split) are assumed to be at least 2x
69-
as expensive as a stake program instruction that modifies one stake
70-
account. So we will assume that the most efficient strategy is to
71-
modify one stake account per instruction and have as many instruction
72-
as posssible in this transaction. We can have 63 stake program
73-
instructions in this transaction because one account will be the fee
74-
payer/signature and the other 63 are free to be writable accounts.
75-
76-
Given the above:
77-
100000000 - CUs per slot
78-
64 - Max number of writable accounts per transaction.
79-
63 - Max number of writable stake accounts per transaction.
80-
720 - Cost of a signature
81-
300 - Cost of a writable account lock.
82-
6000 - Cost of a stake program instruction.
83-
84-
We can have (100000000 / (720 + 300 * 64 + 6000 * 63)) = 251
85-
optimal stake program transactions per slot. With 63 stake accounts
86-
per transaction, we can have 251 * 63 = 15813 stake accounts modified
87-
in a slot. */
88-
89-
#define MAX_OPTIMAL_STAKE_ACCOUNTS_POSSIBLE_IN_TXN (FD_MAX_BLOCK_UNITS_SIMD_0286/(FD_WRITE_LOCK_UNITS * FD_RUNTIME_MAX_WRITABLE_ACCOUNTS_PER_TRANSACTION + FD_RUNTIME_MIN_STAKE_INSN_CUS * (FD_RUNTIME_MAX_WRITABLE_ACCOUNTS_PER_TRANSACTION - 1UL) + FD_PACK_COST_PER_SIGNATURE))
90-
FD_STATIC_ASSERT(MAX_OPTIMAL_STAKE_ACCOUNTS_POSSIBLE_IN_TXN==251, "Incorrect MAX_STAKE_ACCOUNTS_POSSIBLE_IN_TXN");
91-
#define MAX_STAKE_ACCOUNTS_POSSIBLE_IN_SLOT_FROM_TXNS (MAX_OPTIMAL_STAKE_ACCOUNTS_POSSIBLE_IN_TXN * (FD_RUNTIME_MAX_WRITABLE_ACCOUNTS_PER_TRANSACTION - 1UL))
92-
FD_STATIC_ASSERT(MAX_STAKE_ACCOUNTS_POSSIBLE_IN_SLOT_FROM_TXNS==15813, "Incorrect MAX_STAKE_ACCOUNTS_PER_SLOT");
63+
/* The max number of stake accounts that can be modified in a single
64+
slot from transactions can be conservatively bounded based on bounds
65+
set by the cost tracker: the max writable account CUs per slot. This
66+
bound is set at 12M CUs and each writable account costs 300 CUs.
67+
Very loosely this would give us 12M/300 = 40000 stake accounts per
68+
slot. A tighter bound can be found by considering the fee payer must
69+
be writable as well and can not be a stake account. We can have 64
70+
unique writable accounts per transaction. So the best utilization of
71+
transactions are ones where 63/64 stake accounts are writable. This
72+
gives us 40000 * 63/64 = 39375 stake accounts per slot. */
73+
74+
#define MAX_STAKE_ACCOUNTS_IN_SLOT_FROM_TXNS (FD_MAX_WRITABLE_ACCOUNT_UNITS/FD_PACK_COST_PER_WRITABLE_ACCT * (FD_RUNTIME_WRITABLE_ACCOUNTS_MAX - 1UL)/FD_RUNTIME_WRITABLE_ACCOUNTS_MAX)
75+
FD_STATIC_ASSERT( MAX_STAKE_ACCOUNTS_IN_SLOT_FROM_TXNS==39375UL, "Incorrect MAX_STAKE_ACCOUNTS_IN_SLOT_FROM_TXNS" );
9376

9477
/* The static footprint of fd_stake_delegations_t when it is a delta
9578
is determined by the max total number of stake accounts that can get
9679
changed in a single slot. Stake accounts can get modified in two ways:
97-
1. Through transactions. This bound is calculated using CU
98-
consumption as described above.
80+
1. Through transactions. This bound is calculated using CU bounds set
81+
by the cost tracker as described above.
9982
2. Through epoch rewards. This is a protocol-level bound is defined
10083
in fd_rewards_base.h and is the max number of stake accounts that
10184
can reside in a single reward partition. */
10285

103-
#define FD_STAKE_DELEGATIONS_MAX_PER_SLOT (MAX_STAKE_ACCOUNTS_POSSIBLE_IN_SLOT_FROM_TXNS + STAKE_ACCOUNT_STORES_PER_BLOCK)
86+
#define FD_STAKE_DELEGATIONS_MAX_PER_SLOT (MAX_STAKE_ACCOUNTS_IN_SLOT_FROM_TXNS + STAKE_ACCOUNT_STORES_PER_BLOCK)
10487

10588
/* The static footprint of the vote states assumes that there are
10689
FD_RUNTIME_MAX_STAKE_ACCOUNTS. It also assumes worst case alignment
@@ -132,7 +115,7 @@ FD_STATIC_ASSERT(MAX_STAKE_ACCOUNTS_POSSIBLE_IN_SLOT_FROM_TXNS==15813, "Incorrec
132115
stake delegation with up to ~19K delegations we have a total
133116
footprint of ~2.5MB. */
134117

135-
#define FD_STAKE_DELEGATIONS_DELTA_CHAIN_CNT_EST (16384UL)
118+
#define FD_STAKE_DELEGATIONS_DELTA_CHAIN_CNT_EST (32768UL)
136119
#define FD_STAKE_DELEGATIONS_DELTA_FOOTPRINT \
137120
/* First, layout the struct with alignment */ \
138121
sizeof(fd_stake_delegations_t) + alignof(fd_stake_delegations_t) + \
@@ -146,16 +129,22 @@ FD_STATIC_ASSERT(MAX_STAKE_ACCOUNTS_POSSIBLE_IN_SLOT_FROM_TXNS==15813, "Incorrec
146129

147130
#define FD_STAKE_DELEGATIONS_ALIGN (128UL)
148131

132+
#define FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_ENUM_025 (0)
133+
#define FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_ENUM_009 (1)
134+
#define FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_025 (0.25)
135+
#define FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_009 (0.09)
136+
137+
149138
struct fd_stake_delegation {
150139
fd_pubkey_t stake_account;
151140
fd_pubkey_t vote_account;
152-
ulong next_; /* Only for internal pool/map usage */
153141
ulong stake;
154-
ulong activation_epoch;
155-
ulong deactivation_epoch;
156142
ulong credits_observed;
157-
double warmup_cooldown_rate;
158-
int is_tombstone;
143+
uint next_; /* Only for internal pool/map usage */
144+
ushort activation_epoch;
145+
ushort deactivation_epoch;
146+
uchar is_tombstone;
147+
uchar warmup_cooldown_rate; /* enum representing 0.25 or 0.09 */
159148
};
160149
typedef struct fd_stake_delegation fd_stake_delegation_t;
161150

@@ -180,6 +169,11 @@ typedef struct fd_stake_delegations_iter fd_stake_delegations_iter_t;
180169

181170
FD_PROTOTYPES_BEGIN
182171

172+
static inline double
173+
fd_stake_delegations_warmup_cooldown_rate_to_double( uchar warmup_cooldown_rate ) {
174+
return warmup_cooldown_rate == FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_ENUM_025 ? FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_025 : FD_STAKE_DELEGATIONS_WARMUP_COOLDOWN_RATE_009;
175+
}
176+
183177
/* fd_stake_delegations_align returns the alignment of the stake
184178
delegations struct. */
185179

src/flamenco/stakes/fd_stakes.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ fd_refresh_vote_accounts( fd_bank_t * bank,
5959
fd_delegation_t delegation = {
6060
.voter_pubkey = stake_delegation->vote_account,
6161
.stake = stake_delegation->stake,
62-
.deactivation_epoch = stake_delegation->deactivation_epoch,
63-
.activation_epoch = stake_delegation->activation_epoch,
64-
.warmup_cooldown_rate = stake_delegation->warmup_cooldown_rate,
62+
.deactivation_epoch = stake_delegation->deactivation_epoch==USHORT_MAX ? ULONG_MAX : stake_delegation->deactivation_epoch,
63+
.activation_epoch = stake_delegation->activation_epoch==USHORT_MAX ? ULONG_MAX : stake_delegation->activation_epoch,
64+
.warmup_cooldown_rate = fd_stake_delegations_warmup_cooldown_rate_to_double( stake_delegation->warmup_cooldown_rate ),
6565
};
6666

6767
fd_stake_history_entry_t new_entry = fd_stake_activating_and_deactivating(
@@ -120,9 +120,9 @@ fd_stakes_activate_epoch( fd_bank_t * bank,
120120
fd_delegation_t delegation = {
121121
.voter_pubkey = stake_delegation->vote_account,
122122
.stake = stake_delegation->stake,
123-
.activation_epoch = stake_delegation->activation_epoch,
124-
.deactivation_epoch = stake_delegation->deactivation_epoch,
125-
.warmup_cooldown_rate = stake_delegation->warmup_cooldown_rate,
123+
.activation_epoch = stake_delegation->activation_epoch==USHORT_MAX ? ULONG_MAX : stake_delegation->activation_epoch,
124+
.deactivation_epoch = stake_delegation->deactivation_epoch==USHORT_MAX ? ULONG_MAX : stake_delegation->deactivation_epoch,
125+
.warmup_cooldown_rate = fd_stake_delegations_warmup_cooldown_rate_to_double( stake_delegation->warmup_cooldown_rate ),
126126
};
127127

128128
fd_stake_history_entry_t new_entry = fd_stake_activating_and_deactivating(

0 commit comments

Comments
 (0)