Line data Source code
1 : // This is an auto-generated file. To add entries, edit fd_types.json
2 : #ifndef HEADER_FUZZ_FD_RUNTIME_TYPES
3 : #define HEADER_FUZZ_FD_RUNTIME_TYPES
4 :
5 : #pragma GCC diagnostic ignored "-Wunused-parameter"
6 : #pragma GCC diagnostic ignored "-Wunused-variable"
7 : #define SOURCE_fd_src_flamenco_types_fd_types_c
8 : #include "fd_types.h"
9 : #include "fd_types_custom.h"
10 :
11 : size_t LLVMFuzzerMutate(uchar *data, size_t size, size_t max_size);
12 :
13 0 : void *fd_hash_generate(void *mem, void **alloc_mem, fd_rng_t * rng) {
14 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_hash_t);
15 0 : fd_hash_new(mem);
16 0 : LLVMFuzzerMutate( (uchar *) mem, sizeof(fd_hash_t), sizeof(fd_hash_t));
17 0 : return mem;
18 0 : }
19 :
20 0 : void *fd_pubkey_generate(void *mem, void **alloc_mem, fd_rng_t * rng) {
21 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_pubkey_t);
22 0 : fd_pubkey_new(mem);
23 0 : LLVMFuzzerMutate( (uchar *) mem, sizeof(fd_pubkey_t), sizeof(fd_pubkey_t));
24 0 : return mem;
25 0 : }
26 :
27 0 : void *fd_signature_generate(void *mem, void **alloc_mem, fd_rng_t * rng) {
28 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_signature_t);
29 0 : fd_signature_new(mem);
30 0 : LLVMFuzzerMutate( (uchar *) mem, sizeof(fd_signature_t), sizeof(fd_signature_t));
31 0 : return mem;
32 0 : }
33 :
34 0 : void *fd_feature_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
35 0 : fd_feature_t *self = (fd_feature_t *) mem;
36 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_feature_t);
37 0 : fd_feature_new(mem);
38 0 : {
39 0 : self->has_activated_at = fd_rng_uchar( rng ) % 2;
40 0 : if( self->has_activated_at ) {
41 0 : LLVMFuzzerMutate( (uchar *)&(self->activated_at), sizeof(ulong), sizeof(ulong) );
42 0 : }
43 0 : }
44 0 : return mem;
45 0 : }
46 :
47 0 : void *fd_fee_calculator_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
48 0 : fd_fee_calculator_t *self = (fd_fee_calculator_t *) mem;
49 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_fee_calculator_t);
50 0 : fd_fee_calculator_new(mem);
51 0 : self->lamports_per_signature = fd_rng_ulong( rng );
52 0 : return mem;
53 0 : }
54 :
55 0 : void *fd_fee_rate_governor_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
56 0 : fd_fee_rate_governor_t *self = (fd_fee_rate_governor_t *) mem;
57 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_fee_rate_governor_t);
58 0 : fd_fee_rate_governor_new(mem);
59 0 : self->target_lamports_per_signature = fd_rng_ulong( rng );
60 0 : self->target_signatures_per_slot = fd_rng_ulong( rng );
61 0 : self->min_lamports_per_signature = fd_rng_ulong( rng );
62 0 : self->max_lamports_per_signature = fd_rng_ulong( rng );
63 0 : self->burn_percent = fd_rng_uchar( rng );
64 0 : return mem;
65 0 : }
66 :
67 0 : void *fd_slot_pair_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
68 0 : fd_slot_pair_t *self = (fd_slot_pair_t *) mem;
69 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_slot_pair_t);
70 0 : fd_slot_pair_new(mem);
71 0 : self->slot = fd_rng_ulong( rng );
72 0 : self->val = fd_rng_ulong( rng );
73 0 : return mem;
74 0 : }
75 :
76 0 : void *fd_hard_forks_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
77 0 : fd_hard_forks_t *self = (fd_hard_forks_t *) mem;
78 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_hard_forks_t);
79 0 : fd_hard_forks_new(mem);
80 0 : self->hard_forks_len = fd_rng_ulong( rng ) % 8;
81 0 : if( self->hard_forks_len ) {
82 0 : self->hard_forks = (fd_slot_pair_t *) *alloc_mem;
83 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_slot_pair_t)*self->hard_forks_len;
84 0 : for( ulong i=0; i < self->hard_forks_len; i++ ) {
85 0 : fd_slot_pair_new( self->hard_forks + i );
86 0 : fd_slot_pair_generate( self->hard_forks + i, alloc_mem, rng );
87 0 : }
88 0 : } else {
89 0 : self->hard_forks = NULL;
90 0 : }
91 0 : return mem;
92 0 : }
93 :
94 0 : void *fd_inflation_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
95 0 : fd_inflation_t *self = (fd_inflation_t *) mem;
96 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_inflation_t);
97 0 : fd_inflation_new(mem);
98 0 : self->initial = fd_rng_double_o( rng );
99 0 : self->terminal = fd_rng_double_o( rng );
100 0 : self->taper = fd_rng_double_o( rng );
101 0 : self->foundation = fd_rng_double_o( rng );
102 0 : self->foundation_term = fd_rng_double_o( rng );
103 0 : self->unused = fd_rng_double_o( rng );
104 0 : return mem;
105 0 : }
106 :
107 0 : void *fd_rent_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
108 0 : fd_rent_t *self = (fd_rent_t *) mem;
109 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_rent_t);
110 0 : fd_rent_new(mem);
111 0 : self->lamports_per_uint8_year = fd_rng_ulong( rng );
112 0 : self->exemption_threshold = fd_rng_double_o( rng );
113 0 : self->burn_percent = fd_rng_uchar( rng );
114 0 : return mem;
115 0 : }
116 :
117 0 : void *fd_epoch_schedule_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
118 0 : fd_epoch_schedule_t *self = (fd_epoch_schedule_t *) mem;
119 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_epoch_schedule_t);
120 0 : fd_epoch_schedule_new(mem);
121 0 : self->slots_per_epoch = fd_rng_ulong( rng );
122 0 : self->leader_schedule_slot_offset = fd_rng_ulong( rng );
123 0 : self->warmup = fd_rng_uchar( rng );
124 0 : self->first_normal_epoch = fd_rng_ulong( rng );
125 0 : self->first_normal_slot = fd_rng_ulong( rng );
126 0 : return mem;
127 0 : }
128 :
129 0 : void *fd_rent_collector_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
130 0 : fd_rent_collector_t *self = (fd_rent_collector_t *) mem;
131 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_rent_collector_t);
132 0 : fd_rent_collector_new(mem);
133 0 : self->epoch = fd_rng_ulong( rng );
134 0 : fd_epoch_schedule_generate( &self->epoch_schedule, alloc_mem, rng );
135 0 : self->slots_per_year = fd_rng_double_o( rng );
136 0 : fd_rent_generate( &self->rent, alloc_mem, rng );
137 0 : return mem;
138 0 : }
139 :
140 0 : void *fd_stake_history_entry_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
141 0 : fd_stake_history_entry_t *self = (fd_stake_history_entry_t *) mem;
142 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_history_entry_t);
143 0 : fd_stake_history_entry_new(mem);
144 0 : self->effective = fd_rng_ulong( rng );
145 0 : self->activating = fd_rng_ulong( rng );
146 0 : self->deactivating = fd_rng_ulong( rng );
147 0 : return mem;
148 0 : }
149 :
150 0 : void *fd_epoch_stake_history_entry_pair_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
151 0 : fd_epoch_stake_history_entry_pair_t *self = (fd_epoch_stake_history_entry_pair_t *) mem;
152 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_epoch_stake_history_entry_pair_t);
153 0 : fd_epoch_stake_history_entry_pair_new(mem);
154 0 : self->epoch = fd_rng_ulong( rng );
155 0 : fd_stake_history_entry_generate( &self->entry, alloc_mem, rng );
156 0 : return mem;
157 0 : }
158 :
159 0 : void *fd_stake_history_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
160 0 : fd_stake_history_t *self = (fd_stake_history_t *) mem;
161 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_history_t);
162 0 : fd_stake_history_new(mem);
163 0 : self->fd_stake_history_len = fd_rng_ulong( rng ) % 8;
164 0 : self->fd_stake_history_size = 512;
165 0 : self->fd_stake_history_offset = 0;
166 0 : for( ulong i=0; i<self->fd_stake_history_len; i++ ) {
167 0 : fd_epoch_stake_history_entry_pair_generate( self->fd_stake_history + i, alloc_mem, rng );
168 0 : }
169 0 : return mem;
170 0 : }
171 :
172 0 : void *fd_solana_account_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
173 0 : fd_solana_account_t *self = (fd_solana_account_t *) mem;
174 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_solana_account_t);
175 0 : fd_solana_account_new(mem);
176 0 : self->lamports = fd_rng_ulong( rng );
177 0 : self->data_len = fd_rng_ulong( rng ) % 8;
178 0 : if( self->data_len ) {
179 0 : self->data = (uchar *) *alloc_mem;
180 0 : *alloc_mem = (uchar *) *alloc_mem + self->data_len;
181 0 : for( ulong i=0; i < self->data_len; ++i) { self->data[i] = fd_rng_uchar( rng ) % 0x80; }
182 0 : } else {
183 0 : self->data = NULL;
184 0 : }
185 0 : fd_pubkey_generate( &self->owner, alloc_mem, rng );
186 0 : self->executable = fd_rng_uchar( rng );
187 0 : self->rent_epoch = fd_rng_ulong( rng );
188 0 : return mem;
189 0 : }
190 :
191 0 : void *fd_delegation_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
192 0 : fd_delegation_t *self = (fd_delegation_t *) mem;
193 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_delegation_t);
194 0 : fd_delegation_new(mem);
195 0 : fd_pubkey_generate( &self->voter_pubkey, alloc_mem, rng );
196 0 : self->stake = fd_rng_ulong( rng );
197 0 : self->activation_epoch = fd_rng_ulong( rng );
198 0 : self->deactivation_epoch = fd_rng_ulong( rng );
199 0 : self->warmup_cooldown_rate = fd_rng_double_o( rng );
200 0 : return mem;
201 0 : }
202 :
203 0 : void *fd_stake_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
204 0 : fd_stake_t *self = (fd_stake_t *) mem;
205 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_t);
206 0 : fd_stake_new(mem);
207 0 : fd_delegation_generate( &self->delegation, alloc_mem, rng );
208 0 : self->credits_observed = fd_rng_ulong( rng );
209 0 : return mem;
210 0 : }
211 :
212 0 : void *fd_rust_duration_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
213 0 : fd_rust_duration_t *self = (fd_rust_duration_t *) mem;
214 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_rust_duration_t);
215 0 : fd_rust_duration_new(mem);
216 0 : self->seconds = fd_rng_ulong( rng );
217 0 : self->nanoseconds = fd_rng_uint( rng );
218 0 : return mem;
219 0 : }
220 :
221 0 : void *fd_poh_config_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
222 0 : fd_poh_config_t *self = (fd_poh_config_t *) mem;
223 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_poh_config_t);
224 0 : fd_poh_config_new(mem);
225 0 : fd_rust_duration_generate( &self->target_tick_duration, alloc_mem, rng );
226 0 : {
227 0 : self->has_target_tick_count = fd_rng_uchar( rng ) % 2;
228 0 : if( self->has_target_tick_count ) {
229 0 : LLVMFuzzerMutate( (uchar *)&(self->target_tick_count), sizeof(ulong), sizeof(ulong) );
230 0 : }
231 0 : }
232 0 : {
233 0 : self->has_hashes_per_tick = fd_rng_uchar( rng ) % 2;
234 0 : if( self->has_hashes_per_tick ) {
235 0 : LLVMFuzzerMutate( (uchar *)&(self->hashes_per_tick), sizeof(ulong), sizeof(ulong) );
236 0 : }
237 0 : }
238 0 : return mem;
239 0 : }
240 :
241 0 : void *fd_string_pubkey_pair_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
242 0 : fd_string_pubkey_pair_t *self = (fd_string_pubkey_pair_t *) mem;
243 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_string_pubkey_pair_t);
244 0 : fd_string_pubkey_pair_new(mem);
245 0 : self->string_len = fd_rng_ulong( rng ) % 8;
246 0 : if( self->string_len ) {
247 0 : self->string = (uchar *) *alloc_mem;
248 0 : *alloc_mem = (uchar *) *alloc_mem + self->string_len;
249 0 : for( ulong i=0; i < self->string_len; ++i) { self->string[i] = fd_rng_uchar( rng ) % 0x80; }
250 0 : } else {
251 0 : self->string = NULL;
252 0 : }
253 0 : fd_pubkey_generate( &self->pubkey, alloc_mem, rng );
254 0 : return mem;
255 0 : }
256 :
257 0 : void *fd_pubkey_account_pair_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
258 0 : fd_pubkey_account_pair_t *self = (fd_pubkey_account_pair_t *) mem;
259 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_pubkey_account_pair_t);
260 0 : fd_pubkey_account_pair_new(mem);
261 0 : fd_pubkey_generate( &self->key, alloc_mem, rng );
262 0 : fd_solana_account_generate( &self->account, alloc_mem, rng );
263 0 : return mem;
264 0 : }
265 :
266 0 : void *fd_genesis_solana_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
267 0 : fd_genesis_solana_t *self = (fd_genesis_solana_t *) mem;
268 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_genesis_solana_t);
269 0 : fd_genesis_solana_new(mem);
270 0 : self->creation_time = fd_rng_ulong( rng );
271 0 : self->accounts_len = fd_rng_ulong( rng ) % 8;
272 0 : if( self->accounts_len ) {
273 0 : self->accounts = (fd_pubkey_account_pair_t *) *alloc_mem;
274 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_pubkey_account_pair_t)*self->accounts_len;
275 0 : for( ulong i=0; i < self->accounts_len; i++ ) {
276 0 : fd_pubkey_account_pair_new( self->accounts + i );
277 0 : fd_pubkey_account_pair_generate( self->accounts + i, alloc_mem, rng );
278 0 : }
279 0 : } else {
280 0 : self->accounts = NULL;
281 0 : }
282 0 : self->native_instruction_processors_len = fd_rng_ulong( rng ) % 8;
283 0 : if( self->native_instruction_processors_len ) {
284 0 : self->native_instruction_processors = (fd_string_pubkey_pair_t *) *alloc_mem;
285 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_string_pubkey_pair_t)*self->native_instruction_processors_len;
286 0 : for( ulong i=0; i < self->native_instruction_processors_len; i++ ) {
287 0 : fd_string_pubkey_pair_new( self->native_instruction_processors + i );
288 0 : fd_string_pubkey_pair_generate( self->native_instruction_processors + i, alloc_mem, rng );
289 0 : }
290 0 : } else {
291 0 : self->native_instruction_processors = NULL;
292 0 : }
293 0 : self->rewards_pools_len = fd_rng_ulong( rng ) % 8;
294 0 : if( self->rewards_pools_len ) {
295 0 : self->rewards_pools = (fd_pubkey_account_pair_t *) *alloc_mem;
296 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_pubkey_account_pair_t)*self->rewards_pools_len;
297 0 : for( ulong i=0; i < self->rewards_pools_len; i++ ) {
298 0 : fd_pubkey_account_pair_new( self->rewards_pools + i );
299 0 : fd_pubkey_account_pair_generate( self->rewards_pools + i, alloc_mem, rng );
300 0 : }
301 0 : } else {
302 0 : self->rewards_pools = NULL;
303 0 : }
304 0 : self->ticks_per_slot = fd_rng_ulong( rng );
305 0 : self->unused = fd_rng_ulong( rng );
306 0 : fd_poh_config_generate( &self->poh_config, alloc_mem, rng );
307 0 : self->__backwards_compat_with_v0_23 = fd_rng_ulong( rng );
308 0 : fd_fee_rate_governor_generate( &self->fee_rate_governor, alloc_mem, rng );
309 0 : fd_rent_generate( &self->rent, alloc_mem, rng );
310 0 : fd_inflation_generate( &self->inflation, alloc_mem, rng );
311 0 : fd_epoch_schedule_generate( &self->epoch_schedule, alloc_mem, rng );
312 0 : self->cluster_type = fd_rng_uint( rng );
313 0 : return mem;
314 0 : }
315 :
316 0 : void *fd_sol_sysvar_clock_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
317 0 : fd_sol_sysvar_clock_t *self = (fd_sol_sysvar_clock_t *) mem;
318 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_sol_sysvar_clock_t);
319 0 : fd_sol_sysvar_clock_new(mem);
320 0 : self->slot = fd_rng_ulong( rng );
321 0 : self->epoch_start_timestamp = fd_rng_long( rng );
322 0 : self->epoch = fd_rng_ulong( rng );
323 0 : self->leader_schedule_epoch = fd_rng_ulong( rng );
324 0 : self->unix_timestamp = fd_rng_long( rng );
325 0 : return mem;
326 0 : }
327 :
328 0 : void *fd_sol_sysvar_last_restart_slot_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
329 0 : fd_sol_sysvar_last_restart_slot_t *self = (fd_sol_sysvar_last_restart_slot_t *) mem;
330 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_sol_sysvar_last_restart_slot_t);
331 0 : fd_sol_sysvar_last_restart_slot_new(mem);
332 0 : self->slot = fd_rng_ulong( rng );
333 0 : return mem;
334 0 : }
335 :
336 0 : void *fd_vote_lockout_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
337 0 : fd_vote_lockout_t *self = (fd_vote_lockout_t *) mem;
338 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_lockout_t);
339 0 : fd_vote_lockout_new(mem);
340 0 : self->slot = fd_rng_ulong( rng );
341 0 : self->confirmation_count = fd_rng_uint( rng );
342 0 : return mem;
343 0 : }
344 :
345 0 : void *fd_lockout_offset_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
346 0 : fd_lockout_offset_t *self = (fd_lockout_offset_t *) mem;
347 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_lockout_offset_t);
348 0 : fd_lockout_offset_new(mem);
349 0 : self->offset = fd_rng_ulong( rng );
350 0 : self->confirmation_count = fd_rng_uchar( rng );
351 0 : return mem;
352 0 : }
353 :
354 0 : void *fd_vote_authorized_voter_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
355 0 : fd_vote_authorized_voter_t *self = (fd_vote_authorized_voter_t *) mem;
356 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_authorized_voter_t);
357 0 : fd_vote_authorized_voter_new(mem);
358 0 : self->epoch = fd_rng_ulong( rng );
359 0 : fd_pubkey_generate( &self->pubkey, alloc_mem, rng );
360 0 : self->parent = fd_rng_ulong( rng );
361 0 : self->left = fd_rng_ulong( rng );
362 0 : self->right = fd_rng_ulong( rng );
363 0 : self->prio = fd_rng_ulong( rng );
364 0 : return mem;
365 0 : }
366 :
367 0 : void *fd_vote_prior_voter_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
368 0 : fd_vote_prior_voter_t *self = (fd_vote_prior_voter_t *) mem;
369 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_prior_voter_t);
370 0 : fd_vote_prior_voter_new(mem);
371 0 : fd_pubkey_generate( &self->pubkey, alloc_mem, rng );
372 0 : self->epoch_start = fd_rng_ulong( rng );
373 0 : self->epoch_end = fd_rng_ulong( rng );
374 0 : return mem;
375 0 : }
376 :
377 0 : void *fd_vote_prior_voter_0_23_5_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
378 0 : fd_vote_prior_voter_0_23_5_t *self = (fd_vote_prior_voter_0_23_5_t *) mem;
379 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_prior_voter_0_23_5_t);
380 0 : fd_vote_prior_voter_0_23_5_new(mem);
381 0 : fd_pubkey_generate( &self->pubkey, alloc_mem, rng );
382 0 : self->epoch_start = fd_rng_ulong( rng );
383 0 : self->epoch_end = fd_rng_ulong( rng );
384 0 : self->slot = fd_rng_ulong( rng );
385 0 : return mem;
386 0 : }
387 :
388 0 : void *fd_vote_epoch_credits_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
389 0 : fd_vote_epoch_credits_t *self = (fd_vote_epoch_credits_t *) mem;
390 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_epoch_credits_t);
391 0 : fd_vote_epoch_credits_new(mem);
392 0 : self->epoch = fd_rng_ulong( rng );
393 0 : self->credits = fd_rng_ulong( rng );
394 0 : self->prev_credits = fd_rng_ulong( rng );
395 0 : return mem;
396 0 : }
397 :
398 0 : void *fd_vote_block_timestamp_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
399 0 : fd_vote_block_timestamp_t *self = (fd_vote_block_timestamp_t *) mem;
400 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_block_timestamp_t);
401 0 : fd_vote_block_timestamp_new(mem);
402 0 : self->slot = fd_rng_ulong( rng );
403 0 : self->timestamp = fd_rng_long( rng );
404 0 : return mem;
405 0 : }
406 :
407 0 : void *fd_vote_prior_voters_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
408 0 : fd_vote_prior_voters_t *self = (fd_vote_prior_voters_t *) mem;
409 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_prior_voters_t);
410 0 : fd_vote_prior_voters_new(mem);
411 0 : for( ulong i=0; i<32; i++ ) {
412 0 : fd_vote_prior_voter_generate( self->buf + i, alloc_mem, rng );
413 0 : }
414 0 : self->idx = fd_rng_ulong( rng );
415 0 : self->is_empty = fd_rng_uchar( rng );
416 0 : return mem;
417 0 : }
418 :
419 0 : void *fd_vote_prior_voters_0_23_5_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
420 0 : fd_vote_prior_voters_0_23_5_t *self = (fd_vote_prior_voters_0_23_5_t *) mem;
421 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_prior_voters_0_23_5_t);
422 0 : fd_vote_prior_voters_0_23_5_new(mem);
423 0 : for( ulong i=0; i<32; i++ ) {
424 0 : fd_vote_prior_voter_0_23_5_generate( self->buf + i, alloc_mem, rng );
425 0 : }
426 0 : self->idx = fd_rng_ulong( rng );
427 0 : return mem;
428 0 : }
429 :
430 0 : void *fd_landed_vote_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
431 0 : fd_landed_vote_t *self = (fd_landed_vote_t *) mem;
432 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_landed_vote_t);
433 0 : fd_landed_vote_new(mem);
434 0 : self->latency = fd_rng_uchar( rng );
435 0 : fd_vote_lockout_generate( &self->lockout, alloc_mem, rng );
436 0 : return mem;
437 0 : }
438 :
439 0 : void *fd_vote_state_0_23_5_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
440 0 : fd_vote_state_0_23_5_t *self = (fd_vote_state_0_23_5_t *) mem;
441 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_state_0_23_5_t);
442 0 : fd_vote_state_0_23_5_new(mem);
443 0 : fd_pubkey_generate( &self->node_pubkey, alloc_mem, rng );
444 0 : fd_pubkey_generate( &self->authorized_voter, alloc_mem, rng );
445 0 : self->authorized_voter_epoch = fd_rng_ulong( rng );
446 0 : fd_vote_prior_voters_0_23_5_generate( &self->prior_voters, alloc_mem, rng );
447 0 : fd_pubkey_generate( &self->authorized_withdrawer, alloc_mem, rng );
448 0 : self->commission = fd_rng_uchar( rng );
449 0 : ulong votes_len = fd_rng_ulong( rng ) % 8;
450 0 : ulong votes_max = fd_ulong_max( votes_len, 32 );
451 0 : self->votes = deq_fd_vote_lockout_t_join_new( alloc_mem, votes_max );
452 0 : for( ulong i=0; i < votes_len; i++ ) {
453 0 : fd_vote_lockout_t * elem = deq_fd_vote_lockout_t_push_tail_nocopy( self->votes );
454 0 : fd_vote_lockout_generate( elem, alloc_mem, rng );
455 0 : }
456 0 : {
457 0 : self->has_root_slot = fd_rng_uchar( rng ) % 2;
458 0 : if( self->has_root_slot ) {
459 0 : LLVMFuzzerMutate( (uchar *)&(self->root_slot), sizeof(ulong), sizeof(ulong) );
460 0 : }
461 0 : }
462 0 : ulong epoch_credits_len = fd_rng_ulong( rng ) % 8;
463 0 : ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
464 0 : self->epoch_credits = deq_fd_vote_epoch_credits_t_join_new( alloc_mem, epoch_credits_max );
465 0 : for( ulong i=0; i < epoch_credits_len; i++ ) {
466 0 : fd_vote_epoch_credits_t * elem = deq_fd_vote_epoch_credits_t_push_tail_nocopy( self->epoch_credits );
467 0 : fd_vote_epoch_credits_generate( elem, alloc_mem, rng );
468 0 : }
469 0 : fd_vote_block_timestamp_generate( &self->last_timestamp, alloc_mem, rng );
470 0 : return mem;
471 0 : }
472 :
473 0 : void *fd_vote_authorized_voters_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
474 0 : fd_vote_authorized_voters_t *self = (fd_vote_authorized_voters_t *) mem;
475 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_authorized_voters_t);
476 0 : fd_vote_authorized_voters_new(mem);
477 0 : ulong fd_vote_authorized_voters_treap_len = fd_rng_ulong( rng ) % 8;
478 0 : ulong fd_vote_authorized_voters_treap_max = fd_ulong_max( fd_vote_authorized_voters_treap_len, FD_VOTE_AUTHORIZED_VOTERS_MIN );
479 0 : self->pool = fd_vote_authorized_voters_pool_join_new( alloc_mem, fd_vote_authorized_voters_treap_max );
480 0 : self->treap = fd_vote_authorized_voters_treap_join_new( alloc_mem, fd_vote_authorized_voters_treap_max );
481 0 : for( ulong i=0; i < fd_vote_authorized_voters_treap_len; i++ ) {
482 0 : fd_vote_authorized_voter_t * ele = fd_vote_authorized_voters_pool_ele_acquire( self->pool );
483 0 : fd_vote_authorized_voter_generate( ele, alloc_mem, rng );
484 0 : fd_vote_authorized_voter_t * repeated_entry = fd_vote_authorized_voters_treap_ele_query( self->treap, ele->epoch, self->pool );
485 0 : if( repeated_entry ) {
486 0 : fd_vote_authorized_voters_treap_ele_remove( self->treap, repeated_entry, self->pool ); // Remove the element before inserting it back to avoid duplication
487 0 : fd_vote_authorized_voters_pool_ele_release( self->pool, repeated_entry );
488 0 : }
489 0 : fd_vote_authorized_voters_treap_ele_insert( self->treap, ele, self->pool ); /* this cannot fail */
490 0 : }
491 0 : return mem;
492 0 : }
493 :
494 0 : void *fd_vote_state_1_14_11_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
495 0 : fd_vote_state_1_14_11_t *self = (fd_vote_state_1_14_11_t *) mem;
496 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_state_1_14_11_t);
497 0 : fd_vote_state_1_14_11_new(mem);
498 0 : fd_pubkey_generate( &self->node_pubkey, alloc_mem, rng );
499 0 : fd_pubkey_generate( &self->authorized_withdrawer, alloc_mem, rng );
500 0 : self->commission = fd_rng_uchar( rng );
501 0 : ulong votes_len = fd_rng_ulong( rng ) % 8;
502 0 : ulong votes_max = fd_ulong_max( votes_len, 32 );
503 0 : self->votes = deq_fd_vote_lockout_t_join_new( alloc_mem, votes_max );
504 0 : for( ulong i=0; i < votes_len; i++ ) {
505 0 : fd_vote_lockout_t * elem = deq_fd_vote_lockout_t_push_tail_nocopy( self->votes );
506 0 : fd_vote_lockout_generate( elem, alloc_mem, rng );
507 0 : }
508 0 : {
509 0 : self->has_root_slot = fd_rng_uchar( rng ) % 2;
510 0 : if( self->has_root_slot ) {
511 0 : LLVMFuzzerMutate( (uchar *)&(self->root_slot), sizeof(ulong), sizeof(ulong) );
512 0 : }
513 0 : }
514 0 : fd_vote_authorized_voters_generate( &self->authorized_voters, alloc_mem, rng );
515 0 : fd_vote_prior_voters_generate( &self->prior_voters, alloc_mem, rng );
516 0 : ulong epoch_credits_len = fd_rng_ulong( rng ) % 8;
517 0 : ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
518 0 : self->epoch_credits = deq_fd_vote_epoch_credits_t_join_new( alloc_mem, epoch_credits_max );
519 0 : for( ulong i=0; i < epoch_credits_len; i++ ) {
520 0 : fd_vote_epoch_credits_t * elem = deq_fd_vote_epoch_credits_t_push_tail_nocopy( self->epoch_credits );
521 0 : fd_vote_epoch_credits_generate( elem, alloc_mem, rng );
522 0 : }
523 0 : fd_vote_block_timestamp_generate( &self->last_timestamp, alloc_mem, rng );
524 0 : return mem;
525 0 : }
526 :
527 0 : void *fd_vote_state_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
528 0 : fd_vote_state_t *self = (fd_vote_state_t *) mem;
529 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_state_t);
530 0 : fd_vote_state_new(mem);
531 0 : fd_pubkey_generate( &self->node_pubkey, alloc_mem, rng );
532 0 : fd_pubkey_generate( &self->authorized_withdrawer, alloc_mem, rng );
533 0 : self->commission = fd_rng_uchar( rng );
534 0 : ulong votes_len = fd_rng_ulong( rng ) % 8;
535 0 : ulong votes_max = fd_ulong_max( votes_len, 32 );
536 0 : self->votes = deq_fd_landed_vote_t_join_new( alloc_mem, votes_max );
537 0 : for( ulong i=0; i < votes_len; i++ ) {
538 0 : fd_landed_vote_t * elem = deq_fd_landed_vote_t_push_tail_nocopy( self->votes );
539 0 : fd_landed_vote_generate( elem, alloc_mem, rng );
540 0 : }
541 0 : {
542 0 : self->has_root_slot = fd_rng_uchar( rng ) % 2;
543 0 : if( self->has_root_slot ) {
544 0 : LLVMFuzzerMutate( (uchar *)&(self->root_slot), sizeof(ulong), sizeof(ulong) );
545 0 : }
546 0 : }
547 0 : fd_vote_authorized_voters_generate( &self->authorized_voters, alloc_mem, rng );
548 0 : fd_vote_prior_voters_generate( &self->prior_voters, alloc_mem, rng );
549 0 : ulong epoch_credits_len = fd_rng_ulong( rng ) % 8;
550 0 : ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
551 0 : self->epoch_credits = deq_fd_vote_epoch_credits_t_join_new( alloc_mem, epoch_credits_max );
552 0 : for( ulong i=0; i < epoch_credits_len; i++ ) {
553 0 : fd_vote_epoch_credits_t * elem = deq_fd_vote_epoch_credits_t_push_tail_nocopy( self->epoch_credits );
554 0 : fd_vote_epoch_credits_generate( elem, alloc_mem, rng );
555 0 : }
556 0 : fd_vote_block_timestamp_generate( &self->last_timestamp, alloc_mem, rng );
557 0 : return mem;
558 0 : }
559 :
560 0 : void fd_vote_state_versioned_inner_generate( fd_vote_state_versioned_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
561 0 : switch (discriminant) {
562 0 : case 0: {
563 0 : fd_vote_state_0_23_5_generate( &self->v0_23_5, alloc_mem, rng );
564 0 : break;
565 0 : }
566 0 : case 1: {
567 0 : fd_vote_state_1_14_11_generate( &self->v1_14_11, alloc_mem, rng );
568 0 : break;
569 0 : }
570 0 : case 2: {
571 0 : fd_vote_state_generate( &self->current, alloc_mem, rng );
572 0 : break;
573 0 : }
574 0 : }
575 0 : }
576 0 : void *fd_vote_state_versioned_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
577 0 : fd_vote_state_versioned_t *self = (fd_vote_state_versioned_t *) mem;
578 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_state_versioned_t);
579 0 : fd_vote_state_versioned_new(mem);
580 0 : self->discriminant = fd_rng_uint( rng ) % 3;
581 0 : fd_vote_state_versioned_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
582 0 : return mem;
583 0 : }
584 :
585 0 : void *fd_vote_state_update_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
586 0 : fd_vote_state_update_t *self = (fd_vote_state_update_t *) mem;
587 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_state_update_t);
588 0 : fd_vote_state_update_new(mem);
589 0 : ulong lockouts_len = fd_rng_ulong( rng ) % 8;
590 0 : ulong lockouts_max = fd_ulong_max( lockouts_len, 32 );
591 0 : self->lockouts = deq_fd_vote_lockout_t_join_new( alloc_mem, lockouts_max );
592 0 : for( ulong i=0; i < lockouts_len; i++ ) {
593 0 : fd_vote_lockout_t * elem = deq_fd_vote_lockout_t_push_tail_nocopy( self->lockouts );
594 0 : fd_vote_lockout_generate( elem, alloc_mem, rng );
595 0 : }
596 0 : {
597 0 : self->has_root = fd_rng_uchar( rng ) % 2;
598 0 : if( self->has_root ) {
599 0 : LLVMFuzzerMutate( (uchar *)&(self->root), sizeof(ulong), sizeof(ulong) );
600 0 : }
601 0 : }
602 0 : fd_hash_generate( &self->hash, alloc_mem, rng );
603 0 : {
604 0 : self->has_timestamp = fd_rng_uchar( rng ) % 2;
605 0 : if( self->has_timestamp ) {
606 0 : LLVMFuzzerMutate( (uchar *)&(self->timestamp), sizeof(long), sizeof(long) );
607 0 : }
608 0 : }
609 0 : return mem;
610 0 : }
611 :
612 0 : void *fd_compact_vote_state_update_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
613 0 : fd_compact_vote_state_update_t *self = (fd_compact_vote_state_update_t *) mem;
614 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_compact_vote_state_update_t);
615 0 : fd_compact_vote_state_update_new(mem);
616 0 : self->root = fd_rng_ulong( rng );
617 0 : self->lockouts_len = fd_rng_ulong( rng ) % 8;
618 0 : if( self->lockouts_len ) {
619 0 : self->lockouts = (fd_lockout_offset_t *) *alloc_mem;
620 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_lockout_offset_t)*self->lockouts_len;
621 0 : for( ulong i=0; i < self->lockouts_len; i++ ) {
622 0 : fd_lockout_offset_new( self->lockouts + i );
623 0 : fd_lockout_offset_generate( self->lockouts + i, alloc_mem, rng );
624 0 : }
625 0 : } else {
626 0 : self->lockouts = NULL;
627 0 : }
628 0 : fd_hash_generate( &self->hash, alloc_mem, rng );
629 0 : {
630 0 : self->has_timestamp = fd_rng_uchar( rng ) % 2;
631 0 : if( self->has_timestamp ) {
632 0 : LLVMFuzzerMutate( (uchar *)&(self->timestamp), sizeof(long), sizeof(long) );
633 0 : }
634 0 : }
635 0 : return mem;
636 0 : }
637 :
638 0 : void *fd_compact_vote_state_update_switch_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
639 0 : fd_compact_vote_state_update_switch_t *self = (fd_compact_vote_state_update_switch_t *) mem;
640 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_compact_vote_state_update_switch_t);
641 0 : fd_compact_vote_state_update_switch_new(mem);
642 0 : fd_compact_vote_state_update_generate( &self->compact_vote_state_update, alloc_mem, rng );
643 0 : fd_hash_generate( &self->hash, alloc_mem, rng );
644 0 : return mem;
645 0 : }
646 :
647 0 : void *fd_compact_tower_sync_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
648 0 : fd_compact_tower_sync_t *self = (fd_compact_tower_sync_t *) mem;
649 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_compact_tower_sync_t);
650 0 : fd_compact_tower_sync_new(mem);
651 0 : self->root = fd_rng_ulong( rng );
652 0 : ulong lockout_offsets_len = fd_rng_ulong( rng ) % 8;
653 0 : ulong lockout_offsets_max = fd_ulong_max( lockout_offsets_len, 32 );
654 0 : self->lockout_offsets = deq_fd_lockout_offset_t_join_new( alloc_mem, lockout_offsets_max );
655 0 : for( ulong i=0; i < lockout_offsets_len; i++ ) {
656 0 : fd_lockout_offset_t * elem = deq_fd_lockout_offset_t_push_tail_nocopy( self->lockout_offsets );
657 0 : fd_lockout_offset_generate( elem, alloc_mem, rng );
658 0 : }
659 0 : fd_hash_generate( &self->hash, alloc_mem, rng );
660 0 : {
661 0 : self->has_timestamp = fd_rng_uchar( rng ) % 2;
662 0 : if( self->has_timestamp ) {
663 0 : LLVMFuzzerMutate( (uchar *)&(self->timestamp), sizeof(long), sizeof(long) );
664 0 : }
665 0 : }
666 0 : fd_hash_generate( &self->block_id, alloc_mem, rng );
667 0 : return mem;
668 0 : }
669 :
670 :
671 0 : void *fd_tower_sync_switch_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
672 0 : fd_tower_sync_switch_t *self = (fd_tower_sync_switch_t *) mem;
673 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_tower_sync_switch_t);
674 0 : fd_tower_sync_switch_new(mem);
675 0 : fd_hash_generate( &self->hash, alloc_mem, rng );
676 0 : return mem;
677 0 : }
678 :
679 0 : void *fd_slot_history_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
680 0 : fd_slot_history_t *self = (fd_slot_history_t *) mem;
681 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_slot_history_t);
682 0 : fd_slot_history_new(mem);
683 0 : {
684 0 : self->has_bits = fd_rng_uchar( rng ) % 2;
685 0 : if( self->has_bits ) {
686 0 : self->bits_bitvec_len = fd_rng_ulong( rng ) % 8;
687 0 : if( self->bits_bitvec_len ) {
688 0 : self->bits_bitvec = (ulong *) *alloc_mem;
689 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(ulong)*self->bits_bitvec_len;
690 0 : LLVMFuzzerMutate( (uchar *) self->bits_bitvec, sizeof(ulong)*self->bits_bitvec_len, sizeof(ulong)*self->bits_bitvec_len );
691 0 : } else {
692 0 : self->bits_bitvec = NULL;
693 0 : }
694 0 : self->bits_len = self->bits_bitvec_len;
695 0 : } else {
696 0 : self->bits_len = 0UL;
697 0 : }
698 0 : }
699 0 : self->next_slot = fd_rng_ulong( rng );
700 0 : return mem;
701 0 : }
702 :
703 0 : void *fd_slot_hash_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
704 0 : fd_slot_hash_t *self = (fd_slot_hash_t *) mem;
705 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_slot_hash_t);
706 0 : fd_slot_hash_new(mem);
707 0 : self->slot = fd_rng_ulong( rng );
708 0 : fd_hash_generate( &self->hash, alloc_mem, rng );
709 0 : return mem;
710 0 : }
711 :
712 0 : void *fd_slot_hashes_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
713 0 : fd_slot_hashes_t *self = (fd_slot_hashes_t *) mem;
714 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_slot_hashes_t);
715 0 : fd_slot_hashes_new(mem);
716 0 : ulong hashes_len = fd_rng_ulong( rng ) % 8;
717 0 : ulong hashes_max = fd_ulong_max( hashes_len, 512 );
718 0 : self->hashes = deq_fd_slot_hash_t_join_new( alloc_mem, hashes_max );
719 0 : for( ulong i=0; i < hashes_len; i++ ) {
720 0 : fd_slot_hash_t * elem = deq_fd_slot_hash_t_push_tail_nocopy( self->hashes );
721 0 : fd_slot_hash_generate( elem, alloc_mem, rng );
722 0 : }
723 0 : return mem;
724 0 : }
725 :
726 0 : void *fd_block_block_hash_entry_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
727 0 : fd_block_block_hash_entry_t *self = (fd_block_block_hash_entry_t *) mem;
728 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_block_block_hash_entry_t);
729 0 : fd_block_block_hash_entry_new(mem);
730 0 : fd_hash_generate( &self->blockhash, alloc_mem, rng );
731 0 : fd_fee_calculator_generate( &self->fee_calculator, alloc_mem, rng );
732 0 : return mem;
733 0 : }
734 :
735 0 : void *fd_recent_block_hashes_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
736 0 : fd_recent_block_hashes_t *self = (fd_recent_block_hashes_t *) mem;
737 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_recent_block_hashes_t);
738 0 : fd_recent_block_hashes_new(mem);
739 0 : ulong hashes_len = fd_rng_ulong( rng ) % 8;
740 0 : ulong hashes_max = fd_ulong_max( hashes_len, 151 );
741 0 : self->hashes = deq_fd_block_block_hash_entry_t_join_new( alloc_mem, hashes_max );
742 0 : for( ulong i=0; i < hashes_len; i++ ) {
743 0 : fd_block_block_hash_entry_t * elem = deq_fd_block_block_hash_entry_t_push_tail_nocopy( self->hashes );
744 0 : fd_block_block_hash_entry_generate( elem, alloc_mem, rng );
745 0 : }
746 0 : return mem;
747 0 : }
748 :
749 0 : void *fd_slot_meta_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
750 0 : fd_slot_meta_t *self = (fd_slot_meta_t *) mem;
751 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_slot_meta_t);
752 0 : fd_slot_meta_new(mem);
753 0 : self->slot = fd_rng_ulong( rng );
754 0 : self->consumed = fd_rng_ulong( rng );
755 0 : self->received = fd_rng_ulong( rng );
756 0 : self->first_shred_timestamp = fd_rng_long( rng );
757 0 : self->last_index = fd_rng_ulong( rng );
758 0 : self->parent_slot = fd_rng_ulong( rng );
759 0 : self->next_slot_len = fd_rng_ulong( rng ) % 8;
760 0 : if( self->next_slot_len ) {
761 0 : self->next_slot = (ulong *) *alloc_mem;
762 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(ulong)*self->next_slot_len;
763 0 : LLVMFuzzerMutate( (uchar *) self->next_slot, sizeof(ulong)*self->next_slot_len, sizeof(ulong)*self->next_slot_len );
764 0 : } else {
765 0 : self->next_slot = NULL;
766 0 : }
767 0 : self->is_connected = fd_rng_uchar( rng );
768 0 : return mem;
769 0 : }
770 :
771 0 : void *fd_sysvar_fees_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
772 0 : fd_sysvar_fees_t *self = (fd_sysvar_fees_t *) mem;
773 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_sysvar_fees_t);
774 0 : fd_sysvar_fees_new(mem);
775 0 : fd_fee_calculator_generate( &self->fee_calculator, alloc_mem, rng );
776 0 : return mem;
777 0 : }
778 :
779 0 : void *fd_sysvar_epoch_rewards_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
780 0 : fd_sysvar_epoch_rewards_t *self = (fd_sysvar_epoch_rewards_t *) mem;
781 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_sysvar_epoch_rewards_t);
782 0 : fd_sysvar_epoch_rewards_new(mem);
783 0 : self->distribution_starting_block_height = fd_rng_ulong( rng );
784 0 : self->num_partitions = fd_rng_ulong( rng );
785 0 : fd_hash_generate( &self->parent_blockhash, alloc_mem, rng );
786 0 : self->total_points = (fd_w_u128_t) { .ul={ fd_rng_ulong( rng ), fd_rng_ulong( rng ) } };
787 0 : self->total_rewards = fd_rng_ulong( rng );
788 0 : self->distributed_rewards = fd_rng_ulong( rng );
789 0 : self->active = fd_rng_uchar( rng );
790 0 : return mem;
791 0 : }
792 :
793 0 : void *fd_config_keys_pair_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
794 0 : fd_config_keys_pair_t *self = (fd_config_keys_pair_t *) mem;
795 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_config_keys_pair_t);
796 0 : fd_config_keys_pair_new(mem);
797 0 : fd_pubkey_generate( &self->key, alloc_mem, rng );
798 0 : self->signer = fd_rng_uchar( rng );
799 0 : return mem;
800 0 : }
801 :
802 0 : void *fd_stake_config_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
803 0 : fd_stake_config_t *self = (fd_stake_config_t *) mem;
804 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_config_t);
805 0 : fd_stake_config_new(mem);
806 0 : self->config_keys_len = fd_rng_ulong( rng ) % 8;
807 0 : if( self->config_keys_len ) {
808 0 : self->config_keys = (fd_config_keys_pair_t *) *alloc_mem;
809 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_config_keys_pair_t)*self->config_keys_len;
810 0 : for( ulong i=0; i < self->config_keys_len; i++ ) {
811 0 : fd_config_keys_pair_new( self->config_keys + i );
812 0 : fd_config_keys_pair_generate( self->config_keys + i, alloc_mem, rng );
813 0 : }
814 0 : } else {
815 0 : self->config_keys = NULL;
816 0 : }
817 0 : self->warmup_cooldown_rate = fd_rng_double_o( rng );
818 0 : self->slash_penalty = fd_rng_uchar( rng );
819 0 : return mem;
820 0 : }
821 :
822 0 : void *fd_cluster_type_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
823 0 : fd_cluster_type_t *self = (fd_cluster_type_t *) mem;
824 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_cluster_type_t);
825 0 : fd_cluster_type_new(mem);
826 0 : self->discriminant = fd_rng_uint( rng ) % 4;
827 0 : return mem;
828 0 : }
829 :
830 0 : void *fd_cluster_version_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
831 0 : fd_cluster_version_t *self = (fd_cluster_version_t *) mem;
832 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_cluster_version_t);
833 0 : fd_cluster_version_new(mem);
834 0 : self->major = fd_rng_uint( rng );
835 0 : self->minor = fd_rng_uint( rng );
836 0 : self->patch = fd_rng_uint( rng );
837 0 : return mem;
838 0 : }
839 :
840 0 : void *fd_stake_reward_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
841 0 : fd_stake_reward_t *self = (fd_stake_reward_t *) mem;
842 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_reward_t);
843 0 : fd_stake_reward_new(mem);
844 0 : self->prev = fd_rng_ulong( rng );
845 0 : self->next = fd_rng_ulong( rng );
846 0 : self->parent = fd_rng_ulong( rng );
847 0 : fd_pubkey_generate( &self->stake_pubkey, alloc_mem, rng );
848 0 : self->credits_observed = fd_rng_ulong( rng );
849 0 : self->lamports = fd_rng_ulong( rng );
850 0 : self->valid = fd_rng_uchar( rng );
851 0 : return mem;
852 0 : }
853 :
854 0 : void *fd_partitioned_rewards_calculation_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
855 0 : fd_partitioned_rewards_calculation_t *self = (fd_partitioned_rewards_calculation_t *) mem;
856 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_partitioned_rewards_calculation_t);
857 0 : fd_partitioned_rewards_calculation_new(mem);
858 0 : self->validator_points = (fd_w_u128_t) { .ul={ fd_rng_ulong( rng ), fd_rng_ulong( rng ) } };
859 0 : self->old_vote_balance_and_staked = fd_rng_ulong( rng );
860 0 : self->validator_rewards = fd_rng_ulong( rng );
861 0 : self->validator_rate = fd_rng_double_o( rng );
862 0 : self->foundation_rate = fd_rng_double_o( rng );
863 0 : self->prev_epoch_duration_in_years = fd_rng_double_o( rng );
864 0 : self->capitalization = fd_rng_ulong( rng );
865 0 : return mem;
866 0 : }
867 :
868 0 : void *fd_prev_epoch_inflation_rewards_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
869 0 : fd_prev_epoch_inflation_rewards_t *self = (fd_prev_epoch_inflation_rewards_t *) mem;
870 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_prev_epoch_inflation_rewards_t);
871 0 : fd_prev_epoch_inflation_rewards_new(mem);
872 0 : self->validator_rewards = fd_rng_ulong( rng );
873 0 : self->prev_epoch_duration_in_years = fd_rng_double_o( rng );
874 0 : self->validator_rate = fd_rng_double_o( rng );
875 0 : self->foundation_rate = fd_rng_double_o( rng );
876 0 : return mem;
877 0 : }
878 :
879 0 : void *fd_vote_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
880 0 : fd_vote_t *self = (fd_vote_t *) mem;
881 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_t);
882 0 : fd_vote_new(mem);
883 0 : ulong slots_len = fd_rng_ulong( rng ) % 8;
884 0 : self->slots = deq_ulong_join_new( alloc_mem, slots_len );
885 0 : for( ulong i=0; i < slots_len; i++ ) {
886 0 : ulong * elem = deq_ulong_push_tail_nocopy( self->slots );
887 0 : LLVMFuzzerMutate( (uchar *) elem, sizeof(ulong), sizeof(ulong) );
888 0 : }
889 0 : fd_hash_generate( &self->hash, alloc_mem, rng );
890 0 : {
891 0 : self->has_timestamp = fd_rng_uchar( rng ) % 2;
892 0 : if( self->has_timestamp ) {
893 0 : LLVMFuzzerMutate( (uchar *)&(self->timestamp), sizeof(long), sizeof(long) );
894 0 : }
895 0 : }
896 0 : return mem;
897 0 : }
898 :
899 0 : void *fd_vote_init_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
900 0 : fd_vote_init_t *self = (fd_vote_init_t *) mem;
901 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_init_t);
902 0 : fd_vote_init_new(mem);
903 0 : fd_pubkey_generate( &self->node_pubkey, alloc_mem, rng );
904 0 : fd_pubkey_generate( &self->authorized_voter, alloc_mem, rng );
905 0 : fd_pubkey_generate( &self->authorized_withdrawer, alloc_mem, rng );
906 0 : self->commission = fd_rng_uchar( rng );
907 0 : return mem;
908 0 : }
909 :
910 0 : void *fd_vote_authorize_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
911 0 : fd_vote_authorize_t *self = (fd_vote_authorize_t *) mem;
912 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_authorize_t);
913 0 : fd_vote_authorize_new(mem);
914 0 : self->discriminant = fd_rng_uint( rng ) % 2;
915 0 : return mem;
916 0 : }
917 :
918 0 : void *fd_vote_authorize_pubkey_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
919 0 : fd_vote_authorize_pubkey_t *self = (fd_vote_authorize_pubkey_t *) mem;
920 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_authorize_pubkey_t);
921 0 : fd_vote_authorize_pubkey_new(mem);
922 0 : fd_pubkey_generate( &self->pubkey, alloc_mem, rng );
923 0 : fd_vote_authorize_generate( &self->vote_authorize, alloc_mem, rng );
924 0 : return mem;
925 0 : }
926 :
927 0 : void *fd_vote_switch_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
928 0 : fd_vote_switch_t *self = (fd_vote_switch_t *) mem;
929 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_switch_t);
930 0 : fd_vote_switch_new(mem);
931 0 : fd_vote_generate( &self->vote, alloc_mem, rng );
932 0 : fd_hash_generate( &self->hash, alloc_mem, rng );
933 0 : return mem;
934 0 : }
935 :
936 0 : void *fd_update_vote_state_switch_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
937 0 : fd_update_vote_state_switch_t *self = (fd_update_vote_state_switch_t *) mem;
938 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_update_vote_state_switch_t);
939 0 : fd_update_vote_state_switch_new(mem);
940 0 : fd_vote_state_update_generate( &self->vote_state_update, alloc_mem, rng );
941 0 : fd_hash_generate( &self->hash, alloc_mem, rng );
942 0 : return mem;
943 0 : }
944 :
945 0 : void *fd_vote_authorize_with_seed_args_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
946 0 : fd_vote_authorize_with_seed_args_t *self = (fd_vote_authorize_with_seed_args_t *) mem;
947 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_authorize_with_seed_args_t);
948 0 : fd_vote_authorize_with_seed_args_new(mem);
949 0 : fd_vote_authorize_generate( &self->authorization_type, alloc_mem, rng );
950 0 : fd_pubkey_generate( &self->current_authority_derived_key_owner, alloc_mem, rng );
951 0 : self->current_authority_derived_key_seed_len = fd_rng_ulong( rng ) % 8;
952 0 : if( self->current_authority_derived_key_seed_len ) {
953 0 : self->current_authority_derived_key_seed = (uchar *) *alloc_mem;
954 0 : *alloc_mem = (uchar *) *alloc_mem + self->current_authority_derived_key_seed_len;
955 0 : for( ulong i=0; i < self->current_authority_derived_key_seed_len; ++i) { self->current_authority_derived_key_seed[i] = fd_rng_uchar( rng ) % 0x80; }
956 0 : } else {
957 0 : self->current_authority_derived_key_seed = NULL;
958 0 : }
959 0 : fd_pubkey_generate( &self->new_authority, alloc_mem, rng );
960 0 : return mem;
961 0 : }
962 :
963 0 : void *fd_vote_authorize_checked_with_seed_args_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
964 0 : fd_vote_authorize_checked_with_seed_args_t *self = (fd_vote_authorize_checked_with_seed_args_t *) mem;
965 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_authorize_checked_with_seed_args_t);
966 0 : fd_vote_authorize_checked_with_seed_args_new(mem);
967 0 : fd_vote_authorize_generate( &self->authorization_type, alloc_mem, rng );
968 0 : fd_pubkey_generate( &self->current_authority_derived_key_owner, alloc_mem, rng );
969 0 : self->current_authority_derived_key_seed_len = fd_rng_ulong( rng ) % 8;
970 0 : if( self->current_authority_derived_key_seed_len ) {
971 0 : self->current_authority_derived_key_seed = (uchar *) *alloc_mem;
972 0 : *alloc_mem = (uchar *) *alloc_mem + self->current_authority_derived_key_seed_len;
973 0 : for( ulong i=0; i < self->current_authority_derived_key_seed_len; ++i) { self->current_authority_derived_key_seed[i] = fd_rng_uchar( rng ) % 0x80; }
974 0 : } else {
975 0 : self->current_authority_derived_key_seed = NULL;
976 0 : }
977 0 : return mem;
978 0 : }
979 :
980 0 : void fd_vote_instruction_inner_generate( fd_vote_instruction_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
981 0 : switch (discriminant) {
982 0 : case 0: {
983 0 : fd_vote_init_generate( &self->initialize_account, alloc_mem, rng );
984 0 : break;
985 0 : }
986 0 : case 1: {
987 0 : fd_vote_authorize_pubkey_generate( &self->authorize, alloc_mem, rng );
988 0 : break;
989 0 : }
990 0 : case 2: {
991 0 : fd_vote_generate( &self->vote, alloc_mem, rng );
992 0 : break;
993 0 : }
994 0 : case 3: {
995 0 : self->withdraw = fd_rng_ulong( rng );
996 0 : break;
997 0 : }
998 0 : case 5: {
999 0 : self->update_commission = fd_rng_uchar( rng );
1000 0 : break;
1001 0 : }
1002 0 : case 6: {
1003 0 : fd_vote_switch_generate( &self->vote_switch, alloc_mem, rng );
1004 0 : break;
1005 0 : }
1006 0 : case 7: {
1007 0 : fd_vote_authorize_generate( &self->authorize_checked, alloc_mem, rng );
1008 0 : break;
1009 0 : }
1010 0 : case 8: {
1011 0 : fd_vote_state_update_generate( &self->update_vote_state, alloc_mem, rng );
1012 0 : break;
1013 0 : }
1014 0 : case 9: {
1015 0 : fd_update_vote_state_switch_generate( &self->update_vote_state_switch, alloc_mem, rng );
1016 0 : break;
1017 0 : }
1018 0 : case 10: {
1019 0 : fd_vote_authorize_with_seed_args_generate( &self->authorize_with_seed, alloc_mem, rng );
1020 0 : break;
1021 0 : }
1022 0 : case 11: {
1023 0 : fd_vote_authorize_checked_with_seed_args_generate( &self->authorize_checked_with_seed, alloc_mem, rng );
1024 0 : break;
1025 0 : }
1026 0 : case 12: {
1027 0 : fd_compact_vote_state_update_generate( &self->compact_update_vote_state, alloc_mem, rng );
1028 0 : break;
1029 0 : }
1030 0 : case 13: {
1031 0 : fd_compact_vote_state_update_switch_generate( &self->compact_update_vote_state_switch, alloc_mem, rng );
1032 0 : break;
1033 0 : }
1034 0 : case 14: {
1035 0 : break;
1036 0 : }
1037 0 : case 15: {
1038 0 : fd_tower_sync_switch_generate( &self->tower_sync_switch, alloc_mem, rng );
1039 0 : break;
1040 0 : }
1041 0 : }
1042 0 : }
1043 0 : void *fd_vote_instruction_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1044 0 : fd_vote_instruction_t *self = (fd_vote_instruction_t *) mem;
1045 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_vote_instruction_t);
1046 0 : fd_vote_instruction_new(mem);
1047 0 : self->discriminant = fd_rng_uint( rng ) % 16;
1048 0 : while( self->discriminant == 14 || self->discriminant == 15 ) { self->discriminant = fd_rng_uint( rng ) % 16; }
1049 0 : fd_vote_instruction_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1050 0 : return mem;
1051 0 : }
1052 :
1053 0 : void *fd_system_program_instruction_create_account_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1054 0 : fd_system_program_instruction_create_account_t *self = (fd_system_program_instruction_create_account_t *) mem;
1055 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_system_program_instruction_create_account_t);
1056 0 : fd_system_program_instruction_create_account_new(mem);
1057 0 : self->lamports = fd_rng_ulong( rng );
1058 0 : self->space = fd_rng_ulong( rng );
1059 0 : fd_pubkey_generate( &self->owner, alloc_mem, rng );
1060 0 : return mem;
1061 0 : }
1062 :
1063 0 : void *fd_system_program_instruction_create_account_with_seed_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1064 0 : fd_system_program_instruction_create_account_with_seed_t *self = (fd_system_program_instruction_create_account_with_seed_t *) mem;
1065 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_system_program_instruction_create_account_with_seed_t);
1066 0 : fd_system_program_instruction_create_account_with_seed_new(mem);
1067 0 : fd_pubkey_generate( &self->base, alloc_mem, rng );
1068 0 : self->seed_len = fd_rng_ulong( rng ) % 8;
1069 0 : if( self->seed_len ) {
1070 0 : self->seed = (uchar *) *alloc_mem;
1071 0 : *alloc_mem = (uchar *) *alloc_mem + self->seed_len;
1072 0 : for( ulong i=0; i < self->seed_len; ++i) { self->seed[i] = fd_rng_uchar( rng ) % 0x80; }
1073 0 : } else {
1074 0 : self->seed = NULL;
1075 0 : }
1076 0 : self->lamports = fd_rng_ulong( rng );
1077 0 : self->space = fd_rng_ulong( rng );
1078 0 : fd_pubkey_generate( &self->owner, alloc_mem, rng );
1079 0 : return mem;
1080 0 : }
1081 :
1082 0 : void *fd_system_program_instruction_allocate_with_seed_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1083 0 : fd_system_program_instruction_allocate_with_seed_t *self = (fd_system_program_instruction_allocate_with_seed_t *) mem;
1084 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_system_program_instruction_allocate_with_seed_t);
1085 0 : fd_system_program_instruction_allocate_with_seed_new(mem);
1086 0 : fd_pubkey_generate( &self->base, alloc_mem, rng );
1087 0 : self->seed_len = fd_rng_ulong( rng ) % 8;
1088 0 : if( self->seed_len ) {
1089 0 : self->seed = (uchar *) *alloc_mem;
1090 0 : *alloc_mem = (uchar *) *alloc_mem + self->seed_len;
1091 0 : for( ulong i=0; i < self->seed_len; ++i) { self->seed[i] = fd_rng_uchar( rng ) % 0x80; }
1092 0 : } else {
1093 0 : self->seed = NULL;
1094 0 : }
1095 0 : self->space = fd_rng_ulong( rng );
1096 0 : fd_pubkey_generate( &self->owner, alloc_mem, rng );
1097 0 : return mem;
1098 0 : }
1099 :
1100 0 : void *fd_system_program_instruction_assign_with_seed_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1101 0 : fd_system_program_instruction_assign_with_seed_t *self = (fd_system_program_instruction_assign_with_seed_t *) mem;
1102 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_system_program_instruction_assign_with_seed_t);
1103 0 : fd_system_program_instruction_assign_with_seed_new(mem);
1104 0 : fd_pubkey_generate( &self->base, alloc_mem, rng );
1105 0 : self->seed_len = fd_rng_ulong( rng ) % 8;
1106 0 : if( self->seed_len ) {
1107 0 : self->seed = (uchar *) *alloc_mem;
1108 0 : *alloc_mem = (uchar *) *alloc_mem + self->seed_len;
1109 0 : for( ulong i=0; i < self->seed_len; ++i) { self->seed[i] = fd_rng_uchar( rng ) % 0x80; }
1110 0 : } else {
1111 0 : self->seed = NULL;
1112 0 : }
1113 0 : fd_pubkey_generate( &self->owner, alloc_mem, rng );
1114 0 : return mem;
1115 0 : }
1116 :
1117 0 : void *fd_system_program_instruction_transfer_with_seed_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1118 0 : fd_system_program_instruction_transfer_with_seed_t *self = (fd_system_program_instruction_transfer_with_seed_t *) mem;
1119 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_system_program_instruction_transfer_with_seed_t);
1120 0 : fd_system_program_instruction_transfer_with_seed_new(mem);
1121 0 : self->lamports = fd_rng_ulong( rng );
1122 0 : self->from_seed_len = fd_rng_ulong( rng ) % 8;
1123 0 : if( self->from_seed_len ) {
1124 0 : self->from_seed = (uchar *) *alloc_mem;
1125 0 : *alloc_mem = (uchar *) *alloc_mem + self->from_seed_len;
1126 0 : for( ulong i=0; i < self->from_seed_len; ++i) { self->from_seed[i] = fd_rng_uchar( rng ) % 0x80; }
1127 0 : } else {
1128 0 : self->from_seed = NULL;
1129 0 : }
1130 0 : fd_pubkey_generate( &self->from_owner, alloc_mem, rng );
1131 0 : return mem;
1132 0 : }
1133 :
1134 0 : void fd_system_program_instruction_inner_generate( fd_system_program_instruction_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1135 0 : switch (discriminant) {
1136 0 : case 0: {
1137 0 : fd_system_program_instruction_create_account_generate( &self->create_account, alloc_mem, rng );
1138 0 : break;
1139 0 : }
1140 0 : case 1: {
1141 0 : fd_pubkey_generate( &self->assign, alloc_mem, rng );
1142 0 : break;
1143 0 : }
1144 0 : case 2: {
1145 0 : self->transfer = fd_rng_ulong( rng );
1146 0 : break;
1147 0 : }
1148 0 : case 3: {
1149 0 : fd_system_program_instruction_create_account_with_seed_generate( &self->create_account_with_seed, alloc_mem, rng );
1150 0 : break;
1151 0 : }
1152 0 : case 5: {
1153 0 : self->withdraw_nonce_account = fd_rng_ulong( rng );
1154 0 : break;
1155 0 : }
1156 0 : case 6: {
1157 0 : fd_pubkey_generate( &self->initialize_nonce_account, alloc_mem, rng );
1158 0 : break;
1159 0 : }
1160 0 : case 7: {
1161 0 : fd_pubkey_generate( &self->authorize_nonce_account, alloc_mem, rng );
1162 0 : break;
1163 0 : }
1164 0 : case 8: {
1165 0 : self->allocate = fd_rng_ulong( rng );
1166 0 : break;
1167 0 : }
1168 0 : case 9: {
1169 0 : fd_system_program_instruction_allocate_with_seed_generate( &self->allocate_with_seed, alloc_mem, rng );
1170 0 : break;
1171 0 : }
1172 0 : case 10: {
1173 0 : fd_system_program_instruction_assign_with_seed_generate( &self->assign_with_seed, alloc_mem, rng );
1174 0 : break;
1175 0 : }
1176 0 : case 11: {
1177 0 : fd_system_program_instruction_transfer_with_seed_generate( &self->transfer_with_seed, alloc_mem, rng );
1178 0 : break;
1179 0 : }
1180 0 : }
1181 0 : }
1182 0 : void *fd_system_program_instruction_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1183 0 : fd_system_program_instruction_t *self = (fd_system_program_instruction_t *) mem;
1184 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_system_program_instruction_t);
1185 0 : fd_system_program_instruction_new(mem);
1186 0 : self->discriminant = fd_rng_uint( rng ) % 13;
1187 0 : fd_system_program_instruction_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1188 0 : return mem;
1189 0 : }
1190 :
1191 0 : void *fd_stake_authorized_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1192 0 : fd_stake_authorized_t *self = (fd_stake_authorized_t *) mem;
1193 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_authorized_t);
1194 0 : fd_stake_authorized_new(mem);
1195 0 : fd_pubkey_generate( &self->staker, alloc_mem, rng );
1196 0 : fd_pubkey_generate( &self->withdrawer, alloc_mem, rng );
1197 0 : return mem;
1198 0 : }
1199 :
1200 0 : void *fd_stake_lockup_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1201 0 : fd_stake_lockup_t *self = (fd_stake_lockup_t *) mem;
1202 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_lockup_t);
1203 0 : fd_stake_lockup_new(mem);
1204 0 : self->unix_timestamp = fd_rng_long( rng );
1205 0 : self->epoch = fd_rng_ulong( rng );
1206 0 : fd_pubkey_generate( &self->custodian, alloc_mem, rng );
1207 0 : return mem;
1208 0 : }
1209 :
1210 0 : void *fd_stake_instruction_initialize_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1211 0 : fd_stake_instruction_initialize_t *self = (fd_stake_instruction_initialize_t *) mem;
1212 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_instruction_initialize_t);
1213 0 : fd_stake_instruction_initialize_new(mem);
1214 0 : fd_stake_authorized_generate( &self->authorized, alloc_mem, rng );
1215 0 : fd_stake_lockup_generate( &self->lockup, alloc_mem, rng );
1216 0 : return mem;
1217 0 : }
1218 :
1219 0 : void *fd_stake_lockup_custodian_args_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1220 0 : fd_stake_lockup_custodian_args_t *self = (fd_stake_lockup_custodian_args_t *) mem;
1221 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_lockup_custodian_args_t);
1222 0 : fd_stake_lockup_custodian_args_new(mem);
1223 0 : fd_stake_lockup_generate( &self->lockup, alloc_mem, rng );
1224 0 : fd_sol_sysvar_clock_generate( &self->clock, alloc_mem, rng );
1225 0 : {
1226 0 : uchar is_null = fd_rng_uchar( rng ) % 2;
1227 0 : if( !is_null ) {
1228 0 : self->custodian = (fd_pubkey_t *) *alloc_mem;
1229 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_pubkey_t);
1230 0 : fd_pubkey_new( self->custodian );
1231 0 : fd_pubkey_generate( self->custodian, alloc_mem, rng );
1232 0 : }
1233 0 : else {
1234 0 : self->custodian = NULL;
1235 0 : }
1236 0 : }
1237 0 : return mem;
1238 0 : }
1239 :
1240 0 : void *fd_stake_authorize_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1241 0 : fd_stake_authorize_t *self = (fd_stake_authorize_t *) mem;
1242 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_authorize_t);
1243 0 : fd_stake_authorize_new(mem);
1244 0 : self->discriminant = fd_rng_uint( rng ) % 2;
1245 0 : return mem;
1246 0 : }
1247 :
1248 0 : void *fd_stake_instruction_authorize_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1249 0 : fd_stake_instruction_authorize_t *self = (fd_stake_instruction_authorize_t *) mem;
1250 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_instruction_authorize_t);
1251 0 : fd_stake_instruction_authorize_new(mem);
1252 0 : fd_pubkey_generate( &self->pubkey, alloc_mem, rng );
1253 0 : fd_stake_authorize_generate( &self->stake_authorize, alloc_mem, rng );
1254 0 : return mem;
1255 0 : }
1256 :
1257 0 : void *fd_authorize_with_seed_args_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1258 0 : fd_authorize_with_seed_args_t *self = (fd_authorize_with_seed_args_t *) mem;
1259 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_authorize_with_seed_args_t);
1260 0 : fd_authorize_with_seed_args_new(mem);
1261 0 : fd_pubkey_generate( &self->new_authorized_pubkey, alloc_mem, rng );
1262 0 : fd_stake_authorize_generate( &self->stake_authorize, alloc_mem, rng );
1263 0 : self->authority_seed_len = fd_rng_ulong( rng ) % 8;
1264 0 : if( self->authority_seed_len ) {
1265 0 : self->authority_seed = (uchar *) *alloc_mem;
1266 0 : *alloc_mem = (uchar *) *alloc_mem + self->authority_seed_len;
1267 0 : for( ulong i=0; i < self->authority_seed_len; ++i) { self->authority_seed[i] = fd_rng_uchar( rng ) % 0x80; }
1268 0 : } else {
1269 0 : self->authority_seed = NULL;
1270 0 : }
1271 0 : fd_pubkey_generate( &self->authority_owner, alloc_mem, rng );
1272 0 : return mem;
1273 0 : }
1274 :
1275 0 : void *fd_authorize_checked_with_seed_args_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1276 0 : fd_authorize_checked_with_seed_args_t *self = (fd_authorize_checked_with_seed_args_t *) mem;
1277 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_authorize_checked_with_seed_args_t);
1278 0 : fd_authorize_checked_with_seed_args_new(mem);
1279 0 : fd_stake_authorize_generate( &self->stake_authorize, alloc_mem, rng );
1280 0 : self->authority_seed_len = fd_rng_ulong( rng ) % 8;
1281 0 : if( self->authority_seed_len ) {
1282 0 : self->authority_seed = (uchar *) *alloc_mem;
1283 0 : *alloc_mem = (uchar *) *alloc_mem + self->authority_seed_len;
1284 0 : for( ulong i=0; i < self->authority_seed_len; ++i) { self->authority_seed[i] = fd_rng_uchar( rng ) % 0x80; }
1285 0 : } else {
1286 0 : self->authority_seed = NULL;
1287 0 : }
1288 0 : fd_pubkey_generate( &self->authority_owner, alloc_mem, rng );
1289 0 : return mem;
1290 0 : }
1291 :
1292 0 : void *fd_lockup_checked_args_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1293 0 : fd_lockup_checked_args_t *self = (fd_lockup_checked_args_t *) mem;
1294 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_lockup_checked_args_t);
1295 0 : fd_lockup_checked_args_new(mem);
1296 0 : {
1297 0 : uchar is_null = fd_rng_uchar( rng ) % 2;
1298 0 : if( !is_null ) {
1299 0 : self->unix_timestamp = (long *) *alloc_mem;
1300 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(long);
1301 0 : LLVMFuzzerMutate( (uchar *)self->unix_timestamp, sizeof(long), sizeof(long) );
1302 0 : }
1303 0 : else {
1304 0 : self->unix_timestamp = NULL;
1305 0 : }
1306 0 : }
1307 0 : {
1308 0 : uchar is_null = fd_rng_uchar( rng ) % 2;
1309 0 : if( !is_null ) {
1310 0 : self->epoch = (ulong *) *alloc_mem;
1311 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(ulong);
1312 0 : LLVMFuzzerMutate( (uchar *)self->epoch, sizeof(ulong), sizeof(ulong) );
1313 0 : }
1314 0 : else {
1315 0 : self->epoch = NULL;
1316 0 : }
1317 0 : }
1318 0 : return mem;
1319 0 : }
1320 :
1321 0 : void *fd_lockup_args_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1322 0 : fd_lockup_args_t *self = (fd_lockup_args_t *) mem;
1323 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_lockup_args_t);
1324 0 : fd_lockup_args_new(mem);
1325 0 : {
1326 0 : uchar is_null = fd_rng_uchar( rng ) % 2;
1327 0 : if( !is_null ) {
1328 0 : self->unix_timestamp = (long *) *alloc_mem;
1329 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(long);
1330 0 : LLVMFuzzerMutate( (uchar *)self->unix_timestamp, sizeof(long), sizeof(long) );
1331 0 : }
1332 0 : else {
1333 0 : self->unix_timestamp = NULL;
1334 0 : }
1335 0 : }
1336 0 : {
1337 0 : uchar is_null = fd_rng_uchar( rng ) % 2;
1338 0 : if( !is_null ) {
1339 0 : self->epoch = (ulong *) *alloc_mem;
1340 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(ulong);
1341 0 : LLVMFuzzerMutate( (uchar *)self->epoch, sizeof(ulong), sizeof(ulong) );
1342 0 : }
1343 0 : else {
1344 0 : self->epoch = NULL;
1345 0 : }
1346 0 : }
1347 0 : {
1348 0 : uchar is_null = fd_rng_uchar( rng ) % 2;
1349 0 : if( !is_null ) {
1350 0 : self->custodian = (fd_pubkey_t *) *alloc_mem;
1351 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_pubkey_t);
1352 0 : fd_pubkey_new( self->custodian );
1353 0 : fd_pubkey_generate( self->custodian, alloc_mem, rng );
1354 0 : }
1355 0 : else {
1356 0 : self->custodian = NULL;
1357 0 : }
1358 0 : }
1359 0 : return mem;
1360 0 : }
1361 :
1362 0 : void fd_stake_instruction_inner_generate( fd_stake_instruction_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1363 0 : switch (discriminant) {
1364 0 : case 0: {
1365 0 : fd_stake_instruction_initialize_generate( &self->initialize, alloc_mem, rng );
1366 0 : break;
1367 0 : }
1368 0 : case 1: {
1369 0 : fd_stake_instruction_authorize_generate( &self->authorize, alloc_mem, rng );
1370 0 : break;
1371 0 : }
1372 0 : case 3: {
1373 0 : self->split = fd_rng_ulong( rng );
1374 0 : break;
1375 0 : }
1376 0 : case 4: {
1377 0 : self->withdraw = fd_rng_ulong( rng );
1378 0 : break;
1379 0 : }
1380 0 : case 6: {
1381 0 : fd_lockup_args_generate( &self->set_lockup, alloc_mem, rng );
1382 0 : break;
1383 0 : }
1384 0 : case 8: {
1385 0 : fd_authorize_with_seed_args_generate( &self->authorize_with_seed, alloc_mem, rng );
1386 0 : break;
1387 0 : }
1388 0 : case 10: {
1389 0 : fd_stake_authorize_generate( &self->authorize_checked, alloc_mem, rng );
1390 0 : break;
1391 0 : }
1392 0 : case 11: {
1393 0 : fd_authorize_checked_with_seed_args_generate( &self->authorize_checked_with_seed, alloc_mem, rng );
1394 0 : break;
1395 0 : }
1396 0 : case 12: {
1397 0 : fd_lockup_checked_args_generate( &self->set_lockup_checked, alloc_mem, rng );
1398 0 : break;
1399 0 : }
1400 0 : case 16: {
1401 0 : self->move_stake = fd_rng_ulong( rng );
1402 0 : break;
1403 0 : }
1404 0 : case 17: {
1405 0 : self->move_lamports = fd_rng_ulong( rng );
1406 0 : break;
1407 0 : }
1408 0 : }
1409 0 : }
1410 0 : void *fd_stake_instruction_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1411 0 : fd_stake_instruction_t *self = (fd_stake_instruction_t *) mem;
1412 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_instruction_t);
1413 0 : fd_stake_instruction_new(mem);
1414 0 : self->discriminant = fd_rng_uint( rng ) % 18;
1415 0 : fd_stake_instruction_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1416 0 : return mem;
1417 0 : }
1418 :
1419 0 : void *fd_stake_meta_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1420 0 : fd_stake_meta_t *self = (fd_stake_meta_t *) mem;
1421 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_meta_t);
1422 0 : fd_stake_meta_new(mem);
1423 0 : self->rent_exempt_reserve = fd_rng_ulong( rng );
1424 0 : fd_stake_authorized_generate( &self->authorized, alloc_mem, rng );
1425 0 : fd_stake_lockup_generate( &self->lockup, alloc_mem, rng );
1426 0 : return mem;
1427 0 : }
1428 :
1429 0 : void *fd_stake_flags_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1430 0 : fd_stake_flags_t *self = (fd_stake_flags_t *) mem;
1431 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_flags_t);
1432 0 : fd_stake_flags_new(mem);
1433 0 : self->bits = fd_rng_uchar( rng );
1434 0 : return mem;
1435 0 : }
1436 :
1437 0 : void *fd_stake_state_v2_initialized_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1438 0 : fd_stake_state_v2_initialized_t *self = (fd_stake_state_v2_initialized_t *) mem;
1439 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_state_v2_initialized_t);
1440 0 : fd_stake_state_v2_initialized_new(mem);
1441 0 : fd_stake_meta_generate( &self->meta, alloc_mem, rng );
1442 0 : return mem;
1443 0 : }
1444 :
1445 0 : void *fd_stake_state_v2_stake_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1446 0 : fd_stake_state_v2_stake_t *self = (fd_stake_state_v2_stake_t *) mem;
1447 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_state_v2_stake_t);
1448 0 : fd_stake_state_v2_stake_new(mem);
1449 0 : fd_stake_meta_generate( &self->meta, alloc_mem, rng );
1450 0 : fd_stake_generate( &self->stake, alloc_mem, rng );
1451 0 : fd_stake_flags_generate( &self->stake_flags, alloc_mem, rng );
1452 0 : return mem;
1453 0 : }
1454 :
1455 0 : void fd_stake_state_v2_inner_generate( fd_stake_state_v2_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1456 0 : switch (discriminant) {
1457 0 : case 1: {
1458 0 : fd_stake_state_v2_initialized_generate( &self->initialized, alloc_mem, rng );
1459 0 : break;
1460 0 : }
1461 0 : case 2: {
1462 0 : fd_stake_state_v2_stake_generate( &self->stake, alloc_mem, rng );
1463 0 : break;
1464 0 : }
1465 0 : }
1466 0 : }
1467 0 : void *fd_stake_state_v2_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1468 0 : fd_stake_state_v2_t *self = (fd_stake_state_v2_t *) mem;
1469 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_state_v2_t);
1470 0 : fd_stake_state_v2_new(mem);
1471 0 : self->discriminant = fd_rng_uint( rng ) % 4;
1472 0 : fd_stake_state_v2_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1473 0 : return mem;
1474 0 : }
1475 :
1476 0 : void *fd_nonce_data_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1477 0 : fd_nonce_data_t *self = (fd_nonce_data_t *) mem;
1478 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_nonce_data_t);
1479 0 : fd_nonce_data_new(mem);
1480 0 : fd_pubkey_generate( &self->authority, alloc_mem, rng );
1481 0 : fd_hash_generate( &self->durable_nonce, alloc_mem, rng );
1482 0 : fd_fee_calculator_generate( &self->fee_calculator, alloc_mem, rng );
1483 0 : return mem;
1484 0 : }
1485 :
1486 0 : void fd_nonce_state_inner_generate( fd_nonce_state_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1487 0 : switch (discriminant) {
1488 0 : case 1: {
1489 0 : fd_nonce_data_generate( &self->initialized, alloc_mem, rng );
1490 0 : break;
1491 0 : }
1492 0 : }
1493 0 : }
1494 0 : void *fd_nonce_state_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1495 0 : fd_nonce_state_t *self = (fd_nonce_state_t *) mem;
1496 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_nonce_state_t);
1497 0 : fd_nonce_state_new(mem);
1498 0 : self->discriminant = fd_rng_uint( rng ) % 2;
1499 0 : fd_nonce_state_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1500 0 : return mem;
1501 0 : }
1502 :
1503 0 : void fd_nonce_state_versions_inner_generate( fd_nonce_state_versions_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1504 0 : switch (discriminant) {
1505 0 : case 0: {
1506 0 : fd_nonce_state_generate( &self->legacy, alloc_mem, rng );
1507 0 : break;
1508 0 : }
1509 0 : case 1: {
1510 0 : fd_nonce_state_generate( &self->current, alloc_mem, rng );
1511 0 : break;
1512 0 : }
1513 0 : }
1514 0 : }
1515 0 : void *fd_nonce_state_versions_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1516 0 : fd_nonce_state_versions_t *self = (fd_nonce_state_versions_t *) mem;
1517 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_nonce_state_versions_t);
1518 0 : fd_nonce_state_versions_new(mem);
1519 0 : self->discriminant = fd_rng_uint( rng ) % 2;
1520 0 : fd_nonce_state_versions_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1521 0 : return mem;
1522 0 : }
1523 :
1524 0 : void *fd_compute_budget_program_instruction_request_units_deprecated_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1525 0 : fd_compute_budget_program_instruction_request_units_deprecated_t *self = (fd_compute_budget_program_instruction_request_units_deprecated_t *) mem;
1526 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_compute_budget_program_instruction_request_units_deprecated_t);
1527 0 : fd_compute_budget_program_instruction_request_units_deprecated_new(mem);
1528 0 : self->units = fd_rng_uint( rng );
1529 0 : self->additional_fee = fd_rng_uint( rng );
1530 0 : return mem;
1531 0 : }
1532 :
1533 0 : void fd_compute_budget_program_instruction_inner_generate( fd_compute_budget_program_instruction_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1534 0 : switch (discriminant) {
1535 0 : case 0: {
1536 0 : fd_compute_budget_program_instruction_request_units_deprecated_generate( &self->request_units_deprecated, alloc_mem, rng );
1537 0 : break;
1538 0 : }
1539 0 : case 1: {
1540 0 : self->request_heap_frame = fd_rng_uint( rng );
1541 0 : break;
1542 0 : }
1543 0 : case 2: {
1544 0 : self->set_compute_unit_limit = fd_rng_uint( rng );
1545 0 : break;
1546 0 : }
1547 0 : case 3: {
1548 0 : self->set_compute_unit_price = fd_rng_ulong( rng );
1549 0 : break;
1550 0 : }
1551 0 : case 4: {
1552 0 : self->set_loaded_accounts_data_size_limit = fd_rng_uint( rng );
1553 0 : break;
1554 0 : }
1555 0 : }
1556 0 : }
1557 0 : void *fd_compute_budget_program_instruction_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1558 0 : fd_compute_budget_program_instruction_t *self = (fd_compute_budget_program_instruction_t *) mem;
1559 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_compute_budget_program_instruction_t);
1560 0 : fd_compute_budget_program_instruction_new(mem);
1561 0 : self->discriminant = fd_rng_uint( rng ) % 5;
1562 0 : fd_compute_budget_program_instruction_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1563 0 : return mem;
1564 0 : }
1565 :
1566 0 : void *fd_config_keys_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1567 0 : fd_config_keys_t *self = (fd_config_keys_t *) mem;
1568 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_config_keys_t);
1569 0 : fd_config_keys_new(mem);
1570 0 : self->keys_len = fd_rng_ulong( rng ) % 8;
1571 0 : if( self->keys_len ) {
1572 0 : self->keys = (fd_config_keys_pair_t *) *alloc_mem;
1573 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_config_keys_pair_t)*self->keys_len;
1574 0 : for( ulong i=0; i < self->keys_len; i++ ) {
1575 0 : fd_config_keys_pair_new( self->keys + i );
1576 0 : fd_config_keys_pair_generate( self->keys + i, alloc_mem, rng );
1577 0 : }
1578 0 : } else {
1579 0 : self->keys = NULL;
1580 0 : }
1581 0 : return mem;
1582 0 : }
1583 :
1584 0 : void *fd_bpf_loader_program_instruction_write_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1585 0 : fd_bpf_loader_program_instruction_write_t *self = (fd_bpf_loader_program_instruction_write_t *) mem;
1586 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_loader_program_instruction_write_t);
1587 0 : fd_bpf_loader_program_instruction_write_new(mem);
1588 0 : self->offset = fd_rng_uint( rng );
1589 0 : self->bytes_len = fd_rng_ulong( rng ) % 8;
1590 0 : if( self->bytes_len ) {
1591 0 : self->bytes = (uchar *) *alloc_mem;
1592 0 : *alloc_mem = (uchar *) *alloc_mem + self->bytes_len;
1593 0 : for( ulong i=0; i < self->bytes_len; ++i) { self->bytes[i] = fd_rng_uchar( rng ) % 0x80; }
1594 0 : } else {
1595 0 : self->bytes = NULL;
1596 0 : }
1597 0 : return mem;
1598 0 : }
1599 :
1600 0 : void fd_bpf_loader_program_instruction_inner_generate( fd_bpf_loader_program_instruction_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1601 0 : switch (discriminant) {
1602 0 : case 0: {
1603 0 : fd_bpf_loader_program_instruction_write_generate( &self->write, alloc_mem, rng );
1604 0 : break;
1605 0 : }
1606 0 : }
1607 0 : }
1608 0 : void *fd_bpf_loader_program_instruction_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1609 0 : fd_bpf_loader_program_instruction_t *self = (fd_bpf_loader_program_instruction_t *) mem;
1610 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_loader_program_instruction_t);
1611 0 : fd_bpf_loader_program_instruction_new(mem);
1612 0 : self->discriminant = fd_rng_uint( rng ) % 2;
1613 0 : fd_bpf_loader_program_instruction_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1614 0 : return mem;
1615 0 : }
1616 :
1617 0 : void *fd_loader_v4_program_instruction_write_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1618 0 : fd_loader_v4_program_instruction_write_t *self = (fd_loader_v4_program_instruction_write_t *) mem;
1619 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_loader_v4_program_instruction_write_t);
1620 0 : fd_loader_v4_program_instruction_write_new(mem);
1621 0 : self->offset = fd_rng_uint( rng );
1622 0 : self->bytes_len = fd_rng_ulong( rng ) % 8;
1623 0 : if( self->bytes_len ) {
1624 0 : self->bytes = (uchar *) *alloc_mem;
1625 0 : *alloc_mem = (uchar *) *alloc_mem + self->bytes_len;
1626 0 : for( ulong i=0; i < self->bytes_len; ++i) { self->bytes[i] = fd_rng_uchar( rng ) % 0x80; }
1627 0 : } else {
1628 0 : self->bytes = NULL;
1629 0 : }
1630 0 : return mem;
1631 0 : }
1632 :
1633 0 : void *fd_loader_v4_program_instruction_copy_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1634 0 : fd_loader_v4_program_instruction_copy_t *self = (fd_loader_v4_program_instruction_copy_t *) mem;
1635 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_loader_v4_program_instruction_copy_t);
1636 0 : fd_loader_v4_program_instruction_copy_new(mem);
1637 0 : self->destination_offset = fd_rng_uint( rng );
1638 0 : self->source_offset = fd_rng_uint( rng );
1639 0 : self->length = fd_rng_uint( rng );
1640 0 : return mem;
1641 0 : }
1642 :
1643 0 : void *fd_loader_v4_program_instruction_set_program_length_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1644 0 : fd_loader_v4_program_instruction_set_program_length_t *self = (fd_loader_v4_program_instruction_set_program_length_t *) mem;
1645 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_loader_v4_program_instruction_set_program_length_t);
1646 0 : fd_loader_v4_program_instruction_set_program_length_new(mem);
1647 0 : self->new_size = fd_rng_uint( rng );
1648 0 : return mem;
1649 0 : }
1650 :
1651 0 : void fd_loader_v4_program_instruction_inner_generate( fd_loader_v4_program_instruction_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1652 0 : switch (discriminant) {
1653 0 : case 0: {
1654 0 : fd_loader_v4_program_instruction_write_generate( &self->write, alloc_mem, rng );
1655 0 : break;
1656 0 : }
1657 0 : case 1: {
1658 0 : fd_loader_v4_program_instruction_copy_generate( &self->copy, alloc_mem, rng );
1659 0 : break;
1660 0 : }
1661 0 : case 2: {
1662 0 : fd_loader_v4_program_instruction_set_program_length_generate( &self->set_program_length, alloc_mem, rng );
1663 0 : break;
1664 0 : }
1665 0 : }
1666 0 : }
1667 0 : void *fd_loader_v4_program_instruction_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1668 0 : fd_loader_v4_program_instruction_t *self = (fd_loader_v4_program_instruction_t *) mem;
1669 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_loader_v4_program_instruction_t);
1670 0 : fd_loader_v4_program_instruction_new(mem);
1671 0 : self->discriminant = fd_rng_uint( rng ) % 7;
1672 0 : fd_loader_v4_program_instruction_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1673 0 : return mem;
1674 0 : }
1675 :
1676 0 : void *fd_bpf_upgradeable_loader_program_instruction_write_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1677 0 : fd_bpf_upgradeable_loader_program_instruction_write_t *self = (fd_bpf_upgradeable_loader_program_instruction_write_t *) mem;
1678 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_write_t);
1679 0 : fd_bpf_upgradeable_loader_program_instruction_write_new(mem);
1680 0 : self->offset = fd_rng_uint( rng );
1681 0 : self->bytes_len = fd_rng_ulong( rng ) % 8;
1682 0 : if( self->bytes_len ) {
1683 0 : self->bytes = (uchar *) *alloc_mem;
1684 0 : *alloc_mem = (uchar *) *alloc_mem + self->bytes_len;
1685 0 : for( ulong i=0; i < self->bytes_len; ++i) { self->bytes[i] = fd_rng_uchar( rng ) % 0x80; }
1686 0 : } else {
1687 0 : self->bytes = NULL;
1688 0 : }
1689 0 : return mem;
1690 0 : }
1691 :
1692 0 : void *fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1693 0 : fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_t *self = (fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_t *) mem;
1694 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_t);
1695 0 : fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_new(mem);
1696 0 : self->max_data_len = fd_rng_ulong( rng );
1697 0 : return mem;
1698 0 : }
1699 :
1700 0 : void *fd_bpf_upgradeable_loader_program_instruction_extend_program_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1701 0 : fd_bpf_upgradeable_loader_program_instruction_extend_program_t *self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_t *) mem;
1702 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_extend_program_t);
1703 0 : fd_bpf_upgradeable_loader_program_instruction_extend_program_new(mem);
1704 0 : self->additional_bytes = fd_rng_uint( rng );
1705 0 : return mem;
1706 0 : }
1707 :
1708 0 : void *fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1709 0 : fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t *self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t *) mem;
1710 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t);
1711 0 : fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_new(mem);
1712 0 : self->additional_bytes = fd_rng_uint( rng );
1713 0 : return mem;
1714 0 : }
1715 :
1716 0 : void fd_bpf_upgradeable_loader_program_instruction_inner_generate( fd_bpf_upgradeable_loader_program_instruction_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1717 0 : switch (discriminant) {
1718 0 : case 1: {
1719 0 : fd_bpf_upgradeable_loader_program_instruction_write_generate( &self->write, alloc_mem, rng );
1720 0 : break;
1721 0 : }
1722 0 : case 2: {
1723 0 : fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_generate( &self->deploy_with_max_data_len, alloc_mem, rng );
1724 0 : break;
1725 0 : }
1726 0 : case 6: {
1727 0 : fd_bpf_upgradeable_loader_program_instruction_extend_program_generate( &self->extend_program, alloc_mem, rng );
1728 0 : break;
1729 0 : }
1730 0 : case 9: {
1731 0 : fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_generate( &self->extend_program_checked, alloc_mem, rng );
1732 0 : break;
1733 0 : }
1734 0 : }
1735 0 : }
1736 0 : void *fd_bpf_upgradeable_loader_program_instruction_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1737 0 : fd_bpf_upgradeable_loader_program_instruction_t *self = (fd_bpf_upgradeable_loader_program_instruction_t *) mem;
1738 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_t);
1739 0 : fd_bpf_upgradeable_loader_program_instruction_new(mem);
1740 0 : self->discriminant = fd_rng_uint( rng ) % 10;
1741 0 : fd_bpf_upgradeable_loader_program_instruction_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1742 0 : return mem;
1743 0 : }
1744 :
1745 0 : void *fd_bpf_upgradeable_loader_state_buffer_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1746 0 : fd_bpf_upgradeable_loader_state_buffer_t *self = (fd_bpf_upgradeable_loader_state_buffer_t *) mem;
1747 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_upgradeable_loader_state_buffer_t);
1748 0 : fd_bpf_upgradeable_loader_state_buffer_new(mem);
1749 0 : {
1750 0 : self->has_authority_address = fd_rng_uchar( rng ) % 2;
1751 0 : if( self->has_authority_address ) {
1752 0 : fd_pubkey_generate( &self->authority_address, alloc_mem, rng );
1753 0 : }
1754 0 : }
1755 0 : return mem;
1756 0 : }
1757 :
1758 0 : void *fd_bpf_upgradeable_loader_state_program_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1759 0 : fd_bpf_upgradeable_loader_state_program_t *self = (fd_bpf_upgradeable_loader_state_program_t *) mem;
1760 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_upgradeable_loader_state_program_t);
1761 0 : fd_bpf_upgradeable_loader_state_program_new(mem);
1762 0 : fd_pubkey_generate( &self->programdata_address, alloc_mem, rng );
1763 0 : return mem;
1764 0 : }
1765 :
1766 0 : void *fd_bpf_upgradeable_loader_state_program_data_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1767 0 : fd_bpf_upgradeable_loader_state_program_data_t *self = (fd_bpf_upgradeable_loader_state_program_data_t *) mem;
1768 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_upgradeable_loader_state_program_data_t);
1769 0 : fd_bpf_upgradeable_loader_state_program_data_new(mem);
1770 0 : self->slot = fd_rng_ulong( rng );
1771 0 : {
1772 0 : self->has_upgrade_authority_address = fd_rng_uchar( rng ) % 2;
1773 0 : if( self->has_upgrade_authority_address ) {
1774 0 : fd_pubkey_generate( &self->upgrade_authority_address, alloc_mem, rng );
1775 0 : }
1776 0 : }
1777 0 : return mem;
1778 0 : }
1779 :
1780 0 : void fd_bpf_upgradeable_loader_state_inner_generate( fd_bpf_upgradeable_loader_state_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1781 0 : switch (discriminant) {
1782 0 : case 1: {
1783 0 : fd_bpf_upgradeable_loader_state_buffer_generate( &self->buffer, alloc_mem, rng );
1784 0 : break;
1785 0 : }
1786 0 : case 2: {
1787 0 : fd_bpf_upgradeable_loader_state_program_generate( &self->program, alloc_mem, rng );
1788 0 : break;
1789 0 : }
1790 0 : case 3: {
1791 0 : fd_bpf_upgradeable_loader_state_program_data_generate( &self->program_data, alloc_mem, rng );
1792 0 : break;
1793 0 : }
1794 0 : }
1795 0 : }
1796 0 : void *fd_bpf_upgradeable_loader_state_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1797 0 : fd_bpf_upgradeable_loader_state_t *self = (fd_bpf_upgradeable_loader_state_t *) mem;
1798 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_bpf_upgradeable_loader_state_t);
1799 0 : fd_bpf_upgradeable_loader_state_new(mem);
1800 0 : self->discriminant = fd_rng_uint( rng ) % 4;
1801 0 : fd_bpf_upgradeable_loader_state_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1802 0 : return mem;
1803 0 : }
1804 :
1805 0 : void *fd_loader_v4_state_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1806 0 : fd_loader_v4_state_t *self = (fd_loader_v4_state_t *) mem;
1807 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_loader_v4_state_t);
1808 0 : fd_loader_v4_state_new(mem);
1809 0 : self->slot = fd_rng_ulong( rng );
1810 0 : fd_pubkey_generate( &self->authority_address_or_next_version, alloc_mem, rng );
1811 0 : self->status = fd_rng_ulong( rng );
1812 0 : return mem;
1813 0 : }
1814 :
1815 0 : void *fd_frozen_hash_status_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1816 0 : fd_frozen_hash_status_t *self = (fd_frozen_hash_status_t *) mem;
1817 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_frozen_hash_status_t);
1818 0 : fd_frozen_hash_status_new(mem);
1819 0 : fd_hash_generate( &self->frozen_hash, alloc_mem, rng );
1820 0 : self->is_duplicate_confirmed = fd_rng_uchar( rng );
1821 0 : return mem;
1822 0 : }
1823 :
1824 0 : void fd_frozen_hash_versioned_inner_generate( fd_frozen_hash_versioned_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1825 0 : switch (discriminant) {
1826 0 : case 0: {
1827 0 : fd_frozen_hash_status_generate( &self->current, alloc_mem, rng );
1828 0 : break;
1829 0 : }
1830 0 : }
1831 0 : }
1832 0 : void *fd_frozen_hash_versioned_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1833 0 : fd_frozen_hash_versioned_t *self = (fd_frozen_hash_versioned_t *) mem;
1834 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_frozen_hash_versioned_t);
1835 0 : fd_frozen_hash_versioned_new(mem);
1836 0 : self->discriminant = fd_rng_uint( rng ) % 1;
1837 0 : fd_frozen_hash_versioned_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1838 0 : return mem;
1839 0 : }
1840 :
1841 0 : void *fd_lookup_table_meta_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1842 0 : fd_lookup_table_meta_t *self = (fd_lookup_table_meta_t *) mem;
1843 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_lookup_table_meta_t);
1844 0 : fd_lookup_table_meta_new(mem);
1845 0 : self->deactivation_slot = fd_rng_ulong( rng );
1846 0 : self->last_extended_slot = fd_rng_ulong( rng );
1847 0 : self->last_extended_slot_start_index = fd_rng_uchar( rng );
1848 0 : {
1849 0 : self->has_authority = fd_rng_uchar( rng ) % 2;
1850 0 : if( self->has_authority ) {
1851 0 : fd_pubkey_generate( &self->authority, alloc_mem, rng );
1852 0 : }
1853 0 : }
1854 0 : self->_padding = fd_rng_ushort( rng );
1855 0 : return mem;
1856 0 : }
1857 :
1858 0 : void *fd_address_lookup_table_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1859 0 : fd_address_lookup_table_t *self = (fd_address_lookup_table_t *) mem;
1860 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_address_lookup_table_t);
1861 0 : fd_address_lookup_table_new(mem);
1862 0 : fd_lookup_table_meta_generate( &self->meta, alloc_mem, rng );
1863 0 : return mem;
1864 0 : }
1865 :
1866 0 : void fd_address_lookup_table_state_inner_generate( fd_address_lookup_table_state_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1867 0 : switch (discriminant) {
1868 0 : case 1: {
1869 0 : fd_address_lookup_table_generate( &self->lookup_table, alloc_mem, rng );
1870 0 : break;
1871 0 : }
1872 0 : }
1873 0 : }
1874 0 : void *fd_address_lookup_table_state_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1875 0 : fd_address_lookup_table_state_t *self = (fd_address_lookup_table_state_t *) mem;
1876 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_address_lookup_table_state_t);
1877 0 : fd_address_lookup_table_state_new(mem);
1878 0 : self->discriminant = fd_rng_uint( rng ) % 2;
1879 0 : fd_address_lookup_table_state_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1880 0 : return mem;
1881 0 : }
1882 :
1883 0 : void *fd_addrlut_create_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1884 0 : fd_addrlut_create_t *self = (fd_addrlut_create_t *) mem;
1885 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_addrlut_create_t);
1886 0 : fd_addrlut_create_new(mem);
1887 0 : self->recent_slot = fd_rng_ulong( rng );
1888 0 : self->bump_seed = fd_rng_uchar( rng );
1889 0 : return mem;
1890 0 : }
1891 :
1892 0 : void *fd_addrlut_extend_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1893 0 : fd_addrlut_extend_t *self = (fd_addrlut_extend_t *) mem;
1894 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_addrlut_extend_t);
1895 0 : fd_addrlut_extend_new(mem);
1896 0 : self->new_addrs_len = fd_rng_ulong( rng ) % 8;
1897 0 : if( self->new_addrs_len ) {
1898 0 : self->new_addrs = (fd_pubkey_t *) *alloc_mem;
1899 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_pubkey_t)*self->new_addrs_len;
1900 0 : for( ulong i=0; i < self->new_addrs_len; i++ ) {
1901 0 : fd_pubkey_new( self->new_addrs + i );
1902 0 : fd_pubkey_generate( self->new_addrs + i, alloc_mem, rng );
1903 0 : }
1904 0 : } else {
1905 0 : self->new_addrs = NULL;
1906 0 : }
1907 0 : return mem;
1908 0 : }
1909 :
1910 0 : void fd_addrlut_instruction_inner_generate( fd_addrlut_instruction_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1911 0 : switch (discriminant) {
1912 0 : case 0: {
1913 0 : fd_addrlut_create_generate( &self->create_lut, alloc_mem, rng );
1914 0 : break;
1915 0 : }
1916 0 : case 2: {
1917 0 : fd_addrlut_extend_generate( &self->extend_lut, alloc_mem, rng );
1918 0 : break;
1919 0 : }
1920 0 : }
1921 0 : }
1922 0 : void *fd_addrlut_instruction_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1923 0 : fd_addrlut_instruction_t *self = (fd_addrlut_instruction_t *) mem;
1924 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_addrlut_instruction_t);
1925 0 : fd_addrlut_instruction_new(mem);
1926 0 : self->discriminant = fd_rng_uint( rng ) % 5;
1927 0 : fd_addrlut_instruction_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1928 0 : return mem;
1929 0 : }
1930 :
1931 0 : void *fd_calculated_stake_points_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1932 0 : fd_calculated_stake_points_t *self = (fd_calculated_stake_points_t *) mem;
1933 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_calculated_stake_points_t);
1934 0 : fd_calculated_stake_points_new(mem);
1935 0 : self->points = (fd_w_u128_t) { .ul={ fd_rng_ulong( rng ), fd_rng_ulong( rng ) } };
1936 0 : self->new_credits_observed = fd_rng_ulong( rng );
1937 0 : self->force_credits_update_with_skipped_reward = fd_rng_uchar( rng );
1938 0 : return mem;
1939 0 : }
1940 :
1941 0 : void *fd_calculated_stake_rewards_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1942 0 : fd_calculated_stake_rewards_t *self = (fd_calculated_stake_rewards_t *) mem;
1943 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_calculated_stake_rewards_t);
1944 0 : fd_calculated_stake_rewards_new(mem);
1945 0 : self->staker_rewards = fd_rng_ulong( rng );
1946 0 : self->voter_rewards = fd_rng_ulong( rng );
1947 0 : self->new_credits_observed = fd_rng_ulong( rng );
1948 0 : return mem;
1949 0 : }
1950 :
1951 0 : void *fd_usage_cost_details_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1952 0 : fd_usage_cost_details_t *self = (fd_usage_cost_details_t *) mem;
1953 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_usage_cost_details_t);
1954 0 : fd_usage_cost_details_new(mem);
1955 0 : self->signature_cost = fd_rng_ulong( rng );
1956 0 : self->write_lock_cost = fd_rng_ulong( rng );
1957 0 : self->data_bytes_cost = fd_rng_ulong( rng );
1958 0 : self->programs_execution_cost = fd_rng_ulong( rng );
1959 0 : self->loaded_accounts_data_size_cost = fd_rng_ulong( rng );
1960 0 : self->allocated_accounts_data_size = fd_rng_ulong( rng );
1961 0 : return mem;
1962 0 : }
1963 :
1964 0 : void fd_transaction_cost_inner_generate( fd_transaction_cost_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1965 0 : switch (discriminant) {
1966 0 : case 1: {
1967 0 : fd_usage_cost_details_generate( &self->transaction, alloc_mem, rng );
1968 0 : break;
1969 0 : }
1970 0 : }
1971 0 : }
1972 0 : void *fd_transaction_cost_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1973 0 : fd_transaction_cost_t *self = (fd_transaction_cost_t *) mem;
1974 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_transaction_cost_t);
1975 0 : fd_transaction_cost_new(mem);
1976 0 : self->discriminant = fd_rng_uint( rng ) % 2;
1977 0 : fd_transaction_cost_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
1978 0 : return mem;
1979 0 : }
1980 :
1981 0 : void *fd_rent_paying_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1982 0 : fd_rent_paying_t *self = (fd_rent_paying_t *) mem;
1983 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_rent_paying_t);
1984 0 : fd_rent_paying_new(mem);
1985 0 : self->lamports = fd_rng_ulong( rng );
1986 0 : self->data_size = fd_rng_ulong( rng );
1987 0 : return mem;
1988 0 : }
1989 :
1990 0 : void fd_rent_state_inner_generate( fd_rent_state_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1991 0 : switch (discriminant) {
1992 0 : case 1: {
1993 0 : fd_rent_paying_generate( &self->rent_paying, alloc_mem, rng );
1994 0 : break;
1995 0 : }
1996 0 : }
1997 0 : }
1998 0 : void *fd_rent_state_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1999 0 : fd_rent_state_t *self = (fd_rent_state_t *) mem;
2000 0 : *alloc_mem = (uchar *) *alloc_mem + sizeof(fd_rent_state_t);
2001 0 : fd_rent_state_new(mem);
2002 0 : self->discriminant = fd_rng_uint( rng ) % 3;
2003 0 : fd_rent_state_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
2004 0 : return mem;
2005 0 : }
2006 :
2007 : #endif // HEADER_FUZZ_FD_RUNTIME_TYPES
|