LCOV - code coverage report
Current view: top level - flamenco/types - fd_types.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 1979 8019 24.7 %
Date: 2026-04-01 06:30:45 Functions: 194 743 26.1 %

          Line data    Source code
       1             : // This is an auto-generated file. To add entries, edit fd_types.json
       2             : #include "fd_types.h"
       3             : #pragma GCC diagnostic ignored "-Wunused-parameter"
       4             : #pragma GCC diagnostic ignored "-Wunused-variable"
       5             : #pragma GCC diagnostic ignored "-Wunused-function"
       6             : #if defined(__GNUC__) && (__GNUC__ >= 9)
       7             : #pragma GCC diagnostic ignored "-Waddress-of-packed-member"
       8             : #endif
       9             : #define SOURCE_fd_src_flamenco_types_fd_types_c
      10             : #include "fd_types_custom.h"
      11           0 : int fd_fee_calculator_encode( fd_fee_calculator_t const * self, fd_bincode_encode_ctx_t * ctx ) {
      12           0 :   int err;
      13           0 :   err = fd_bincode_uint64_encode( self->lamports_per_signature, ctx );
      14           0 :   if( FD_UNLIKELY( err ) ) return err;
      15           0 :   return FD_BINCODE_SUCCESS;
      16           0 : }
      17           0 : static inline int fd_fee_calculator_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
      18           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
      19           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
      20           0 :   return 0;
      21           0 : }
      22       34041 : static void fd_fee_calculator_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
      23       34041 :   fd_fee_calculator_t * self = (fd_fee_calculator_t *)struct_mem;
      24       34041 :   fd_bincode_uint64_decode_unsafe( &self->lamports_per_signature, ctx );
      25       34041 : }
      26           0 : void * fd_fee_calculator_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
      27           0 :   fd_fee_calculator_t * self = (fd_fee_calculator_t *)mem;
      28           0 :   fd_fee_calculator_new( self );
      29           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_fee_calculator_t);
      30           0 :   void * * alloc_mem = &alloc_region;
      31           0 :   fd_fee_calculator_decode_inner( mem, alloc_mem, ctx );
      32           0 :   return self;
      33           0 : }
      34           9 : int fd_fee_rate_governor_encode( fd_fee_rate_governor_t const * self, fd_bincode_encode_ctx_t * ctx ) {
      35           9 :   int err;
      36           9 :   err = fd_bincode_uint64_encode( self->target_lamports_per_signature, ctx );
      37           9 :   if( FD_UNLIKELY( err ) ) return err;
      38           9 :   err = fd_bincode_uint64_encode( self->target_signatures_per_slot, ctx );
      39           9 :   if( FD_UNLIKELY( err ) ) return err;
      40           9 :   err = fd_bincode_uint64_encode( self->min_lamports_per_signature, ctx );
      41           9 :   if( FD_UNLIKELY( err ) ) return err;
      42           9 :   err = fd_bincode_uint64_encode( self->max_lamports_per_signature, ctx );
      43           9 :   if( FD_UNLIKELY( err ) ) return err;
      44           9 :   err = fd_bincode_uint8_encode( (uchar)(self->burn_percent), ctx );
      45           9 :   if( FD_UNLIKELY( err ) ) return err;
      46           9 :   return FD_BINCODE_SUCCESS;
      47           9 : }
      48           0 : static inline int fd_fee_rate_governor_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
      49           0 :   if( (ulong)ctx->data + 33UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
      50           0 :   ctx->data = (void *)( (ulong)ctx->data + 33UL );
      51           0 :   return 0;
      52           0 : }
      53           0 : static void fd_fee_rate_governor_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
      54           0 :   fd_fee_rate_governor_t * self = (fd_fee_rate_governor_t *)struct_mem;
      55           0 :   fd_bincode_uint64_decode_unsafe( &self->target_lamports_per_signature, ctx );
      56           0 :   fd_bincode_uint64_decode_unsafe( &self->target_signatures_per_slot, ctx );
      57           0 :   fd_bincode_uint64_decode_unsafe( &self->min_lamports_per_signature, ctx );
      58           0 :   fd_bincode_uint64_decode_unsafe( &self->max_lamports_per_signature, ctx );
      59           0 :   fd_bincode_uint8_decode_unsafe( &self->burn_percent, ctx );
      60           0 : }
      61           0 : void * fd_fee_rate_governor_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
      62           0 :   fd_fee_rate_governor_t * self = (fd_fee_rate_governor_t *)mem;
      63           0 :   fd_fee_rate_governor_new( self );
      64           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_fee_rate_governor_t);
      65           0 :   void * * alloc_mem = &alloc_region;
      66           0 :   fd_fee_rate_governor_decode_inner( mem, alloc_mem, ctx );
      67           0 :   return self;
      68           0 : }
      69           0 : int fd_slot_pair_encode( fd_slot_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
      70           0 :   int err;
      71           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
      72           0 :   if( FD_UNLIKELY( err ) ) return err;
      73           0 :   err = fd_bincode_uint64_encode( self->val, ctx );
      74           0 :   if( FD_UNLIKELY( err ) ) return err;
      75           0 :   return FD_BINCODE_SUCCESS;
      76           0 : }
      77           0 : static inline int fd_slot_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
      78           0 :   if( (ulong)ctx->data + 16UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
      79           0 :   ctx->data = (void *)( (ulong)ctx->data + 16UL );
      80           0 :   return 0;
      81           0 : }
      82           0 : static void fd_slot_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
      83           0 :   fd_slot_pair_t * self = (fd_slot_pair_t *)struct_mem;
      84           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
      85           0 :   fd_bincode_uint64_decode_unsafe( &self->val, ctx );
      86           0 : }
      87           0 : void * fd_slot_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
      88           0 :   fd_slot_pair_t * self = (fd_slot_pair_t *)mem;
      89           0 :   fd_slot_pair_new( self );
      90           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_pair_t);
      91           0 :   void * * alloc_mem = &alloc_region;
      92           0 :   fd_slot_pair_decode_inner( mem, alloc_mem, ctx );
      93           0 :   return self;
      94           0 : }
      95           0 : int fd_hard_forks_encode( fd_hard_forks_t const * self, fd_bincode_encode_ctx_t * ctx ) {
      96           0 :   int err;
      97           0 :   err = fd_bincode_uint64_encode( self->hard_forks_len, ctx );
      98           0 :   if( FD_UNLIKELY(err) ) return err;
      99           0 :   if( self->hard_forks_len ) {
     100           0 :     for( ulong i=0; i < self->hard_forks_len; i++ ) {
     101           0 :       err = fd_slot_pair_encode( self->hard_forks + i, ctx );
     102           0 :       if( FD_UNLIKELY( err ) ) return err;
     103           0 :     }
     104           0 :   }
     105           0 :   return FD_BINCODE_SUCCESS;
     106           0 : }
     107           0 : int fd_hard_forks_encode_global( fd_hard_forks_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     108           0 :   int err;
     109           0 :   err = fd_bincode_uint64_encode( self->hard_forks_len, ctx );
     110           0 :   if( FD_UNLIKELY( err ) ) return err;
     111           0 :   if( self->hard_forks_len ) {
     112           0 :     uchar * hard_forks_laddr = (uchar*)self + self->hard_forks_offset;
     113           0 :     fd_slot_pair_t * hard_forks = (fd_slot_pair_t *)hard_forks_laddr;
     114           0 :     for( ulong i=0; i < self->hard_forks_len; i++ ) {
     115           0 :       err = fd_slot_pair_encode( &hard_forks[i], ctx );
     116           0 :       if( FD_UNLIKELY( err ) ) return err;
     117           0 :     }
     118           0 :   }
     119           0 :   return FD_BINCODE_SUCCESS;
     120           0 : }
     121           0 : static int fd_hard_forks_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     122           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     123           0 :   int err = 0;
     124           0 :   ulong hard_forks_len;
     125           0 :   err = fd_bincode_uint64_decode( &hard_forks_len, ctx );
     126           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     127           0 :   if( hard_forks_len ) {
     128           0 :     *total_sz += FD_SLOT_PAIR_ALIGN + sizeof(fd_slot_pair_t)*hard_forks_len;
     129           0 :     for( ulong i=0; i < hard_forks_len; i++ ) {
     130           0 :       err = fd_slot_pair_decode_footprint_inner( ctx, total_sz );
     131           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     132           0 :     }
     133           0 :   }
     134           0 :   return 0;
     135           0 : }
     136           0 : int fd_hard_forks_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     137           0 :   *total_sz += sizeof(fd_hard_forks_t);
     138           0 :   void const * start_data = ctx->data;
     139           0 :   int err = fd_hard_forks_decode_footprint_inner( ctx, total_sz );
     140           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     141           0 :   ctx->data = start_data;
     142           0 :   return err;
     143           0 : }
     144           0 : static void fd_hard_forks_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     145           0 :   fd_hard_forks_t * self = (fd_hard_forks_t *)struct_mem;
     146           0 :   fd_bincode_uint64_decode_unsafe( &self->hard_forks_len, ctx );
     147           0 :   if( self->hard_forks_len ) {
     148           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_SLOT_PAIR_ALIGN );
     149           0 :     self->hard_forks = *alloc_mem;
     150           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_slot_pair_t)*self->hard_forks_len;
     151           0 :     for( ulong i=0; i < self->hard_forks_len; i++ ) {
     152           0 :       fd_slot_pair_new( self->hard_forks + i );
     153           0 :       fd_slot_pair_decode_inner( self->hard_forks + i, alloc_mem, ctx );
     154           0 :     }
     155           0 :   } else
     156           0 :     self->hard_forks = NULL;
     157           0 : }
     158           0 : void * fd_hard_forks_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     159           0 :   fd_hard_forks_t * self = (fd_hard_forks_t *)mem;
     160           0 :   fd_hard_forks_new( self );
     161           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_hard_forks_t);
     162           0 :   void * * alloc_mem = &alloc_region;
     163           0 :   fd_hard_forks_decode_inner( mem, alloc_mem, ctx );
     164           0 :   return self;
     165           0 : }
     166           0 : static void fd_hard_forks_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     167           0 :   fd_hard_forks_global_t * self = (fd_hard_forks_global_t *)struct_mem;
     168           0 :   fd_bincode_uint64_decode_unsafe( &self->hard_forks_len, ctx );
     169           0 :   if( self->hard_forks_len ) {
     170           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_SLOT_PAIR_ALIGN );
     171           0 :     self->hard_forks_offset = (ulong)*alloc_mem - (ulong)struct_mem;
     172           0 :     uchar * cur_mem = (uchar *)(*alloc_mem);
     173           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_slot_pair_t)*self->hard_forks_len;
     174           0 :     for( ulong i=0; i < self->hard_forks_len; i++ ) {
     175           0 :       fd_slot_pair_new( (fd_slot_pair_t *)fd_type_pun(cur_mem + sizeof(fd_slot_pair_t) * i) );
     176           0 :       fd_slot_pair_decode_inner( cur_mem + sizeof(fd_slot_pair_t) * i, alloc_mem, ctx );
     177           0 :     }
     178           0 :   } else {
     179           0 :     self->hard_forks_offset = 0UL;
     180           0 :   }
     181           0 : }
     182           0 : void * fd_hard_forks_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     183           0 :   fd_hard_forks_global_t * self = (fd_hard_forks_global_t *)mem;
     184           0 :   fd_hard_forks_new( (fd_hard_forks_t *)self );
     185           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_hard_forks_global_t);
     186           0 :   void * * alloc_mem = &alloc_region;
     187           0 :   fd_hard_forks_decode_inner_global( mem, alloc_mem, ctx );
     188           0 :   return self;
     189           0 : }
     190           0 : void fd_hard_forks_new(fd_hard_forks_t * self) {
     191           0 :   fd_memset( self, 0, sizeof(fd_hard_forks_t) );
     192           0 : }
     193           0 : ulong fd_hard_forks_size( fd_hard_forks_t const * self ) {
     194           0 :   ulong size = 0;
     195           0 :   do {
     196           0 :     size += sizeof(ulong);
     197           0 :     for( ulong i=0; i < self->hard_forks_len; i++ )
     198           0 :       size += fd_slot_pair_size( self->hard_forks + i );
     199           0 :   } while(0);
     200           0 :   return size;
     201           0 : }
     202             : 
     203           0 : ulong fd_hard_forks_size_global( fd_hard_forks_global_t const * self ) {
     204           0 :   ulong size = 0;
     205           0 :   do {
     206           0 :     size += sizeof(ulong);
     207           0 :     fd_slot_pair_t * hard_forks = self->hard_forks_offset ? (fd_slot_pair_t *)fd_type_pun( (uchar *)self + self->hard_forks_offset ) : NULL;
     208           0 :     for( ulong i=0; i < self->hard_forks_len; i++ )
     209           0 :       size += fd_slot_pair_size( hard_forks + i );
     210           0 :   } while(0);
     211           0 :   return size;
     212           0 : }
     213             : 
     214           9 : int fd_inflation_encode( fd_inflation_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     215           9 :   int err;
     216           9 :   err = fd_bincode_double_encode( self->initial, ctx );
     217           9 :   if( FD_UNLIKELY( err ) ) return err;
     218           9 :   err = fd_bincode_double_encode( self->terminal, ctx );
     219           9 :   if( FD_UNLIKELY( err ) ) return err;
     220           9 :   err = fd_bincode_double_encode( self->taper, ctx );
     221           9 :   if( FD_UNLIKELY( err ) ) return err;
     222           9 :   err = fd_bincode_double_encode( self->foundation, ctx );
     223           9 :   if( FD_UNLIKELY( err ) ) return err;
     224           9 :   err = fd_bincode_double_encode( self->foundation_term, ctx );
     225           9 :   if( FD_UNLIKELY( err ) ) return err;
     226           9 :   err = fd_bincode_double_encode( self->unused, ctx );
     227           9 :   if( FD_UNLIKELY( err ) ) return err;
     228           9 :   return FD_BINCODE_SUCCESS;
     229           9 : }
     230           0 : static inline int fd_inflation_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     231           0 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     232           0 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
     233           0 :   return 0;
     234           0 : }
     235           0 : static void fd_inflation_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     236           0 :   fd_inflation_t * self = (fd_inflation_t *)struct_mem;
     237           0 :   fd_bincode_double_decode_unsafe( &self->initial, ctx );
     238           0 :   fd_bincode_double_decode_unsafe( &self->terminal, ctx );
     239           0 :   fd_bincode_double_decode_unsafe( &self->taper, ctx );
     240           0 :   fd_bincode_double_decode_unsafe( &self->foundation, ctx );
     241           0 :   fd_bincode_double_decode_unsafe( &self->foundation_term, ctx );
     242           0 :   fd_bincode_double_decode_unsafe( &self->unused, ctx );
     243           0 : }
     244           0 : void * fd_inflation_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     245           0 :   fd_inflation_t * self = (fd_inflation_t *)mem;
     246           0 :   fd_inflation_new( self );
     247           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_inflation_t);
     248           0 :   void * * alloc_mem = &alloc_region;
     249           0 :   fd_inflation_decode_inner( mem, alloc_mem, ctx );
     250           0 :   return self;
     251           0 : }
     252         117 : int fd_rent_encode( fd_rent_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     253         117 :   int err;
     254         117 :   err = fd_bincode_uint64_encode( self->lamports_per_uint8_year, ctx );
     255         117 :   if( FD_UNLIKELY( err ) ) return err;
     256         117 :   err = fd_bincode_double_encode( self->exemption_threshold, ctx );
     257         117 :   if( FD_UNLIKELY( err ) ) return err;
     258         117 :   err = fd_bincode_uint8_encode( (uchar)(self->burn_percent), ctx );
     259         117 :   if( FD_UNLIKELY( err ) ) return err;
     260         117 :   return FD_BINCODE_SUCCESS;
     261         117 : }
     262           0 : static inline int fd_rent_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     263           0 :   if( (ulong)ctx->data + 17UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     264           0 :   ctx->data = (void *)( (ulong)ctx->data + 17UL );
     265           0 :   return 0;
     266           0 : }
     267         168 : static void fd_rent_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     268         168 :   fd_rent_t * self = (fd_rent_t *)struct_mem;
     269         168 :   fd_bincode_uint64_decode_unsafe( &self->lamports_per_uint8_year, ctx );
     270         168 :   fd_bincode_double_decode_unsafe( &self->exemption_threshold, ctx );
     271         168 :   fd_bincode_uint8_decode_unsafe( &self->burn_percent, ctx );
     272         168 : }
     273         168 : void * fd_rent_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     274         168 :   fd_rent_t * self = (fd_rent_t *)mem;
     275         168 :   fd_rent_new( self );
     276         168 :   void * alloc_region = (uchar *)mem + sizeof(fd_rent_t);
     277         168 :   void * * alloc_mem = &alloc_region;
     278         168 :   fd_rent_decode_inner( mem, alloc_mem, ctx );
     279         168 :   return self;
     280         168 : }
     281         114 : int fd_epoch_schedule_encode( fd_epoch_schedule_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     282         114 :   int err;
     283         114 :   err = fd_bincode_uint64_encode( self->slots_per_epoch, ctx );
     284         114 :   if( FD_UNLIKELY( err ) ) return err;
     285         114 :   err = fd_bincode_uint64_encode( self->leader_schedule_slot_offset, ctx );
     286         114 :   if( FD_UNLIKELY( err ) ) return err;
     287         114 :   err = fd_bincode_bool_encode( (uchar)(self->warmup), ctx );
     288         114 :   if( FD_UNLIKELY( err ) ) return err;
     289         114 :   err = fd_bincode_uint64_encode( self->first_normal_epoch, ctx );
     290         114 :   if( FD_UNLIKELY( err ) ) return err;
     291         114 :   err = fd_bincode_uint64_encode( self->first_normal_slot, ctx );
     292         114 :   if( FD_UNLIKELY( err ) ) return err;
     293         114 :   return FD_BINCODE_SUCCESS;
     294         114 : }
     295         162 : static int fd_epoch_schedule_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     296         162 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     297         162 :   int err = 0;
     298         162 :   err = fd_bincode_uint64_decode_footprint( ctx );
     299         162 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     300         162 :   err = fd_bincode_uint64_decode_footprint( ctx );
     301         162 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     302         162 :   err = fd_bincode_bool_decode_footprint( ctx );
     303         162 :   if( FD_UNLIKELY( err ) ) return err;
     304         162 :   err = fd_bincode_uint64_decode_footprint( ctx );
     305         162 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     306         162 :   err = fd_bincode_uint64_decode_footprint( ctx );
     307         162 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     308         162 :   return 0;
     309         162 : }
     310         162 : int fd_epoch_schedule_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     311         162 :   *total_sz += sizeof(fd_epoch_schedule_t);
     312         162 :   void const * start_data = ctx->data;
     313         162 :   int err = fd_epoch_schedule_decode_footprint_inner( ctx, total_sz );
     314         162 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     315         162 :   ctx->data = start_data;
     316         162 :   return err;
     317         162 : }
     318         159 : static void fd_epoch_schedule_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     319         159 :   fd_epoch_schedule_t * self = (fd_epoch_schedule_t *)struct_mem;
     320         159 :   fd_bincode_uint64_decode_unsafe( &self->slots_per_epoch, ctx );
     321         159 :   fd_bincode_uint64_decode_unsafe( &self->leader_schedule_slot_offset, ctx );
     322         159 :   fd_bincode_bool_decode_unsafe( &self->warmup, ctx );
     323         159 :   fd_bincode_uint64_decode_unsafe( &self->first_normal_epoch, ctx );
     324         159 :   fd_bincode_uint64_decode_unsafe( &self->first_normal_slot, ctx );
     325         159 : }
     326         159 : void * fd_epoch_schedule_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     327         159 :   fd_epoch_schedule_t * self = (fd_epoch_schedule_t *)mem;
     328         159 :   fd_epoch_schedule_new( self );
     329         159 :   void * alloc_region = (uchar *)mem + sizeof(fd_epoch_schedule_t);
     330         159 :   void * * alloc_mem = &alloc_region;
     331         159 :   fd_epoch_schedule_decode_inner( mem, alloc_mem, ctx );
     332         159 :   return self;
     333         159 : }
     334         171 : void fd_epoch_schedule_new(fd_epoch_schedule_t * self) {
     335         171 :   fd_memset( self, 0, sizeof(fd_epoch_schedule_t) );
     336         171 : }
     337          45 : int fd_stake_history_entry_encode( fd_stake_history_entry_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     338          45 :   int err;
     339          45 :   err = fd_bincode_uint64_encode( self->effective, ctx );
     340          45 :   if( FD_UNLIKELY( err ) ) return err;
     341          45 :   err = fd_bincode_uint64_encode( self->activating, ctx );
     342          45 :   if( FD_UNLIKELY( err ) ) return err;
     343          45 :   err = fd_bincode_uint64_encode( self->deactivating, ctx );
     344          45 :   if( FD_UNLIKELY( err ) ) return err;
     345          45 :   return FD_BINCODE_SUCCESS;
     346          45 : }
     347           0 : static inline int fd_stake_history_entry_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     348           0 :   if( (ulong)ctx->data + 24UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     349           0 :   ctx->data = (void *)( (ulong)ctx->data + 24UL );
     350           0 :   return 0;
     351           0 : }
     352         156 : static void fd_stake_history_entry_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     353         156 :   fd_stake_history_entry_t * self = (fd_stake_history_entry_t *)struct_mem;
     354         156 :   fd_bincode_uint64_decode_unsafe( &self->effective, ctx );
     355         156 :   fd_bincode_uint64_decode_unsafe( &self->activating, ctx );
     356         156 :   fd_bincode_uint64_decode_unsafe( &self->deactivating, ctx );
     357         156 : }
     358           0 : void * fd_stake_history_entry_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     359           0 :   fd_stake_history_entry_t * self = (fd_stake_history_entry_t *)mem;
     360           0 :   fd_stake_history_entry_new( self );
     361           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_history_entry_t);
     362           0 :   void * * alloc_mem = &alloc_region;
     363           0 :   fd_stake_history_entry_decode_inner( mem, alloc_mem, ctx );
     364           0 :   return self;
     365           0 : }
     366          45 : int fd_epoch_stake_history_entry_pair_encode( fd_epoch_stake_history_entry_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     367          45 :   int err;
     368          45 :   err = fd_bincode_uint64_encode( self->epoch, ctx );
     369          45 :   if( FD_UNLIKELY( err ) ) return err;
     370          45 :   err = fd_stake_history_entry_encode( &self->entry, ctx );
     371          45 :   if( FD_UNLIKELY( err ) ) return err;
     372          45 :   return FD_BINCODE_SUCCESS;
     373          45 : }
     374        1692 : static inline int fd_epoch_stake_history_entry_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     375        1692 :   if( (ulong)ctx->data + 32UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     376        1692 :   ctx->data = (void *)( (ulong)ctx->data + 32UL );
     377        1692 :   return 0;
     378        1692 : }
     379         156 : static void fd_epoch_stake_history_entry_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     380         156 :   fd_epoch_stake_history_entry_pair_t * self = (fd_epoch_stake_history_entry_pair_t *)struct_mem;
     381         156 :   fd_bincode_uint64_decode_unsafe( &self->epoch, ctx );
     382         156 :   fd_stake_history_entry_decode_inner( &self->entry, alloc_mem, ctx );
     383         156 : }
     384           0 : void * fd_epoch_stake_history_entry_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     385           0 :   fd_epoch_stake_history_entry_pair_t * self = (fd_epoch_stake_history_entry_pair_t *)mem;
     386           0 :   fd_epoch_stake_history_entry_pair_new( self );
     387           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_epoch_stake_history_entry_pair_t);
     388           0 :   void * * alloc_mem = &alloc_region;
     389           0 :   fd_epoch_stake_history_entry_pair_decode_inner( mem, alloc_mem, ctx );
     390           0 :   return self;
     391           0 : }
     392         105 : int fd_stake_history_encode( fd_stake_history_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     393         105 :   int err;
     394         105 :   err = fd_bincode_uint64_encode( self->fd_stake_history_len, ctx );
     395         105 :   if( FD_UNLIKELY(err) ) return err;
     396         105 :   if( FD_UNLIKELY( 0 == self->fd_stake_history_len ) ) return FD_BINCODE_SUCCESS;
     397          78 :   for( ulong i=0; i<self->fd_stake_history_len; i++ ) {
     398          45 :     ulong idx = ( i + self->fd_stake_history_offset ) & (512 - 1);
     399          45 :     err = fd_epoch_stake_history_entry_pair_encode( self->fd_stake_history + idx, ctx );
     400          45 :     if( FD_UNLIKELY( err ) ) return err;
     401          45 :   }
     402          33 :   return FD_BINCODE_SUCCESS;
     403          33 : }
     404         282 : static int fd_stake_history_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     405         282 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     406         282 :   int err = 0;
     407         282 :   ulong fd_stake_history_len;
     408         282 :   err = fd_bincode_uint64_decode( &fd_stake_history_len, ctx );
     409         282 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     410         282 :   if( fd_stake_history_len ) {
     411        1809 :     for( ulong i=0; i < fd_stake_history_len; i++ ) {
     412        1692 :       err = fd_epoch_stake_history_entry_pair_decode_footprint_inner( ctx, total_sz );
     413        1692 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     414        1692 :     }
     415         117 :   }
     416         282 :   return 0;
     417         282 : }
     418         282 : int fd_stake_history_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     419         282 :   *total_sz += sizeof(fd_stake_history_t);
     420         282 :   void const * start_data = ctx->data;
     421         282 :   int err = fd_stake_history_decode_footprint_inner( ctx, total_sz );
     422         282 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     423         282 :   ctx->data = start_data;
     424         282 :   return err;
     425         282 : }
     426         279 : static void fd_stake_history_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     427         279 :   fd_stake_history_t * self = (fd_stake_history_t *)struct_mem;
     428         279 :   fd_bincode_uint64_decode_unsafe( &self->fd_stake_history_len, ctx );
     429         279 :   self->fd_stake_history_size = 512;
     430         279 :   self->fd_stake_history_offset = 0;
     431         435 :   for( ulong i=0; i<self->fd_stake_history_len; i++ ) {
     432         156 :     fd_epoch_stake_history_entry_pair_decode_inner( self->fd_stake_history + i, alloc_mem, ctx );
     433         156 :   }
     434         279 : }
     435         279 : void * fd_stake_history_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     436         279 :   fd_stake_history_t * self = (fd_stake_history_t *)mem;
     437         279 :   fd_stake_history_new( self );
     438         279 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_history_t);
     439         279 :   void * * alloc_mem = &alloc_region;
     440         279 :   fd_stake_history_decode_inner( mem, alloc_mem, ctx );
     441         279 :   return self;
     442         279 : }
     443         351 : void fd_stake_history_new(fd_stake_history_t * self) {
     444         351 :   fd_memset( self, 0, sizeof(fd_stake_history_t) );
     445         351 :   self->fd_stake_history_size = 512;
     446      180063 :   for( ulong i=0; i<512; i++ )
     447      179712 :     fd_epoch_stake_history_entry_pair_new( self->fd_stake_history + i );
     448         351 : }
     449         141 : int fd_solana_account_encode( fd_solana_account_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     450         141 :   int err;
     451         141 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
     452         141 :   if( FD_UNLIKELY( err ) ) return err;
     453         141 :   err = fd_bincode_uint64_encode( self->data_len, ctx );
     454         141 :   if( FD_UNLIKELY(err) ) return err;
     455         141 :   if( self->data_len ) {
     456          27 :     err = fd_bincode_bytes_encode( self->data, self->data_len, ctx );
     457          27 :     if( FD_UNLIKELY( err ) ) return err;
     458          27 :   }
     459         141 :   err = fd_pubkey_encode( &self->owner, ctx );
     460         141 :   if( FD_UNLIKELY( err ) ) return err;
     461         141 :   err = fd_bincode_bool_encode( (uchar)(self->executable), ctx );
     462         141 :   if( FD_UNLIKELY( err ) ) return err;
     463         141 :   err = fd_bincode_uint64_encode( self->rent_epoch, ctx );
     464         141 :   if( FD_UNLIKELY( err ) ) return err;
     465         141 :   return FD_BINCODE_SUCCESS;
     466         141 : }
     467           0 : int fd_solana_account_encode_global( fd_solana_account_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     468           0 :   int err;
     469           0 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
     470           0 :   if( FD_UNLIKELY( err ) ) return err;
     471           0 :   err = fd_bincode_uint64_encode( self->data_len, ctx );
     472           0 :   if( FD_UNLIKELY( err ) ) return err;
     473           0 :   if( self->data_len ) {
     474           0 :     uchar * data_laddr = (uchar*)self + self->data_offset;
     475           0 :     err = fd_bincode_bytes_encode( data_laddr, self->data_len, ctx );
     476           0 :     if( FD_UNLIKELY( err ) ) return err;
     477           0 :   }
     478           0 :   err = fd_pubkey_encode( &self->owner, ctx );
     479           0 :   if( FD_UNLIKELY( err ) ) return err;
     480           0 :   err = fd_bincode_bool_encode( (uchar)(self->executable), ctx );
     481           0 :   if( FD_UNLIKELY( err ) ) return err;
     482           0 :   err = fd_bincode_uint64_encode( self->rent_epoch, ctx );
     483           0 :   if( FD_UNLIKELY( err ) ) return err;
     484           0 :   return FD_BINCODE_SUCCESS;
     485           0 : }
     486           0 : static int fd_solana_account_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     487           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     488           0 :   int err = 0;
     489           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
     490           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     491           0 :   ulong data_len;
     492           0 :   err = fd_bincode_uint64_decode( &data_len, ctx );
     493           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     494           0 :   if( data_len ) {
     495           0 :     *total_sz += 8UL + data_len;
     496           0 :     err = fd_bincode_bytes_decode_footprint( data_len, ctx );
     497           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     498           0 :   }
     499           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
     500           0 :   if( FD_UNLIKELY( err ) ) return err;
     501           0 :   err = fd_bincode_bool_decode_footprint( ctx );
     502           0 :   if( FD_UNLIKELY( err ) ) return err;
     503           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
     504           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     505           0 :   return 0;
     506           0 : }
     507           0 : int fd_solana_account_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     508           0 :   *total_sz += sizeof(fd_solana_account_t);
     509           0 :   void const * start_data = ctx->data;
     510           0 :   int err = fd_solana_account_decode_footprint_inner( ctx, total_sz );
     511           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     512           0 :   ctx->data = start_data;
     513           0 :   return err;
     514           0 : }
     515           0 : static void fd_solana_account_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     516           0 :   fd_solana_account_t * self = (fd_solana_account_t *)struct_mem;
     517           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
     518           0 :   fd_bincode_uint64_decode_unsafe( &self->data_len, ctx );
     519           0 :   if( self->data_len ) {
     520           0 :     self->data = *alloc_mem;
     521           0 :     fd_bincode_bytes_decode_unsafe( self->data, self->data_len, ctx );
     522           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->data_len;
     523           0 :   } else
     524           0 :     self->data = NULL;
     525           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
     526           0 :   fd_bincode_bool_decode_unsafe( &self->executable, ctx );
     527           0 :   fd_bincode_uint64_decode_unsafe( &self->rent_epoch, ctx );
     528           0 : }
     529           0 : void * fd_solana_account_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     530           0 :   fd_solana_account_t * self = (fd_solana_account_t *)mem;
     531           0 :   fd_solana_account_new( self );
     532           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_solana_account_t);
     533           0 :   void * * alloc_mem = &alloc_region;
     534           0 :   fd_solana_account_decode_inner( mem, alloc_mem, ctx );
     535           0 :   return self;
     536           0 : }
     537           0 : static void fd_solana_account_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     538           0 :   fd_solana_account_global_t * self = (fd_solana_account_global_t *)struct_mem;
     539           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
     540           0 :   fd_bincode_uint64_decode_unsafe( &self->data_len, ctx );
     541           0 :   if( self->data_len ) {
     542           0 :     self->data_offset = (ulong)*alloc_mem - (ulong)struct_mem;
     543           0 :     fd_bincode_bytes_decode_unsafe( *alloc_mem, self->data_len, ctx );
     544           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->data_len;
     545           0 :   } else {
     546           0 :     self->data_offset = 0UL;
     547           0 :   }
     548           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
     549           0 :   fd_bincode_bool_decode_unsafe( &self->executable, ctx );
     550           0 :   fd_bincode_uint64_decode_unsafe( &self->rent_epoch, ctx );
     551           0 : }
     552           0 : void * fd_solana_account_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     553           0 :   fd_solana_account_global_t * self = (fd_solana_account_global_t *)mem;
     554           0 :   fd_solana_account_new( (fd_solana_account_t *)self );
     555           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_solana_account_global_t);
     556           0 :   void * * alloc_mem = &alloc_region;
     557           0 :   fd_solana_account_decode_inner_global( mem, alloc_mem, ctx );
     558           0 :   return self;
     559           0 : }
     560           0 : void fd_solana_account_new(fd_solana_account_t * self) {
     561           0 :   fd_memset( self, 0, sizeof(fd_solana_account_t) );
     562           0 :   fd_pubkey_new( &self->owner );
     563           0 : }
     564           0 : ulong fd_solana_account_size( fd_solana_account_t const * self ) {
     565           0 :   ulong size = 0;
     566           0 :   size += sizeof(ulong);
     567           0 :   do {
     568           0 :     size += sizeof(ulong);
     569           0 :     size += self->data_len;
     570           0 :   } while(0);
     571           0 :   size += fd_pubkey_size( &self->owner );
     572           0 :   size += sizeof(char);
     573           0 :   size += sizeof(ulong);
     574           0 :   return size;
     575           0 : }
     576             : 
     577           0 : ulong fd_solana_account_size_global( fd_solana_account_global_t const * self ) {
     578           0 :   ulong size = 0;
     579           0 :   size += sizeof(ulong);
     580           0 :   do {
     581           0 :     size += sizeof(ulong);
     582           0 :     uchar * data = self->data_offset ? (uchar *)fd_type_pun( (uchar *)self + self->data_offset ) : NULL;
     583           0 :     size += self->data_len;
     584           0 :   } while(0);
     585           0 :   size += fd_pubkey_size( &self->owner );
     586           0 :   size += sizeof(char);
     587           0 :   size += sizeof(ulong);
     588           0 :   return size;
     589           0 : }
     590             : 
     591           9 : int fd_rust_duration_encode( fd_rust_duration_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     592           9 :   int err;
     593           9 :   err = fd_bincode_uint64_encode( self->seconds, ctx );
     594           9 :   if( FD_UNLIKELY( err ) ) return err;
     595           9 :   err = fd_bincode_uint32_encode( self->nanoseconds, ctx );
     596           9 :   if( FD_UNLIKELY( err ) ) return err;
     597           9 :   return FD_BINCODE_SUCCESS;
     598           9 : }
     599           0 : static inline int fd_rust_duration_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     600           0 :   if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     601           0 :   int err = fd_rust_duration_footprint_validator( ctx );
     602           0 :   if( FD_UNLIKELY( err != FD_BINCODE_SUCCESS ) )
     603           0 :     return err;
     604           0 :   ctx->data = (void *)( (ulong)ctx->data + 12UL );
     605           0 :   return 0;
     606           0 : }
     607           0 : static void fd_rust_duration_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     608           0 :   fd_rust_duration_t * self = (fd_rust_duration_t *)struct_mem;
     609           0 :   fd_bincode_uint64_decode_unsafe( &self->seconds, ctx );
     610           0 :   fd_bincode_uint32_decode_unsafe( &self->nanoseconds, ctx );
     611           0 :   fd_rust_duration_normalize( self );
     612           0 : }
     613           0 : void * fd_rust_duration_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     614           0 :   fd_rust_duration_t * self = (fd_rust_duration_t *)mem;
     615           0 :   fd_rust_duration_new( self );
     616           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_rust_duration_t);
     617           0 :   void * * alloc_mem = &alloc_region;
     618           0 :   fd_rust_duration_decode_inner( mem, alloc_mem, ctx );
     619           0 :   return self;
     620           0 : }
     621           9 : int fd_poh_config_encode( fd_poh_config_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     622           9 :   int err;
     623           9 :   err = fd_rust_duration_encode( &self->target_tick_duration, ctx );
     624           9 :   if( FD_UNLIKELY( err ) ) return err;
     625           9 :   err = fd_bincode_bool_encode( self->has_target_tick_count, ctx );
     626           9 :   if( FD_UNLIKELY( err ) ) return err;
     627           9 :   if( self->has_target_tick_count ) {
     628           0 :     err = fd_bincode_uint64_encode( self->target_tick_count, ctx );
     629           0 :     if( FD_UNLIKELY( err ) ) return err;
     630           0 :   }
     631           9 :   err = fd_bincode_bool_encode( self->has_hashes_per_tick, ctx );
     632           9 :   if( FD_UNLIKELY( err ) ) return err;
     633           9 :   if( self->has_hashes_per_tick ) {
     634           0 :     err = fd_bincode_uint64_encode( self->hashes_per_tick, ctx );
     635           0 :     if( FD_UNLIKELY( err ) ) return err;
     636           0 :   }
     637           9 :   return FD_BINCODE_SUCCESS;
     638           9 : }
     639           0 : int fd_poh_config_encode_global( fd_poh_config_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     640           0 :   int err;
     641           0 :   err = fd_rust_duration_encode( &self->target_tick_duration, ctx );
     642           0 :   if( FD_UNLIKELY( err ) ) return err;
     643           0 :   err = fd_bincode_bool_encode( self->has_target_tick_count, ctx );
     644           0 :   if( FD_UNLIKELY( err ) ) return err;
     645           0 :   if( self->has_target_tick_count ) {
     646           0 :     err = fd_bincode_uint64_encode( self->target_tick_count, ctx );
     647           0 :     if( FD_UNLIKELY( err ) ) return err;
     648           0 :   }
     649           0 :   err = fd_bincode_bool_encode( self->has_hashes_per_tick, ctx );
     650           0 :   if( FD_UNLIKELY( err ) ) return err;
     651           0 :   if( self->has_hashes_per_tick ) {
     652           0 :     err = fd_bincode_uint64_encode( self->hashes_per_tick, ctx );
     653           0 :     if( FD_UNLIKELY( err ) ) return err;
     654           0 :   }
     655           0 :   return FD_BINCODE_SUCCESS;
     656           0 : }
     657           0 : static int fd_poh_config_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     658           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     659           0 :   int err = 0;
     660           0 :   err = fd_rust_duration_decode_footprint_inner( ctx, total_sz );
     661           0 :   if( FD_UNLIKELY( err ) ) return err;
     662           0 :   {
     663           0 :     uchar o;
     664           0 :     err = fd_bincode_bool_decode( &o, ctx );
     665           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     666           0 :     if( o ) {
     667           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
     668           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     669           0 :     }
     670           0 :   }
     671           0 :   {
     672           0 :     uchar o;
     673           0 :     err = fd_bincode_bool_decode( &o, ctx );
     674           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     675           0 :     if( o ) {
     676           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
     677           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     678           0 :     }
     679           0 :   }
     680           0 :   return 0;
     681           0 : }
     682           0 : int fd_poh_config_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     683           0 :   *total_sz += sizeof(fd_poh_config_t);
     684           0 :   void const * start_data = ctx->data;
     685           0 :   int err = fd_poh_config_decode_footprint_inner( ctx, total_sz );
     686           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     687           0 :   ctx->data = start_data;
     688           0 :   return err;
     689           0 : }
     690           0 : static void fd_poh_config_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     691           0 :   fd_poh_config_t * self = (fd_poh_config_t *)struct_mem;
     692           0 :   fd_rust_duration_decode_inner( &self->target_tick_duration, alloc_mem, ctx );
     693           0 :   {
     694           0 :     uchar o;
     695           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
     696           0 :     self->has_target_tick_count = !!o;
     697           0 :     if( o ) {
     698           0 :       fd_bincode_uint64_decode_unsafe( &self->target_tick_count, ctx );
     699           0 :     }
     700           0 :   }
     701           0 :   {
     702           0 :     uchar o;
     703           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
     704           0 :     self->has_hashes_per_tick = !!o;
     705           0 :     if( o ) {
     706           0 :       fd_bincode_uint64_decode_unsafe( &self->hashes_per_tick, ctx );
     707           0 :     }
     708           0 :   }
     709           0 : }
     710           0 : void * fd_poh_config_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     711           0 :   fd_poh_config_t * self = (fd_poh_config_t *)mem;
     712           0 :   fd_poh_config_new( self );
     713           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_poh_config_t);
     714           0 :   void * * alloc_mem = &alloc_region;
     715           0 :   fd_poh_config_decode_inner( mem, alloc_mem, ctx );
     716           0 :   return self;
     717           0 : }
     718           0 : static void fd_poh_config_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     719           0 :   fd_poh_config_global_t * self = (fd_poh_config_global_t *)struct_mem;
     720           0 :   fd_rust_duration_decode_inner( &self->target_tick_duration, alloc_mem, ctx );
     721           0 :   {
     722           0 :     uchar o;
     723           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
     724           0 :     self->has_target_tick_count = !!o;
     725           0 :     if( o ) {
     726           0 :       fd_bincode_uint64_decode_unsafe( &self->target_tick_count, ctx );
     727           0 :     }
     728           0 :   }
     729           0 :   {
     730           0 :     uchar o;
     731           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
     732           0 :     self->has_hashes_per_tick = !!o;
     733           0 :     if( o ) {
     734           0 :       fd_bincode_uint64_decode_unsafe( &self->hashes_per_tick, ctx );
     735           0 :     }
     736           0 :   }
     737           0 : }
     738           0 : void * fd_poh_config_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     739           0 :   fd_poh_config_global_t * self = (fd_poh_config_global_t *)mem;
     740           0 :   fd_poh_config_new( (fd_poh_config_t *)self );
     741           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_poh_config_global_t);
     742           0 :   void * * alloc_mem = &alloc_region;
     743           0 :   fd_poh_config_decode_inner_global( mem, alloc_mem, ctx );
     744           0 :   return self;
     745           0 : }
     746          12 : void fd_poh_config_new(fd_poh_config_t * self) {
     747          12 :   fd_memset( self, 0, sizeof(fd_poh_config_t) );
     748          12 :   fd_rust_duration_new( &self->target_tick_duration );
     749          12 : }
     750           0 : ulong fd_poh_config_size( fd_poh_config_t const * self ) {
     751           0 :   ulong size = 0;
     752           0 :   size += fd_rust_duration_size( &self->target_tick_duration );
     753           0 :   size += sizeof(char);
     754           0 :   if( self->has_target_tick_count ) {
     755           0 :     size += sizeof(ulong);
     756           0 :   }
     757           0 :   size += sizeof(char);
     758           0 :   if( self->has_hashes_per_tick ) {
     759           0 :     size += sizeof(ulong);
     760           0 :   }
     761           0 :   return size;
     762           0 : }
     763             : 
     764           0 : ulong fd_poh_config_size_global( fd_poh_config_global_t const * self ) {
     765           0 :   ulong size = 0;
     766           0 :   size += fd_rust_duration_size( &self->target_tick_duration );
     767           0 :   size += sizeof(char);
     768           0 :   if( self->has_target_tick_count ) {
     769           0 :     size += sizeof(ulong);
     770           0 :   }
     771           0 :   size += sizeof(char);
     772           0 :   if( self->has_hashes_per_tick ) {
     773           0 :     size += sizeof(ulong);
     774           0 :   }
     775           0 :   return size;
     776           0 : }
     777             : 
     778           0 : int fd_string_pubkey_pair_encode( fd_string_pubkey_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     779           0 :   int err;
     780           0 :   err = fd_bincode_uint64_encode( self->string_len, ctx );
     781           0 :   if( FD_UNLIKELY(err) ) return err;
     782           0 :   if( self->string_len ) {
     783           0 :     err = fd_bincode_bytes_encode( self->string, self->string_len, ctx );
     784           0 :     if( FD_UNLIKELY( err ) ) return err;
     785           0 :   }
     786           0 :   err = fd_pubkey_encode( &self->pubkey, ctx );
     787           0 :   if( FD_UNLIKELY( err ) ) return err;
     788           0 :   return FD_BINCODE_SUCCESS;
     789           0 : }
     790           0 : int fd_string_pubkey_pair_encode_global( fd_string_pubkey_pair_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     791           0 :   int err;
     792           0 :   err = fd_bincode_uint64_encode( self->string_len, ctx );
     793           0 :   if( FD_UNLIKELY( err ) ) return err;
     794           0 :   if( self->string_len ) {
     795           0 :     uchar * string_laddr = (uchar*)self + self->string_offset;
     796           0 :     err = fd_bincode_bytes_encode( string_laddr, self->string_len, ctx );
     797           0 :     if( FD_UNLIKELY( err ) ) return err;
     798           0 :   }
     799           0 :   err = fd_pubkey_encode( &self->pubkey, ctx );
     800           0 :   if( FD_UNLIKELY( err ) ) return err;
     801           0 :   return FD_BINCODE_SUCCESS;
     802           0 : }
     803           0 : static int fd_string_pubkey_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     804           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     805           0 :   int err = 0;
     806           0 :   ulong string_len;
     807           0 :   err = fd_bincode_uint64_decode( &string_len, ctx );
     808           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     809           0 :   *total_sz += string_len;
     810           0 :   if( string_len ) {
     811           0 :     err = fd_bincode_bytes_decode_footprint( string_len, ctx );
     812           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     813           0 :     err = !fd_utf8_verify( (char const *) ctx->data - string_len, string_len );
     814           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     815           0 :   }
     816           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
     817           0 :   if( FD_UNLIKELY( err ) ) return err;
     818           0 :   return 0;
     819           0 : }
     820           0 : int fd_string_pubkey_pair_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     821           0 :   *total_sz += sizeof(fd_string_pubkey_pair_t);
     822           0 :   void const * start_data = ctx->data;
     823           0 :   int err = fd_string_pubkey_pair_decode_footprint_inner( ctx, total_sz );
     824           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     825           0 :   ctx->data = start_data;
     826           0 :   return err;
     827           0 : }
     828           0 : static void fd_string_pubkey_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     829           0 :   fd_string_pubkey_pair_t * self = (fd_string_pubkey_pair_t *)struct_mem;
     830           0 :   fd_bincode_uint64_decode_unsafe( &self->string_len, ctx );
     831           0 :   if( self->string_len ) {
     832           0 :     self->string = *alloc_mem;
     833           0 :     fd_bincode_bytes_decode_unsafe( self->string, self->string_len, ctx );
     834           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->string_len;
     835           0 :   } else
     836           0 :     self->string = NULL;
     837           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
     838           0 : }
     839           0 : void * fd_string_pubkey_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     840           0 :   fd_string_pubkey_pair_t * self = (fd_string_pubkey_pair_t *)mem;
     841           0 :   fd_string_pubkey_pair_new( self );
     842           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_string_pubkey_pair_t);
     843           0 :   void * * alloc_mem = &alloc_region;
     844           0 :   fd_string_pubkey_pair_decode_inner( mem, alloc_mem, ctx );
     845           0 :   return self;
     846           0 : }
     847           0 : static void fd_string_pubkey_pair_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     848           0 :   fd_string_pubkey_pair_global_t * self = (fd_string_pubkey_pair_global_t *)struct_mem;
     849           0 :   fd_bincode_uint64_decode_unsafe( &self->string_len, ctx );
     850           0 :   if( self->string_len ) {
     851           0 :     self->string_offset = (ulong)*alloc_mem - (ulong)struct_mem;
     852           0 :     fd_bincode_bytes_decode_unsafe( *alloc_mem, self->string_len, ctx );
     853           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->string_len;
     854           0 :   } else {
     855           0 :     self->string_offset = 0UL;
     856           0 :   }
     857           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
     858           0 : }
     859           0 : void * fd_string_pubkey_pair_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     860           0 :   fd_string_pubkey_pair_global_t * self = (fd_string_pubkey_pair_global_t *)mem;
     861           0 :   fd_string_pubkey_pair_new( (fd_string_pubkey_pair_t *)self );
     862           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_string_pubkey_pair_global_t);
     863           0 :   void * * alloc_mem = &alloc_region;
     864           0 :   fd_string_pubkey_pair_decode_inner_global( mem, alloc_mem, ctx );
     865           0 :   return self;
     866           0 : }
     867           0 : void fd_string_pubkey_pair_new(fd_string_pubkey_pair_t * self) {
     868           0 :   fd_memset( self, 0, sizeof(fd_string_pubkey_pair_t) );
     869           0 :   fd_pubkey_new( &self->pubkey );
     870           0 : }
     871           0 : ulong fd_string_pubkey_pair_size( fd_string_pubkey_pair_t const * self ) {
     872           0 :   ulong size = 0;
     873           0 :   do {
     874           0 :     size += sizeof(ulong);
     875           0 :     size += self->string_len;
     876           0 :   } while(0);
     877           0 :   size += fd_pubkey_size( &self->pubkey );
     878           0 :   return size;
     879           0 : }
     880             : 
     881           0 : ulong fd_string_pubkey_pair_size_global( fd_string_pubkey_pair_global_t const * self ) {
     882           0 :   ulong size = 0;
     883           0 :   do {
     884           0 :     size += sizeof(ulong);
     885           0 :     uchar * string = self->string_offset ? (uchar *)fd_type_pun( (uchar *)self + self->string_offset ) : NULL;
     886           0 :     size += self->string_len;
     887           0 :   } while(0);
     888           0 :   size += fd_pubkey_size( &self->pubkey );
     889           0 :   return size;
     890           0 : }
     891             : 
     892         141 : int fd_pubkey_account_pair_encode( fd_pubkey_account_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     893         141 :   int err;
     894         141 :   err = fd_pubkey_encode( &self->key, ctx );
     895         141 :   if( FD_UNLIKELY( err ) ) return err;
     896         141 :   err = fd_solana_account_encode( &self->account, ctx );
     897         141 :   if( FD_UNLIKELY( err ) ) return err;
     898         141 :   return FD_BINCODE_SUCCESS;
     899         141 : }
     900           0 : int fd_pubkey_account_pair_encode_global( fd_pubkey_account_pair_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     901           0 :   int err;
     902           0 :   err = fd_pubkey_encode( &self->key, ctx );
     903           0 :   if( FD_UNLIKELY( err ) ) return err;
     904           0 :   err = fd_solana_account_encode_global( &self->account, ctx );
     905           0 :   if( FD_UNLIKELY( err ) ) return err;
     906           0 :   return FD_BINCODE_SUCCESS;
     907           0 : }
     908           0 : static int fd_pubkey_account_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     909           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     910           0 :   int err = 0;
     911           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
     912           0 :   if( FD_UNLIKELY( err ) ) return err;
     913           0 :   err = fd_solana_account_decode_footprint_inner( ctx, total_sz );
     914           0 :   if( FD_UNLIKELY( err ) ) return err;
     915           0 :   return 0;
     916           0 : }
     917           0 : int fd_pubkey_account_pair_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     918           0 :   *total_sz += sizeof(fd_pubkey_account_pair_t);
     919           0 :   void const * start_data = ctx->data;
     920           0 :   int err = fd_pubkey_account_pair_decode_footprint_inner( ctx, total_sz );
     921           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     922           0 :   ctx->data = start_data;
     923           0 :   return err;
     924           0 : }
     925           0 : static void fd_pubkey_account_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     926           0 :   fd_pubkey_account_pair_t * self = (fd_pubkey_account_pair_t *)struct_mem;
     927           0 :   fd_pubkey_decode_inner( &self->key, alloc_mem, ctx );
     928           0 :   fd_solana_account_decode_inner( &self->account, alloc_mem, ctx );
     929           0 : }
     930           0 : void * fd_pubkey_account_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     931           0 :   fd_pubkey_account_pair_t * self = (fd_pubkey_account_pair_t *)mem;
     932           0 :   fd_pubkey_account_pair_new( self );
     933           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_pubkey_account_pair_t);
     934           0 :   void * * alloc_mem = &alloc_region;
     935           0 :   fd_pubkey_account_pair_decode_inner( mem, alloc_mem, ctx );
     936           0 :   return self;
     937           0 : }
     938           0 : static void fd_pubkey_account_pair_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     939           0 :   fd_pubkey_account_pair_global_t * self = (fd_pubkey_account_pair_global_t *)struct_mem;
     940           0 :   fd_pubkey_decode_inner( &self->key, alloc_mem, ctx );
     941           0 :   fd_solana_account_decode_inner_global( &self->account, alloc_mem, ctx );
     942           0 : }
     943           0 : void * fd_pubkey_account_pair_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     944           0 :   fd_pubkey_account_pair_global_t * self = (fd_pubkey_account_pair_global_t *)mem;
     945           0 :   fd_pubkey_account_pair_new( (fd_pubkey_account_pair_t *)self );
     946           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_pubkey_account_pair_global_t);
     947           0 :   void * * alloc_mem = &alloc_region;
     948           0 :   fd_pubkey_account_pair_decode_inner_global( mem, alloc_mem, ctx );
     949           0 :   return self;
     950           0 : }
     951           0 : void fd_pubkey_account_pair_new(fd_pubkey_account_pair_t * self) {
     952           0 :   fd_memset( self, 0, sizeof(fd_pubkey_account_pair_t) );
     953           0 :   fd_pubkey_new( &self->key );
     954           0 :   fd_solana_account_new( &self->account );
     955           0 : }
     956           0 : ulong fd_pubkey_account_pair_size( fd_pubkey_account_pair_t const * self ) {
     957           0 :   ulong size = 0;
     958           0 :   size += fd_pubkey_size( &self->key );
     959           0 :   size += fd_solana_account_size( &self->account );
     960           0 :   return size;
     961           0 : }
     962             : 
     963           0 : ulong fd_pubkey_account_pair_size_global( fd_pubkey_account_pair_global_t const * self ) {
     964           0 :   ulong size = 0;
     965           0 :   size += fd_pubkey_size( &self->key );
     966           0 :   size += fd_solana_account_size_global( &self->account );
     967           0 :   return size;
     968           0 : }
     969             : 
     970          12 : int fd_genesis_solana_encode( fd_genesis_solana_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     971          12 :   int err;
     972          12 :   err = fd_bincode_uint64_encode( self->creation_time, ctx );
     973          12 :   if( FD_UNLIKELY( err ) ) return err;
     974           9 :   err = fd_bincode_uint64_encode( self->accounts_len, ctx );
     975           9 :   if( FD_UNLIKELY(err) ) return err;
     976           9 :   if( self->accounts_len ) {
     977         150 :     for( ulong i=0; i < self->accounts_len; i++ ) {
     978         141 :       err = fd_pubkey_account_pair_encode( self->accounts + i, ctx );
     979         141 :       if( FD_UNLIKELY( err ) ) return err;
     980         141 :     }
     981           9 :   }
     982           9 :   err = fd_bincode_uint64_encode( self->native_instruction_processors_len, ctx );
     983           9 :   if( FD_UNLIKELY(err) ) return err;
     984           9 :   if( self->native_instruction_processors_len ) {
     985           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ ) {
     986           0 :       err = fd_string_pubkey_pair_encode( self->native_instruction_processors + i, ctx );
     987           0 :       if( FD_UNLIKELY( err ) ) return err;
     988           0 :     }
     989           0 :   }
     990           9 :   err = fd_bincode_uint64_encode( self->rewards_pools_len, ctx );
     991           9 :   if( FD_UNLIKELY(err) ) return err;
     992           9 :   if( self->rewards_pools_len ) {
     993           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ ) {
     994           0 :       err = fd_pubkey_account_pair_encode( self->rewards_pools + i, ctx );
     995           0 :       if( FD_UNLIKELY( err ) ) return err;
     996           0 :     }
     997           0 :   }
     998           9 :   err = fd_bincode_uint64_encode( self->ticks_per_slot, ctx );
     999           9 :   if( FD_UNLIKELY( err ) ) return err;
    1000           9 :   err = fd_bincode_uint64_encode( self->unused, ctx );
    1001           9 :   if( FD_UNLIKELY( err ) ) return err;
    1002           9 :   err = fd_poh_config_encode( &self->poh_config, ctx );
    1003           9 :   if( FD_UNLIKELY( err ) ) return err;
    1004           9 :   err = fd_bincode_uint64_encode( self->__backwards_compat_with_v0_23, ctx );
    1005           9 :   if( FD_UNLIKELY( err ) ) return err;
    1006           9 :   err = fd_fee_rate_governor_encode( &self->fee_rate_governor, ctx );
    1007           9 :   if( FD_UNLIKELY( err ) ) return err;
    1008           9 :   err = fd_rent_encode( &self->rent, ctx );
    1009           9 :   if( FD_UNLIKELY( err ) ) return err;
    1010           9 :   err = fd_inflation_encode( &self->inflation, ctx );
    1011           9 :   if( FD_UNLIKELY( err ) ) return err;
    1012           9 :   err = fd_epoch_schedule_encode( &self->epoch_schedule, ctx );
    1013           9 :   if( FD_UNLIKELY( err ) ) return err;
    1014           9 :   err = fd_bincode_uint32_encode( self->cluster_type, ctx );
    1015           9 :   if( FD_UNLIKELY( err ) ) return err;
    1016           9 :   return FD_BINCODE_SUCCESS;
    1017           9 : }
    1018           0 : int fd_genesis_solana_encode_global( fd_genesis_solana_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1019           0 :   int err;
    1020           0 :   err = fd_bincode_uint64_encode( self->creation_time, ctx );
    1021           0 :   if( FD_UNLIKELY( err ) ) return err;
    1022           0 :   err = fd_bincode_uint64_encode( self->accounts_len, ctx );
    1023           0 :   if( FD_UNLIKELY( err ) ) return err;
    1024           0 :   if( self->accounts_len ) {
    1025           0 :     uchar * accounts_laddr = (uchar*)self + self->accounts_offset;
    1026           0 :     fd_pubkey_account_pair_global_t * accounts = (fd_pubkey_account_pair_global_t *)accounts_laddr;
    1027           0 :     for( ulong i=0; i < self->accounts_len; i++ ) {
    1028           0 :       err = fd_pubkey_account_pair_encode_global( &accounts[i], ctx );
    1029           0 :       if( FD_UNLIKELY( err ) ) return err;
    1030           0 :     }
    1031           0 :   }
    1032           0 :   err = fd_bincode_uint64_encode( self->native_instruction_processors_len, ctx );
    1033           0 :   if( FD_UNLIKELY( err ) ) return err;
    1034           0 :   if( self->native_instruction_processors_len ) {
    1035           0 :     uchar * native_instruction_processors_laddr = (uchar*)self + self->native_instruction_processors_offset;
    1036           0 :     fd_string_pubkey_pair_global_t * native_instruction_processors = (fd_string_pubkey_pair_global_t *)native_instruction_processors_laddr;
    1037           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ ) {
    1038           0 :       err = fd_string_pubkey_pair_encode_global( &native_instruction_processors[i], ctx );
    1039           0 :       if( FD_UNLIKELY( err ) ) return err;
    1040           0 :     }
    1041           0 :   }
    1042           0 :   err = fd_bincode_uint64_encode( self->rewards_pools_len, ctx );
    1043           0 :   if( FD_UNLIKELY( err ) ) return err;
    1044           0 :   if( self->rewards_pools_len ) {
    1045           0 :     uchar * rewards_pools_laddr = (uchar*)self + self->rewards_pools_offset;
    1046           0 :     fd_pubkey_account_pair_global_t * rewards_pools = (fd_pubkey_account_pair_global_t *)rewards_pools_laddr;
    1047           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ ) {
    1048           0 :       err = fd_pubkey_account_pair_encode_global( &rewards_pools[i], ctx );
    1049           0 :       if( FD_UNLIKELY( err ) ) return err;
    1050           0 :     }
    1051           0 :   }
    1052           0 :   err = fd_bincode_uint64_encode( self->ticks_per_slot, ctx );
    1053           0 :   if( FD_UNLIKELY( err ) ) return err;
    1054           0 :   err = fd_bincode_uint64_encode( self->unused, ctx );
    1055           0 :   if( FD_UNLIKELY( err ) ) return err;
    1056           0 :   err = fd_poh_config_encode_global( &self->poh_config, ctx );
    1057           0 :   if( FD_UNLIKELY( err ) ) return err;
    1058           0 :   err = fd_bincode_uint64_encode( self->__backwards_compat_with_v0_23, ctx );
    1059           0 :   if( FD_UNLIKELY( err ) ) return err;
    1060           0 :   err = fd_fee_rate_governor_encode( &self->fee_rate_governor, ctx );
    1061           0 :   if( FD_UNLIKELY( err ) ) return err;
    1062           0 :   err = fd_rent_encode( &self->rent, ctx );
    1063           0 :   if( FD_UNLIKELY( err ) ) return err;
    1064           0 :   err = fd_inflation_encode( &self->inflation, ctx );
    1065           0 :   if( FD_UNLIKELY( err ) ) return err;
    1066           0 :   err = fd_epoch_schedule_encode( &self->epoch_schedule, ctx );
    1067           0 :   if( FD_UNLIKELY( err ) ) return err;
    1068           0 :   err = fd_bincode_uint32_encode( self->cluster_type, ctx );
    1069           0 :   if( FD_UNLIKELY( err ) ) return err;
    1070           0 :   return FD_BINCODE_SUCCESS;
    1071           0 : }
    1072           0 : static int fd_genesis_solana_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1073           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1074           0 :   int err = 0;
    1075           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1076           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1077           0 :   ulong accounts_len;
    1078           0 :   err = fd_bincode_uint64_decode( &accounts_len, ctx );
    1079           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1080           0 :   if( accounts_len ) {
    1081           0 :     *total_sz += FD_PUBKEY_ACCOUNT_PAIR_ALIGN + sizeof(fd_pubkey_account_pair_t)*accounts_len;
    1082           0 :     for( ulong i=0; i < accounts_len; i++ ) {
    1083           0 :       err = fd_pubkey_account_pair_decode_footprint_inner( ctx, total_sz );
    1084           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1085           0 :     }
    1086           0 :   }
    1087           0 :   ulong native_instruction_processors_len;
    1088           0 :   err = fd_bincode_uint64_decode( &native_instruction_processors_len, ctx );
    1089           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1090           0 :   if( native_instruction_processors_len ) {
    1091           0 :     *total_sz += FD_STRING_PUBKEY_PAIR_ALIGN + sizeof(fd_string_pubkey_pair_t)*native_instruction_processors_len;
    1092           0 :     for( ulong i=0; i < native_instruction_processors_len; i++ ) {
    1093           0 :       err = fd_string_pubkey_pair_decode_footprint_inner( ctx, total_sz );
    1094           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1095           0 :     }
    1096           0 :   }
    1097           0 :   ulong rewards_pools_len;
    1098           0 :   err = fd_bincode_uint64_decode( &rewards_pools_len, ctx );
    1099           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1100           0 :   if( rewards_pools_len ) {
    1101           0 :     *total_sz += FD_PUBKEY_ACCOUNT_PAIR_ALIGN + sizeof(fd_pubkey_account_pair_t)*rewards_pools_len;
    1102           0 :     for( ulong i=0; i < rewards_pools_len; i++ ) {
    1103           0 :       err = fd_pubkey_account_pair_decode_footprint_inner( ctx, total_sz );
    1104           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1105           0 :     }
    1106           0 :   }
    1107           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1108           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1109           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1110           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1111           0 :   err = fd_poh_config_decode_footprint_inner( ctx, total_sz );
    1112           0 :   if( FD_UNLIKELY( err ) ) return err;
    1113           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1114           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1115           0 :   err = fd_fee_rate_governor_decode_footprint_inner( ctx, total_sz );
    1116           0 :   if( FD_UNLIKELY( err ) ) return err;
    1117           0 :   err = fd_rent_decode_footprint_inner( ctx, total_sz );
    1118           0 :   if( FD_UNLIKELY( err ) ) return err;
    1119           0 :   err = fd_inflation_decode_footprint_inner( ctx, total_sz );
    1120           0 :   if( FD_UNLIKELY( err ) ) return err;
    1121           0 :   err = fd_epoch_schedule_decode_footprint_inner( ctx, total_sz );
    1122           0 :   if( FD_UNLIKELY( err ) ) return err;
    1123           0 :   err = fd_bincode_uint32_decode_footprint( ctx );
    1124           0 :   if( FD_UNLIKELY( err ) ) return err;
    1125           0 :   return 0;
    1126           0 : }
    1127           0 : int fd_genesis_solana_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1128           0 :   *total_sz += sizeof(fd_genesis_solana_t);
    1129           0 :   void const * start_data = ctx->data;
    1130           0 :   int err = fd_genesis_solana_decode_footprint_inner( ctx, total_sz );
    1131           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1132           0 :   ctx->data = start_data;
    1133           0 :   return err;
    1134           0 : }
    1135           0 : static void fd_genesis_solana_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1136           0 :   fd_genesis_solana_t * self = (fd_genesis_solana_t *)struct_mem;
    1137           0 :   fd_bincode_uint64_decode_unsafe( &self->creation_time, ctx );
    1138           0 :   fd_bincode_uint64_decode_unsafe( &self->accounts_len, ctx );
    1139           0 :   if( self->accounts_len ) {
    1140           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_PUBKEY_ACCOUNT_PAIR_ALIGN );
    1141           0 :     self->accounts = *alloc_mem;
    1142           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_pubkey_account_pair_t)*self->accounts_len;
    1143           0 :     for( ulong i=0; i < self->accounts_len; i++ ) {
    1144           0 :       fd_pubkey_account_pair_new( self->accounts + i );
    1145           0 :       fd_pubkey_account_pair_decode_inner( self->accounts + i, alloc_mem, ctx );
    1146           0 :     }
    1147           0 :   } else
    1148           0 :     self->accounts = NULL;
    1149           0 :   fd_bincode_uint64_decode_unsafe( &self->native_instruction_processors_len, ctx );
    1150           0 :   if( self->native_instruction_processors_len ) {
    1151           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_STRING_PUBKEY_PAIR_ALIGN );
    1152           0 :     self->native_instruction_processors = *alloc_mem;
    1153           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_string_pubkey_pair_t)*self->native_instruction_processors_len;
    1154           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ ) {
    1155           0 :       fd_string_pubkey_pair_new( self->native_instruction_processors + i );
    1156           0 :       fd_string_pubkey_pair_decode_inner( self->native_instruction_processors + i, alloc_mem, ctx );
    1157           0 :     }
    1158           0 :   } else
    1159           0 :     self->native_instruction_processors = NULL;
    1160           0 :   fd_bincode_uint64_decode_unsafe( &self->rewards_pools_len, ctx );
    1161           0 :   if( self->rewards_pools_len ) {
    1162           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_PUBKEY_ACCOUNT_PAIR_ALIGN );
    1163           0 :     self->rewards_pools = *alloc_mem;
    1164           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_pubkey_account_pair_t)*self->rewards_pools_len;
    1165           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ ) {
    1166           0 :       fd_pubkey_account_pair_new( self->rewards_pools + i );
    1167           0 :       fd_pubkey_account_pair_decode_inner( self->rewards_pools + i, alloc_mem, ctx );
    1168           0 :     }
    1169           0 :   } else
    1170           0 :     self->rewards_pools = NULL;
    1171           0 :   fd_bincode_uint64_decode_unsafe( &self->ticks_per_slot, ctx );
    1172           0 :   fd_bincode_uint64_decode_unsafe( &self->unused, ctx );
    1173           0 :   fd_poh_config_decode_inner( &self->poh_config, alloc_mem, ctx );
    1174           0 :   fd_bincode_uint64_decode_unsafe( &self->__backwards_compat_with_v0_23, ctx );
    1175           0 :   fd_fee_rate_governor_decode_inner( &self->fee_rate_governor, alloc_mem, ctx );
    1176           0 :   fd_rent_decode_inner( &self->rent, alloc_mem, ctx );
    1177           0 :   fd_inflation_decode_inner( &self->inflation, alloc_mem, ctx );
    1178           0 :   fd_epoch_schedule_decode_inner( &self->epoch_schedule, alloc_mem, ctx );
    1179           0 :   fd_bincode_uint32_decode_unsafe( &self->cluster_type, ctx );
    1180           0 : }
    1181           0 : void * fd_genesis_solana_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1182           0 :   fd_genesis_solana_t * self = (fd_genesis_solana_t *)mem;
    1183           0 :   fd_genesis_solana_new( self );
    1184           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_genesis_solana_t);
    1185           0 :   void * * alloc_mem = &alloc_region;
    1186           0 :   fd_genesis_solana_decode_inner( mem, alloc_mem, ctx );
    1187           0 :   return self;
    1188           0 : }
    1189           0 : static void fd_genesis_solana_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1190           0 :   fd_genesis_solana_global_t * self = (fd_genesis_solana_global_t *)struct_mem;
    1191           0 :   fd_bincode_uint64_decode_unsafe( &self->creation_time, ctx );
    1192           0 :   fd_bincode_uint64_decode_unsafe( &self->accounts_len, ctx );
    1193           0 :   if( self->accounts_len ) {
    1194           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_PUBKEY_ACCOUNT_PAIR_ALIGN );
    1195           0 :     self->accounts_offset = (ulong)*alloc_mem - (ulong)struct_mem;
    1196           0 :     uchar * cur_mem = (uchar *)(*alloc_mem);
    1197           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_pubkey_account_pair_t)*self->accounts_len;
    1198           0 :     for( ulong i=0; i < self->accounts_len; i++ ) {
    1199           0 :       fd_pubkey_account_pair_new( (fd_pubkey_account_pair_t *)fd_type_pun(cur_mem + sizeof(fd_pubkey_account_pair_t) * i) );
    1200           0 :       fd_pubkey_account_pair_decode_inner_global( cur_mem + sizeof(fd_pubkey_account_pair_t) * i, alloc_mem, ctx );
    1201           0 :     }
    1202           0 :   } else {
    1203           0 :     self->accounts_offset = 0UL;
    1204           0 :   }
    1205           0 :   fd_bincode_uint64_decode_unsafe( &self->native_instruction_processors_len, ctx );
    1206           0 :   if( self->native_instruction_processors_len ) {
    1207           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_STRING_PUBKEY_PAIR_ALIGN );
    1208           0 :     self->native_instruction_processors_offset = (ulong)*alloc_mem - (ulong)struct_mem;
    1209           0 :     uchar * cur_mem = (uchar *)(*alloc_mem);
    1210           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_string_pubkey_pair_t)*self->native_instruction_processors_len;
    1211           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ ) {
    1212           0 :       fd_string_pubkey_pair_new( (fd_string_pubkey_pair_t *)fd_type_pun(cur_mem + sizeof(fd_string_pubkey_pair_t) * i) );
    1213           0 :       fd_string_pubkey_pair_decode_inner_global( cur_mem + sizeof(fd_string_pubkey_pair_t) * i, alloc_mem, ctx );
    1214           0 :     }
    1215           0 :   } else {
    1216           0 :     self->native_instruction_processors_offset = 0UL;
    1217           0 :   }
    1218           0 :   fd_bincode_uint64_decode_unsafe( &self->rewards_pools_len, ctx );
    1219           0 :   if( self->rewards_pools_len ) {
    1220           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_PUBKEY_ACCOUNT_PAIR_ALIGN );
    1221           0 :     self->rewards_pools_offset = (ulong)*alloc_mem - (ulong)struct_mem;
    1222           0 :     uchar * cur_mem = (uchar *)(*alloc_mem);
    1223           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_pubkey_account_pair_t)*self->rewards_pools_len;
    1224           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ ) {
    1225           0 :       fd_pubkey_account_pair_new( (fd_pubkey_account_pair_t *)fd_type_pun(cur_mem + sizeof(fd_pubkey_account_pair_t) * i) );
    1226           0 :       fd_pubkey_account_pair_decode_inner_global( cur_mem + sizeof(fd_pubkey_account_pair_t) * i, alloc_mem, ctx );
    1227           0 :     }
    1228           0 :   } else {
    1229           0 :     self->rewards_pools_offset = 0UL;
    1230           0 :   }
    1231           0 :   fd_bincode_uint64_decode_unsafe( &self->ticks_per_slot, ctx );
    1232           0 :   fd_bincode_uint64_decode_unsafe( &self->unused, ctx );
    1233           0 :   fd_poh_config_decode_inner_global( &self->poh_config, alloc_mem, ctx );
    1234           0 :   fd_bincode_uint64_decode_unsafe( &self->__backwards_compat_with_v0_23, ctx );
    1235           0 :   fd_fee_rate_governor_decode_inner( &self->fee_rate_governor, alloc_mem, ctx );
    1236           0 :   fd_rent_decode_inner( &self->rent, alloc_mem, ctx );
    1237           0 :   fd_inflation_decode_inner( &self->inflation, alloc_mem, ctx );
    1238           0 :   fd_epoch_schedule_decode_inner( &self->epoch_schedule, alloc_mem, ctx );
    1239           0 :   fd_bincode_uint32_decode_unsafe( &self->cluster_type, ctx );
    1240           0 : }
    1241           0 : void * fd_genesis_solana_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1242           0 :   fd_genesis_solana_global_t * self = (fd_genesis_solana_global_t *)mem;
    1243           0 :   fd_genesis_solana_new( (fd_genesis_solana_t *)self );
    1244           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_genesis_solana_global_t);
    1245           0 :   void * * alloc_mem = &alloc_region;
    1246           0 :   fd_genesis_solana_decode_inner_global( mem, alloc_mem, ctx );
    1247           0 :   return self;
    1248           0 : }
    1249          12 : void fd_genesis_solana_new(fd_genesis_solana_t * self) {
    1250          12 :   fd_memset( self, 0, sizeof(fd_genesis_solana_t) );
    1251          12 :   fd_poh_config_new( &self->poh_config );
    1252          12 :   fd_fee_rate_governor_new( &self->fee_rate_governor );
    1253          12 :   fd_rent_new( &self->rent );
    1254          12 :   fd_inflation_new( &self->inflation );
    1255          12 :   fd_epoch_schedule_new( &self->epoch_schedule );
    1256          12 : }
    1257           0 : ulong fd_genesis_solana_size( fd_genesis_solana_t const * self ) {
    1258           0 :   ulong size = 0;
    1259           0 :   size += sizeof(ulong);
    1260           0 :   do {
    1261           0 :     size += sizeof(ulong);
    1262           0 :     for( ulong i=0; i < self->accounts_len; i++ )
    1263           0 :       size += fd_pubkey_account_pair_size( self->accounts + i );
    1264           0 :   } while(0);
    1265           0 :   do {
    1266           0 :     size += sizeof(ulong);
    1267           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ )
    1268           0 :       size += fd_string_pubkey_pair_size( self->native_instruction_processors + i );
    1269           0 :   } while(0);
    1270           0 :   do {
    1271           0 :     size += sizeof(ulong);
    1272           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ )
    1273           0 :       size += fd_pubkey_account_pair_size( self->rewards_pools + i );
    1274           0 :   } while(0);
    1275           0 :   size += sizeof(ulong);
    1276           0 :   size += sizeof(ulong);
    1277           0 :   size += fd_poh_config_size( &self->poh_config );
    1278           0 :   size += sizeof(ulong);
    1279           0 :   size += fd_fee_rate_governor_size( &self->fee_rate_governor );
    1280           0 :   size += fd_rent_size( &self->rent );
    1281           0 :   size += fd_inflation_size( &self->inflation );
    1282           0 :   size += fd_epoch_schedule_size( &self->epoch_schedule );
    1283           0 :   size += sizeof(uint);
    1284           0 :   return size;
    1285           0 : }
    1286             : 
    1287           0 : ulong fd_genesis_solana_size_global( fd_genesis_solana_global_t const * self ) {
    1288           0 :   ulong size = 0;
    1289           0 :   size += sizeof(ulong);
    1290           0 :   do {
    1291           0 :     size += sizeof(ulong);
    1292           0 :     fd_pubkey_account_pair_global_t * accounts = self->accounts_offset ? (fd_pubkey_account_pair_global_t *)fd_type_pun( (uchar *)self + self->accounts_offset ) : NULL;
    1293           0 :     for( ulong i=0; i < self->accounts_len; i++ )
    1294           0 :       size += fd_pubkey_account_pair_size_global( accounts + i );
    1295           0 :   } while(0);
    1296           0 :   do {
    1297           0 :     size += sizeof(ulong);
    1298           0 :     fd_string_pubkey_pair_global_t * native_instruction_processors = self->native_instruction_processors_offset ? (fd_string_pubkey_pair_global_t *)fd_type_pun( (uchar *)self + self->native_instruction_processors_offset ) : NULL;
    1299           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ )
    1300           0 :       size += fd_string_pubkey_pair_size_global( native_instruction_processors + i );
    1301           0 :   } while(0);
    1302           0 :   do {
    1303           0 :     size += sizeof(ulong);
    1304           0 :     fd_pubkey_account_pair_global_t * rewards_pools = self->rewards_pools_offset ? (fd_pubkey_account_pair_global_t *)fd_type_pun( (uchar *)self + self->rewards_pools_offset ) : NULL;
    1305           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ )
    1306           0 :       size += fd_pubkey_account_pair_size_global( rewards_pools + i );
    1307           0 :   } while(0);
    1308           0 :   size += sizeof(ulong);
    1309           0 :   size += sizeof(ulong);
    1310           0 :   size += fd_poh_config_size_global( &self->poh_config );
    1311           0 :   size += sizeof(ulong);
    1312           0 :   size += fd_fee_rate_governor_size( &self->fee_rate_governor );
    1313           0 :   size += fd_rent_size( &self->rent );
    1314           0 :   size += fd_inflation_size( &self->inflation );
    1315           0 :   size += fd_epoch_schedule_size( &self->epoch_schedule );
    1316           0 :   size += sizeof(uint);
    1317           0 :   return size;
    1318           0 : }
    1319             : 
    1320         225 : int fd_sol_sysvar_clock_encode( fd_sol_sysvar_clock_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1321         225 :   int err;
    1322         225 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    1323         225 :   if( FD_UNLIKELY( err ) ) return err;
    1324         225 :   err = fd_bincode_uint64_encode( (ulong)self->epoch_start_timestamp, ctx );
    1325         225 :   if( FD_UNLIKELY( err ) ) return err;
    1326         225 :   err = fd_bincode_uint64_encode( self->epoch, ctx );
    1327         225 :   if( FD_UNLIKELY( err ) ) return err;
    1328         225 :   err = fd_bincode_uint64_encode( self->leader_schedule_epoch, ctx );
    1329         225 :   if( FD_UNLIKELY( err ) ) return err;
    1330         225 :   err = fd_bincode_uint64_encode( (ulong)self->unix_timestamp, ctx );
    1331         225 :   if( FD_UNLIKELY( err ) ) return err;
    1332         225 :   return FD_BINCODE_SUCCESS;
    1333         225 : }
    1334           0 : static inline int fd_sol_sysvar_clock_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1335           0 :   if( (ulong)ctx->data + 40UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1336           0 :   ctx->data = (void *)( (ulong)ctx->data + 40UL );
    1337           0 :   return 0;
    1338           0 : }
    1339         282 : static void fd_sol_sysvar_clock_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1340         282 :   fd_sol_sysvar_clock_t * self = (fd_sol_sysvar_clock_t *)struct_mem;
    1341         282 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    1342         282 :   fd_bincode_uint64_decode_unsafe( (ulong *) &self->epoch_start_timestamp, ctx );
    1343         282 :   fd_bincode_uint64_decode_unsafe( &self->epoch, ctx );
    1344         282 :   fd_bincode_uint64_decode_unsafe( &self->leader_schedule_epoch, ctx );
    1345         282 :   fd_bincode_uint64_decode_unsafe( (ulong *) &self->unix_timestamp, ctx );
    1346         282 : }
    1347         282 : void * fd_sol_sysvar_clock_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1348         282 :   fd_sol_sysvar_clock_t * self = (fd_sol_sysvar_clock_t *)mem;
    1349         282 :   fd_sol_sysvar_clock_new( self );
    1350         282 :   void * alloc_region = (uchar *)mem + sizeof(fd_sol_sysvar_clock_t);
    1351         282 :   void * * alloc_mem = &alloc_region;
    1352         282 :   fd_sol_sysvar_clock_decode_inner( mem, alloc_mem, ctx );
    1353         282 :   return self;
    1354         282 : }
    1355           0 : int fd_sol_sysvar_last_restart_slot_encode( fd_sol_sysvar_last_restart_slot_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1356           0 :   int err;
    1357           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    1358           0 :   if( FD_UNLIKELY( err ) ) return err;
    1359           0 :   return FD_BINCODE_SUCCESS;
    1360           0 : }
    1361           0 : static inline int fd_sol_sysvar_last_restart_slot_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1362           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1363           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
    1364           0 :   return 0;
    1365           0 : }
    1366         129 : static void fd_sol_sysvar_last_restart_slot_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1367         129 :   fd_sol_sysvar_last_restart_slot_t * self = (fd_sol_sysvar_last_restart_slot_t *)struct_mem;
    1368         129 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    1369         129 : }
    1370         129 : void * fd_sol_sysvar_last_restart_slot_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1371         129 :   fd_sol_sysvar_last_restart_slot_t * self = (fd_sol_sysvar_last_restart_slot_t *)mem;
    1372         129 :   fd_sol_sysvar_last_restart_slot_new( self );
    1373         129 :   void * alloc_region = (uchar *)mem + sizeof(fd_sol_sysvar_last_restart_slot_t);
    1374         129 :   void * * alloc_mem = &alloc_region;
    1375         129 :   fd_sol_sysvar_last_restart_slot_decode_inner( mem, alloc_mem, ctx );
    1376         129 :   return self;
    1377         129 : }
    1378         279 : int fd_vote_lockout_encode( fd_vote_lockout_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1379         279 :   int err;
    1380         279 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    1381         279 :   if( FD_UNLIKELY( err ) ) return err;
    1382         279 :   err = fd_bincode_uint32_encode( self->confirmation_count, ctx );
    1383         279 :   if( FD_UNLIKELY( err ) ) return err;
    1384         279 :   return FD_BINCODE_SUCCESS;
    1385         279 : }
    1386           0 : static inline int fd_vote_lockout_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1387           0 :   if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1388           0 :   ctx->data = (void *)( (ulong)ctx->data + 12UL );
    1389           0 :   return 0;
    1390           0 : }
    1391           0 : static void fd_vote_lockout_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1392           0 :   fd_vote_lockout_t * self = (fd_vote_lockout_t *)struct_mem;
    1393           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    1394           0 :   fd_bincode_uint32_decode_unsafe( &self->confirmation_count, ctx );
    1395           0 : }
    1396           0 : void * fd_vote_lockout_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1397           0 :   fd_vote_lockout_t * self = (fd_vote_lockout_t *)mem;
    1398           0 :   fd_vote_lockout_new( self );
    1399           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_lockout_t);
    1400           0 :   void * * alloc_mem = &alloc_region;
    1401           0 :   fd_vote_lockout_decode_inner( mem, alloc_mem, ctx );
    1402           0 :   return self;
    1403           0 : }
    1404           0 : int fd_lockout_offset_encode( fd_lockout_offset_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1405           0 :   int err;
    1406           0 :   err = fd_bincode_varint_encode( self->offset, ctx );
    1407           0 :   if( FD_UNLIKELY( err ) ) return err;
    1408           0 :   err = fd_bincode_uint8_encode( (uchar)(self->confirmation_count), ctx );
    1409           0 :   if( FD_UNLIKELY( err ) ) return err;
    1410           0 :   return FD_BINCODE_SUCCESS;
    1411           0 : }
    1412           0 : static int fd_lockout_offset_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1413           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1414           0 :   int err = 0;
    1415           0 :   err = fd_bincode_varint_decode_footprint( ctx );
    1416           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1417           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    1418           0 :   if( FD_UNLIKELY( err ) ) return err;
    1419           0 :   return 0;
    1420           0 : }
    1421           0 : int fd_lockout_offset_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1422           0 :   *total_sz += sizeof(fd_lockout_offset_t);
    1423           0 :   void const * start_data = ctx->data;
    1424           0 :   int err = fd_lockout_offset_decode_footprint_inner( ctx, total_sz );
    1425           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1426           0 :   ctx->data = start_data;
    1427           0 :   return err;
    1428           0 : }
    1429           0 : static void fd_lockout_offset_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1430           0 :   fd_lockout_offset_t * self = (fd_lockout_offset_t *)struct_mem;
    1431           0 :   fd_bincode_varint_decode_unsafe( &self->offset, ctx );
    1432           0 :   fd_bincode_uint8_decode_unsafe( &self->confirmation_count, ctx );
    1433           0 : }
    1434           0 : void * fd_lockout_offset_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1435           0 :   fd_lockout_offset_t * self = (fd_lockout_offset_t *)mem;
    1436           0 :   fd_lockout_offset_new( self );
    1437           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_lockout_offset_t);
    1438           0 :   void * * alloc_mem = &alloc_region;
    1439           0 :   fd_lockout_offset_decode_inner( mem, alloc_mem, ctx );
    1440           0 :   return self;
    1441           0 : }
    1442           0 : void fd_lockout_offset_new(fd_lockout_offset_t * self) {
    1443           0 :   fd_memset( self, 0, sizeof(fd_lockout_offset_t) );
    1444           0 : }
    1445           0 : ulong fd_lockout_offset_size( fd_lockout_offset_t const * self ) {
    1446           0 :   ulong size = 0;
    1447           0 :   size += fd_bincode_varint_size( self->offset );
    1448           0 :   size += sizeof(char);
    1449           0 :   return size;
    1450           0 : }
    1451             : 
    1452          93 : int fd_vote_authorized_voter_encode( fd_vote_authorized_voter_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1453          93 :   int err;
    1454          93 :   err = fd_bincode_uint64_encode( self->epoch, ctx );
    1455          93 :   if( FD_UNLIKELY( err ) ) return err;
    1456          93 :   err = fd_pubkey_encode( &self->pubkey, ctx );
    1457          93 :   if( FD_UNLIKELY( err ) ) return err;
    1458          93 :   return FD_BINCODE_SUCCESS;
    1459          93 : }
    1460          72 : static inline int fd_vote_authorized_voter_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1461          72 :   if( (ulong)ctx->data + 40UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1462          72 :   ctx->data = (void *)( (ulong)ctx->data + 40UL );
    1463          72 :   return 0;
    1464          72 : }
    1465          27 : static void fd_vote_authorized_voter_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1466          27 :   fd_vote_authorized_voter_t * self = (fd_vote_authorized_voter_t *)struct_mem;
    1467          27 :   fd_bincode_uint64_decode_unsafe( &self->epoch, ctx );
    1468          27 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
    1469          27 : }
    1470           0 : void * fd_vote_authorized_voter_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1471           0 :   fd_vote_authorized_voter_t * self = (fd_vote_authorized_voter_t *)mem;
    1472           0 :   fd_vote_authorized_voter_new( self );
    1473           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorized_voter_t);
    1474           0 :   void * * alloc_mem = &alloc_region;
    1475           0 :   fd_vote_authorized_voter_decode_inner( mem, alloc_mem, ctx );
    1476           0 :   return self;
    1477           0 : }
    1478        1920 : int fd_vote_prior_voter_encode( fd_vote_prior_voter_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1479        1920 :   int err;
    1480        1920 :   err = fd_pubkey_encode( &self->pubkey, ctx );
    1481        1920 :   if( FD_UNLIKELY( err ) ) return err;
    1482        1920 :   err = fd_bincode_uint64_encode( self->epoch_start, ctx );
    1483        1920 :   if( FD_UNLIKELY( err ) ) return err;
    1484        1920 :   err = fd_bincode_uint64_encode( self->epoch_end, ctx );
    1485        1920 :   if( FD_UNLIKELY( err ) ) return err;
    1486        1920 :   return FD_BINCODE_SUCCESS;
    1487        1920 : }
    1488        1344 : static inline int fd_vote_prior_voter_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1489        1344 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1490        1344 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
    1491        1344 :   return 0;
    1492        1344 : }
    1493         864 : static void fd_vote_prior_voter_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1494         864 :   fd_vote_prior_voter_t * self = (fd_vote_prior_voter_t *)struct_mem;
    1495         864 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
    1496         864 :   fd_bincode_uint64_decode_unsafe( &self->epoch_start, ctx );
    1497         864 :   fd_bincode_uint64_decode_unsafe( &self->epoch_end, ctx );
    1498         864 : }
    1499           0 : void * fd_vote_prior_voter_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1500           0 :   fd_vote_prior_voter_t * self = (fd_vote_prior_voter_t *)mem;
    1501           0 :   fd_vote_prior_voter_new( self );
    1502           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_prior_voter_t);
    1503           0 :   void * * alloc_mem = &alloc_region;
    1504           0 :   fd_vote_prior_voter_decode_inner( mem, alloc_mem, ctx );
    1505           0 :   return self;
    1506           0 : }
    1507         576 : int fd_vote_epoch_credits_encode( fd_vote_epoch_credits_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1508         576 :   int err;
    1509         576 :   err = fd_bincode_uint64_encode( self->epoch, ctx );
    1510         576 :   if( FD_UNLIKELY( err ) ) return err;
    1511         576 :   err = fd_bincode_uint64_encode( self->credits, ctx );
    1512         576 :   if( FD_UNLIKELY( err ) ) return err;
    1513         576 :   err = fd_bincode_uint64_encode( self->prev_credits, ctx );
    1514         576 :   if( FD_UNLIKELY( err ) ) return err;
    1515         576 :   return FD_BINCODE_SUCCESS;
    1516         576 : }
    1517           0 : static inline int fd_vote_epoch_credits_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1518           0 :   if( (ulong)ctx->data + 24UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1519           0 :   ctx->data = (void *)( (ulong)ctx->data + 24UL );
    1520           0 :   return 0;
    1521           0 : }
    1522           0 : static void fd_vote_epoch_credits_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1523           0 :   fd_vote_epoch_credits_t * self = (fd_vote_epoch_credits_t *)struct_mem;
    1524           0 :   fd_bincode_uint64_decode_unsafe( &self->epoch, ctx );
    1525           0 :   fd_bincode_uint64_decode_unsafe( &self->credits, ctx );
    1526           0 :   fd_bincode_uint64_decode_unsafe( &self->prev_credits, ctx );
    1527           0 : }
    1528           0 : void * fd_vote_epoch_credits_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1529           0 :   fd_vote_epoch_credits_t * self = (fd_vote_epoch_credits_t *)mem;
    1530           0 :   fd_vote_epoch_credits_new( self );
    1531           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_epoch_credits_t);
    1532           0 :   void * * alloc_mem = &alloc_region;
    1533           0 :   fd_vote_epoch_credits_decode_inner( mem, alloc_mem, ctx );
    1534           0 :   return self;
    1535           0 : }
    1536          66 : int fd_vote_block_timestamp_encode( fd_vote_block_timestamp_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1537          66 :   int err;
    1538          66 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    1539          66 :   if( FD_UNLIKELY( err ) ) return err;
    1540          66 :   err = fd_bincode_uint64_encode( (ulong)self->timestamp, ctx );
    1541          66 :   if( FD_UNLIKELY( err ) ) return err;
    1542          66 :   return FD_BINCODE_SUCCESS;
    1543          66 : }
    1544          45 : static inline int fd_vote_block_timestamp_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1545          45 :   if( (ulong)ctx->data + 16UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1546          45 :   ctx->data = (void *)( (ulong)ctx->data + 16UL );
    1547          45 :   return 0;
    1548          45 : }
    1549          27 : static void fd_vote_block_timestamp_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1550          27 :   fd_vote_block_timestamp_t * self = (fd_vote_block_timestamp_t *)struct_mem;
    1551          27 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    1552          27 :   fd_bincode_uint64_decode_unsafe( (ulong *) &self->timestamp, ctx );
    1553          27 : }
    1554           0 : void * fd_vote_block_timestamp_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1555           0 :   fd_vote_block_timestamp_t * self = (fd_vote_block_timestamp_t *)mem;
    1556           0 :   fd_vote_block_timestamp_new( self );
    1557           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_block_timestamp_t);
    1558           0 :   void * * alloc_mem = &alloc_region;
    1559           0 :   fd_vote_block_timestamp_decode_inner( mem, alloc_mem, ctx );
    1560           0 :   return self;
    1561           0 : }
    1562          60 : int fd_vote_prior_voters_encode( fd_vote_prior_voters_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1563          60 :   int err;
    1564        1980 :   for( ulong i=0; i<32; i++ ) {
    1565        1920 :     err = fd_vote_prior_voter_encode( self->buf + i, ctx );
    1566        1920 :     if( FD_UNLIKELY( err ) ) return err;
    1567        1920 :   }
    1568          60 :   err = fd_bincode_uint64_encode( self->idx, ctx );
    1569          60 :   if( FD_UNLIKELY( err ) ) return err;
    1570          60 :   err = fd_bincode_bool_encode( (uchar)(self->is_empty), ctx );
    1571          60 :   if( FD_UNLIKELY( err ) ) return err;
    1572          60 :   return FD_BINCODE_SUCCESS;
    1573          60 : }
    1574          42 : static int fd_vote_prior_voters_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1575          42 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1576          42 :   int err = 0;
    1577        1386 :   for( ulong i=0; i<32; i++ ) {
    1578        1344 :     err = fd_vote_prior_voter_decode_footprint_inner( ctx, total_sz );
    1579        1344 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1580        1344 :   }
    1581          42 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1582          42 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1583          42 :   err = fd_bincode_bool_decode_footprint( ctx );
    1584          42 :   if( FD_UNLIKELY( err ) ) return err;
    1585          42 :   return 0;
    1586          42 : }
    1587           0 : int fd_vote_prior_voters_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1588           0 :   *total_sz += sizeof(fd_vote_prior_voters_t);
    1589           0 :   void const * start_data = ctx->data;
    1590           0 :   int err = fd_vote_prior_voters_decode_footprint_inner( ctx, total_sz );
    1591           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1592           0 :   ctx->data = start_data;
    1593           0 :   return err;
    1594           0 : }
    1595          27 : static void fd_vote_prior_voters_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1596          27 :   fd_vote_prior_voters_t * self = (fd_vote_prior_voters_t *)struct_mem;
    1597         891 :   for( ulong i=0; i<32; i++ ) {
    1598         864 :     fd_vote_prior_voter_decode_inner( self->buf + i, alloc_mem, ctx );
    1599         864 :   }
    1600          27 :   fd_bincode_uint64_decode_unsafe( &self->idx, ctx );
    1601          27 :   fd_bincode_bool_decode_unsafe( &self->is_empty, ctx );
    1602          27 : }
    1603           0 : void * fd_vote_prior_voters_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1604           0 :   fd_vote_prior_voters_t * self = (fd_vote_prior_voters_t *)mem;
    1605           0 :   fd_vote_prior_voters_new( self );
    1606           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_prior_voters_t);
    1607           0 :   void * * alloc_mem = &alloc_region;
    1608           0 :   fd_vote_prior_voters_decode_inner( mem, alloc_mem, ctx );
    1609           0 :   return self;
    1610           0 : }
    1611          57 : void fd_vote_prior_voters_new(fd_vote_prior_voters_t * self) {
    1612          57 :   fd_memset( self, 0, sizeof(fd_vote_prior_voters_t) );
    1613        1881 :   for( ulong i=0; i<32; i++ )
    1614        1824 :     fd_vote_prior_voter_new( self->buf + i );
    1615          57 : }
    1616         186 : int fd_landed_vote_encode( fd_landed_vote_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1617         186 :   int err;
    1618         186 :   err = fd_bincode_uint8_encode( (uchar)(self->latency), ctx );
    1619         186 :   if( FD_UNLIKELY( err ) ) return err;
    1620         186 :   err = fd_vote_lockout_encode( &self->lockout, ctx );
    1621         186 :   if( FD_UNLIKELY( err ) ) return err;
    1622         186 :   return FD_BINCODE_SUCCESS;
    1623         186 : }
    1624           0 : static inline int fd_landed_vote_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1625           0 :   if( (ulong)ctx->data + 13UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1626           0 :   ctx->data = (void *)( (ulong)ctx->data + 13UL );
    1627           0 :   return 0;
    1628           0 : }
    1629           0 : static void fd_landed_vote_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1630           0 :   fd_landed_vote_t * self = (fd_landed_vote_t *)struct_mem;
    1631           0 :   fd_bincode_uint8_decode_unsafe( &self->latency, ctx );
    1632           0 :   fd_vote_lockout_decode_inner( &self->lockout, alloc_mem, ctx );
    1633           0 : }
    1634           0 : void * fd_landed_vote_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1635           0 :   fd_landed_vote_t * self = (fd_landed_vote_t *)mem;
    1636           0 :   fd_landed_vote_new( self );
    1637           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_landed_vote_t);
    1638           0 :   void * * alloc_mem = &alloc_region;
    1639           0 :   fd_landed_vote_decode_inner( mem, alloc_mem, ctx );
    1640           0 :   return self;
    1641           0 : }
    1642           3 : int fd_bls_pubkey_compressed_encode( fd_bls_pubkey_compressed_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1643           3 :   int err;
    1644           3 :   err = fd_bincode_bytes_encode( self->buf, 48, ctx );
    1645           3 :   if( FD_UNLIKELY( err ) ) return err;
    1646           3 :   return FD_BINCODE_SUCCESS;
    1647           3 : }
    1648           3 : static inline int fd_bls_pubkey_compressed_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1649           3 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1650           3 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
    1651           3 :   return 0;
    1652           3 : }
    1653           6 : static void fd_bls_pubkey_compressed_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1654           6 :   fd_bls_pubkey_compressed_t * self = (fd_bls_pubkey_compressed_t *)struct_mem;
    1655           6 :   fd_bincode_bytes_decode_unsafe( self->buf, 48, ctx );
    1656           6 : }
    1657           0 : void * fd_bls_pubkey_compressed_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1658           0 :   fd_bls_pubkey_compressed_t * self = (fd_bls_pubkey_compressed_t *)mem;
    1659           0 :   fd_bls_pubkey_compressed_new( self );
    1660           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bls_pubkey_compressed_t);
    1661           0 :   void * * alloc_mem = &alloc_region;
    1662           0 :   fd_bls_pubkey_compressed_decode_inner( mem, alloc_mem, ctx );
    1663           0 :   return self;
    1664           0 : }
    1665           0 : int fd_bls_proof_of_possession_encode( fd_bls_proof_of_possession_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1666           0 :   int err;
    1667           0 :   err = fd_bincode_bytes_encode( self->buf, 96, ctx );
    1668           0 :   if( FD_UNLIKELY( err ) ) return err;
    1669           0 :   return FD_BINCODE_SUCCESS;
    1670           0 : }
    1671           0 : static inline int fd_bls_proof_of_possession_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1672           0 :   if( (ulong)ctx->data + 96UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1673           0 :   ctx->data = (void *)( (ulong)ctx->data + 96UL );
    1674           0 :   return 0;
    1675           0 : }
    1676           6 : static void fd_bls_proof_of_possession_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1677           6 :   fd_bls_proof_of_possession_t * self = (fd_bls_proof_of_possession_t *)struct_mem;
    1678           6 :   fd_bincode_bytes_decode_unsafe( self->buf, 96, ctx );
    1679           6 : }
    1680           0 : void * fd_bls_proof_of_possession_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1681           0 :   fd_bls_proof_of_possession_t * self = (fd_bls_proof_of_possession_t *)mem;
    1682           0 :   fd_bls_proof_of_possession_new( self );
    1683           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bls_proof_of_possession_t);
    1684           0 :   void * * alloc_mem = &alloc_region;
    1685           0 :   fd_bls_proof_of_possession_decode_inner( mem, alloc_mem, ctx );
    1686           0 :   return self;
    1687           0 : }
    1688          66 : int fd_vote_authorized_voters_encode( fd_vote_authorized_voters_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1689          66 :   int err;
    1690          66 :   if( self->treap ) {
    1691          66 :     ulong fd_vote_authorized_voters_len = fd_vote_authorized_voters_treap_ele_cnt( self->treap );
    1692          66 :     err = fd_bincode_uint64_encode( fd_vote_authorized_voters_len, ctx );
    1693          66 :     if( FD_UNLIKELY( err ) ) return err;
    1694          66 :     for( fd_vote_authorized_voters_treap_fwd_iter_t iter = fd_vote_authorized_voters_treap_fwd_iter_init( self->treap, self->pool );
    1695         159 :          !fd_vote_authorized_voters_treap_fwd_iter_done( iter );
    1696          93 :          iter = fd_vote_authorized_voters_treap_fwd_iter_next( iter, self->pool ) ) {
    1697          93 :       fd_vote_authorized_voter_t * ele = fd_vote_authorized_voters_treap_fwd_iter_ele( iter, self->pool );
    1698          93 :       err = fd_vote_authorized_voter_encode( ele, ctx );
    1699          93 :       if( FD_UNLIKELY( err ) ) return err;
    1700          93 :     }
    1701          66 :   } else {
    1702           0 :     ulong fd_vote_authorized_voters_len = 0;
    1703           0 :     err = fd_bincode_uint64_encode( fd_vote_authorized_voters_len, ctx );
    1704           0 :     if( FD_UNLIKELY( err ) ) return err;
    1705           0 :   }
    1706          66 :   return FD_BINCODE_SUCCESS;
    1707          66 : }
    1708          45 : static int fd_vote_authorized_voters_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1709          45 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1710          45 :   int err = 0;
    1711          45 :   ulong fd_vote_authorized_voters_treap_len;
    1712          45 :   err = fd_bincode_uint64_decode( &fd_vote_authorized_voters_treap_len, ctx );
    1713          45 :   if( FD_UNLIKELY( err ) ) return err;
    1714          45 :   ulong fd_vote_authorized_voters_treap_max = fd_ulong_max( fd_ulong_max( fd_vote_authorized_voters_treap_len, FD_VOTE_AUTHORIZED_VOTERS_MIN ), 1UL );
    1715          45 :   *total_sz += fd_vote_authorized_voters_pool_align() + fd_vote_authorized_voters_pool_footprint( fd_vote_authorized_voters_treap_max );
    1716          45 :   *total_sz += fd_vote_authorized_voters_treap_align() + fd_vote_authorized_voters_treap_footprint( fd_vote_authorized_voters_treap_max );
    1717         117 :   for( ulong i=0; i < fd_vote_authorized_voters_treap_len; i++ ) {
    1718          72 :     err = fd_vote_authorized_voter_decode_footprint_inner( ctx, total_sz );
    1719          72 :     if( FD_UNLIKELY ( err ) ) return err;
    1720          72 :   }
    1721          45 :   return 0;
    1722          45 : }
    1723           0 : int fd_vote_authorized_voters_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1724           0 :   *total_sz += sizeof(fd_vote_authorized_voters_t);
    1725           0 :   void const * start_data = ctx->data;
    1726           0 :   int err = fd_vote_authorized_voters_decode_footprint_inner( ctx, total_sz );
    1727           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1728           0 :   ctx->data = start_data;
    1729           0 :   return err;
    1730           0 : }
    1731          27 : static void fd_vote_authorized_voters_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1732          27 :   fd_vote_authorized_voters_t * self = (fd_vote_authorized_voters_t *)struct_mem;
    1733          27 :   ulong fd_vote_authorized_voters_treap_len;
    1734          27 :   fd_bincode_uint64_decode_unsafe( &fd_vote_authorized_voters_treap_len, ctx );
    1735          27 :   ulong fd_vote_authorized_voters_treap_max = fd_ulong_max( fd_vote_authorized_voters_treap_len, FD_VOTE_AUTHORIZED_VOTERS_MIN );
    1736          27 :   self->pool = fd_vote_authorized_voters_pool_join_new( alloc_mem, fd_vote_authorized_voters_treap_max );
    1737          27 :   self->treap = fd_vote_authorized_voters_treap_join_new( alloc_mem, fd_vote_authorized_voters_treap_max );
    1738          54 :   for( ulong i=0; i < fd_vote_authorized_voters_treap_len; i++ ) {
    1739          27 :     fd_vote_authorized_voter_t * ele = fd_vote_authorized_voters_pool_ele_acquire( self->pool );
    1740          27 :     fd_vote_authorized_voter_new( ele );
    1741          27 :     fd_vote_authorized_voter_decode_inner( ele, alloc_mem, ctx );
    1742          27 :     fd_vote_authorized_voter_t * repeated_entry = fd_vote_authorized_voters_treap_ele_query( self->treap, ele->epoch, self->pool );
    1743          27 :     if( repeated_entry ) {
    1744           0 :         fd_vote_authorized_voters_treap_ele_remove( self->treap, repeated_entry, self->pool ); // Remove the element before inserting it back to avoid duplication
    1745           0 :         fd_vote_authorized_voters_pool_ele_release( self->pool, repeated_entry );
    1746           0 :     }
    1747          27 :     fd_vote_authorized_voters_treap_ele_insert( self->treap, ele, self->pool ); /* this cannot fail */
    1748          27 :   }
    1749          27 : }
    1750           0 : void * fd_vote_authorized_voters_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1751           0 :   fd_vote_authorized_voters_t * self = (fd_vote_authorized_voters_t *)mem;
    1752           0 :   fd_vote_authorized_voters_new( self );
    1753           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorized_voters_t);
    1754           0 :   void * * alloc_mem = &alloc_region;
    1755           0 :   fd_vote_authorized_voters_decode_inner( mem, alloc_mem, ctx );
    1756           0 :   return self;
    1757           0 : }
    1758          60 : void fd_vote_authorized_voters_new(fd_vote_authorized_voters_t * self) {
    1759          60 :   fd_memset( self, 0, sizeof(fd_vote_authorized_voters_t) );
    1760          60 : }
    1761           6 : ulong fd_vote_authorized_voters_size( fd_vote_authorized_voters_t const * self ) {
    1762           6 :   ulong size = 0;
    1763           6 :   size += sizeof(ulong);
    1764           6 :   if( self->treap ) {
    1765           6 :     for( fd_vote_authorized_voters_treap_fwd_iter_t iter = fd_vote_authorized_voters_treap_fwd_iter_init( self->treap, self->pool );
    1766          12 :          !fd_vote_authorized_voters_treap_fwd_iter_done( iter );
    1767           6 :          iter = fd_vote_authorized_voters_treap_fwd_iter_next( iter, self->pool ) ) {
    1768           6 :       fd_vote_authorized_voter_t * ele = fd_vote_authorized_voters_treap_fwd_iter_ele( iter, self->pool );
    1769           6 :       size += fd_vote_authorized_voter_size( ele );
    1770           6 :     }
    1771           6 :   }
    1772           6 :   return size;
    1773           6 : }
    1774             : 
    1775           3 : int fd_vote_state_1_14_11_encode( fd_vote_state_1_14_11_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1776           3 :   int err;
    1777           3 :   err = fd_pubkey_encode( &self->node_pubkey, ctx );
    1778           3 :   if( FD_UNLIKELY( err ) ) return err;
    1779           3 :   err = fd_pubkey_encode( &self->authorized_withdrawer, ctx );
    1780           3 :   if( FD_UNLIKELY( err ) ) return err;
    1781           3 :   err = fd_bincode_uint8_encode( (uchar)(self->commission), ctx );
    1782           3 :   if( FD_UNLIKELY( err ) ) return err;
    1783           3 :   if( self->votes ) {
    1784           3 :     ulong votes_len = deq_fd_vote_lockout_t_cnt( self->votes );
    1785           3 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    1786           3 :     if( FD_UNLIKELY( err ) ) return err;
    1787          96 :     for( deq_fd_vote_lockout_t_iter_t iter = deq_fd_vote_lockout_t_iter_init( self->votes ); !deq_fd_vote_lockout_t_iter_done( self->votes, iter ); iter = deq_fd_vote_lockout_t_iter_next( self->votes, iter ) ) {
    1788          93 :       fd_vote_lockout_t const * ele = deq_fd_vote_lockout_t_iter_ele_const( self->votes, iter );
    1789          93 :       err = fd_vote_lockout_encode( ele, ctx );
    1790          93 :       if( FD_UNLIKELY( err ) ) return err;
    1791          93 :     }
    1792           3 :   } else {
    1793           0 :     ulong votes_len = 0;
    1794           0 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    1795           0 :     if( FD_UNLIKELY( err ) ) return err;
    1796           0 :   }
    1797           3 :   err = fd_bincode_bool_encode( self->has_root_slot, ctx );
    1798           3 :   if( FD_UNLIKELY( err ) ) return err;
    1799           3 :   if( self->has_root_slot ) {
    1800           3 :     err = fd_bincode_uint64_encode( self->root_slot, ctx );
    1801           3 :     if( FD_UNLIKELY( err ) ) return err;
    1802           3 :   }
    1803           3 :   err = fd_vote_authorized_voters_encode( &self->authorized_voters, ctx );
    1804           3 :   if( FD_UNLIKELY( err ) ) return err;
    1805           3 :   err = fd_vote_prior_voters_encode( &self->prior_voters, ctx );
    1806           3 :   if( FD_UNLIKELY( err ) ) return err;
    1807           3 :   if( self->epoch_credits ) {
    1808           3 :     ulong epoch_credits_len = deq_fd_vote_epoch_credits_t_cnt( self->epoch_credits );
    1809           3 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    1810           3 :     if( FD_UNLIKELY( err ) ) return err;
    1811         195 :     for( deq_fd_vote_epoch_credits_t_iter_t iter = deq_fd_vote_epoch_credits_t_iter_init( self->epoch_credits ); !deq_fd_vote_epoch_credits_t_iter_done( self->epoch_credits, iter ); iter = deq_fd_vote_epoch_credits_t_iter_next( self->epoch_credits, iter ) ) {
    1812         192 :       fd_vote_epoch_credits_t const * ele = deq_fd_vote_epoch_credits_t_iter_ele_const( self->epoch_credits, iter );
    1813         192 :       err = fd_vote_epoch_credits_encode( ele, ctx );
    1814         192 :       if( FD_UNLIKELY( err ) ) return err;
    1815         192 :     }
    1816           3 :   } else {
    1817           0 :     ulong epoch_credits_len = 0;
    1818           0 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    1819           0 :     if( FD_UNLIKELY( err ) ) return err;
    1820           0 :   }
    1821           3 :   err = fd_vote_block_timestamp_encode( &self->last_timestamp, ctx );
    1822           3 :   if( FD_UNLIKELY( err ) ) return err;
    1823           3 :   return FD_BINCODE_SUCCESS;
    1824           3 : }
    1825           3 : static int fd_vote_state_1_14_11_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1826           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1827           3 :   int err = 0;
    1828           3 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    1829           3 :   if( FD_UNLIKELY( err ) ) return err;
    1830           3 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    1831           3 :   if( FD_UNLIKELY( err ) ) return err;
    1832           3 :   err = fd_bincode_uint8_decode_footprint( ctx );
    1833           3 :   if( FD_UNLIKELY( err ) ) return err;
    1834           3 :   ulong votes_len;
    1835           3 :   err = fd_bincode_uint64_decode( &votes_len, ctx );
    1836           3 :   if( FD_UNLIKELY( err ) ) return err;
    1837           3 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    1838           3 :   *total_sz += deq_fd_vote_lockout_t_align() + deq_fd_vote_lockout_t_footprint( votes_max );
    1839           3 :   ulong votes_sz;
    1840           3 :   if( FD_UNLIKELY( __builtin_umull_overflow( votes_len, 12, &votes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    1841           3 :   err = fd_bincode_bytes_decode_footprint( votes_sz, ctx );
    1842           3 :   if( FD_UNLIKELY( err ) ) return err;
    1843           3 :   {
    1844           3 :     uchar o;
    1845           3 :     err = fd_bincode_bool_decode( &o, ctx );
    1846           3 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1847           3 :     if( o ) {
    1848           3 :       err = fd_bincode_uint64_decode_footprint( ctx );
    1849           3 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1850           3 :     }
    1851           3 :   }
    1852           3 :   err = fd_vote_authorized_voters_decode_footprint_inner( ctx, total_sz );
    1853           3 :   if( FD_UNLIKELY( err ) ) return err;
    1854           3 :   err = fd_vote_prior_voters_decode_footprint_inner( ctx, total_sz );
    1855           3 :   if( FD_UNLIKELY( err ) ) return err;
    1856           3 :   ulong epoch_credits_len;
    1857           3 :   err = fd_bincode_uint64_decode( &epoch_credits_len, ctx );
    1858           3 :   if( FD_UNLIKELY( err ) ) return err;
    1859           3 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    1860           3 :   *total_sz += deq_fd_vote_epoch_credits_t_align() + deq_fd_vote_epoch_credits_t_footprint( epoch_credits_max );
    1861           3 :   ulong epoch_credits_sz;
    1862           3 :   if( FD_UNLIKELY( __builtin_umull_overflow( epoch_credits_len, 24, &epoch_credits_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    1863           3 :   err = fd_bincode_bytes_decode_footprint( epoch_credits_sz, ctx );
    1864           3 :   if( FD_UNLIKELY( err ) ) return err;
    1865           3 :   err = fd_vote_block_timestamp_decode_footprint_inner( ctx, total_sz );
    1866           3 :   if( FD_UNLIKELY( err ) ) return err;
    1867           3 :   return 0;
    1868           3 : }
    1869           0 : int fd_vote_state_1_14_11_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1870           0 :   *total_sz += sizeof(fd_vote_state_1_14_11_t);
    1871           0 :   void const * start_data = ctx->data;
    1872           0 :   int err = fd_vote_state_1_14_11_decode_footprint_inner( ctx, total_sz );
    1873           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1874           0 :   ctx->data = start_data;
    1875           0 :   return err;
    1876           0 : }
    1877           0 : static void fd_vote_state_1_14_11_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1878           0 :   fd_vote_state_1_14_11_t * self = (fd_vote_state_1_14_11_t *)struct_mem;
    1879           0 :   fd_pubkey_decode_inner( &self->node_pubkey, alloc_mem, ctx );
    1880           0 :   fd_pubkey_decode_inner( &self->authorized_withdrawer, alloc_mem, ctx );
    1881           0 :   fd_bincode_uint8_decode_unsafe( &self->commission, ctx );
    1882           0 :   ulong votes_len;
    1883           0 :   fd_bincode_uint64_decode_unsafe( &votes_len, ctx );
    1884           0 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    1885           0 :   self->votes = deq_fd_vote_lockout_t_join_new( alloc_mem, votes_max );
    1886           0 :   for( ulong i=0; i < votes_len; i++ ) {
    1887           0 :     fd_vote_lockout_t * elem = deq_fd_vote_lockout_t_push_tail_nocopy( self->votes );
    1888           0 :     fd_vote_lockout_new( elem );
    1889           0 :     fd_vote_lockout_decode_inner( elem, alloc_mem, ctx );
    1890           0 :   }
    1891           0 :   {
    1892           0 :     uchar o;
    1893           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    1894           0 :     self->has_root_slot = !!o;
    1895           0 :     if( o ) {
    1896           0 :       fd_bincode_uint64_decode_unsafe( &self->root_slot, ctx );
    1897           0 :     }
    1898           0 :   }
    1899           0 :   fd_vote_authorized_voters_decode_inner( &self->authorized_voters, alloc_mem, ctx );
    1900           0 :   fd_vote_prior_voters_decode_inner( &self->prior_voters, alloc_mem, ctx );
    1901           0 :   ulong epoch_credits_len;
    1902           0 :   fd_bincode_uint64_decode_unsafe( &epoch_credits_len, ctx );
    1903           0 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    1904           0 :   self->epoch_credits = deq_fd_vote_epoch_credits_t_join_new( alloc_mem, epoch_credits_max );
    1905           0 :   for( ulong i=0; i < epoch_credits_len; i++ ) {
    1906           0 :     fd_vote_epoch_credits_t * elem = deq_fd_vote_epoch_credits_t_push_tail_nocopy( self->epoch_credits );
    1907           0 :     fd_vote_epoch_credits_new( elem );
    1908           0 :     fd_vote_epoch_credits_decode_inner( elem, alloc_mem, ctx );
    1909           0 :   }
    1910           0 :   fd_vote_block_timestamp_decode_inner( &self->last_timestamp, alloc_mem, ctx );
    1911           0 : }
    1912           0 : void * fd_vote_state_1_14_11_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1913           0 :   fd_vote_state_1_14_11_t * self = (fd_vote_state_1_14_11_t *)mem;
    1914           0 :   fd_vote_state_1_14_11_new( self );
    1915           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_1_14_11_t);
    1916           0 :   void * * alloc_mem = &alloc_region;
    1917           0 :   fd_vote_state_1_14_11_decode_inner( mem, alloc_mem, ctx );
    1918           0 :   return self;
    1919           0 : }
    1920           3 : void fd_vote_state_1_14_11_new(fd_vote_state_1_14_11_t * self) {
    1921           3 :   fd_memset( self, 0, sizeof(fd_vote_state_1_14_11_t) );
    1922           3 :   fd_pubkey_new( &self->node_pubkey );
    1923           3 :   fd_pubkey_new( &self->authorized_withdrawer );
    1924           3 :   fd_vote_authorized_voters_new( &self->authorized_voters );
    1925           3 :   fd_vote_prior_voters_new( &self->prior_voters );
    1926           3 :   fd_vote_block_timestamp_new( &self->last_timestamp );
    1927           3 : }
    1928           0 : ulong fd_vote_state_1_14_11_size( fd_vote_state_1_14_11_t const * self ) {
    1929           0 :   ulong size = 0;
    1930           0 :   size += fd_pubkey_size( &self->node_pubkey );
    1931           0 :   size += fd_pubkey_size( &self->authorized_withdrawer );
    1932           0 :   size += sizeof(char);
    1933           0 :   if( self->votes ) {
    1934           0 :     size += sizeof(ulong);
    1935           0 :     for( deq_fd_vote_lockout_t_iter_t iter = deq_fd_vote_lockout_t_iter_init( self->votes ); !deq_fd_vote_lockout_t_iter_done( self->votes, iter ); iter = deq_fd_vote_lockout_t_iter_next( self->votes, iter ) ) {
    1936           0 :       fd_vote_lockout_t * ele = deq_fd_vote_lockout_t_iter_ele( self->votes, iter );
    1937           0 :       size += fd_vote_lockout_size( ele );
    1938           0 :     }
    1939           0 :   } else {
    1940           0 :     size += sizeof(ulong);
    1941           0 :   }
    1942           0 :   size += sizeof(char);
    1943           0 :   if( self->has_root_slot ) {
    1944           0 :     size += sizeof(ulong);
    1945           0 :   }
    1946           0 :   size += fd_vote_authorized_voters_size( &self->authorized_voters );
    1947           0 :   size += fd_vote_prior_voters_size( &self->prior_voters );
    1948           0 :   if( self->epoch_credits ) {
    1949           0 :     size += sizeof(ulong);
    1950           0 :     for( deq_fd_vote_epoch_credits_t_iter_t iter = deq_fd_vote_epoch_credits_t_iter_init( self->epoch_credits ); !deq_fd_vote_epoch_credits_t_iter_done( self->epoch_credits, iter ); iter = deq_fd_vote_epoch_credits_t_iter_next( self->epoch_credits, iter ) ) {
    1951           0 :       fd_vote_epoch_credits_t * ele = deq_fd_vote_epoch_credits_t_iter_ele( self->epoch_credits, iter );
    1952           0 :       size += fd_vote_epoch_credits_size( ele );
    1953           0 :     }
    1954           0 :   } else {
    1955           0 :     size += sizeof(ulong);
    1956           0 :   }
    1957           0 :   size += fd_vote_block_timestamp_size( &self->last_timestamp );
    1958           0 :   return size;
    1959           0 : }
    1960             : 
    1961          57 : int fd_vote_state_v3_encode( fd_vote_state_v3_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1962          57 :   int err;
    1963          57 :   err = fd_pubkey_encode( &self->node_pubkey, ctx );
    1964          57 :   if( FD_UNLIKELY( err ) ) return err;
    1965          57 :   err = fd_pubkey_encode( &self->authorized_withdrawer, ctx );
    1966          57 :   if( FD_UNLIKELY( err ) ) return err;
    1967          57 :   err = fd_bincode_uint8_encode( (uchar)(self->commission), ctx );
    1968          57 :   if( FD_UNLIKELY( err ) ) return err;
    1969          57 :   if( self->votes ) {
    1970           3 :     ulong votes_len = deq_fd_landed_vote_t_cnt( self->votes );
    1971           3 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    1972           3 :     if( FD_UNLIKELY( err ) ) return err;
    1973          96 :     for( deq_fd_landed_vote_t_iter_t iter = deq_fd_landed_vote_t_iter_init( self->votes ); !deq_fd_landed_vote_t_iter_done( self->votes, iter ); iter = deq_fd_landed_vote_t_iter_next( self->votes, iter ) ) {
    1974          93 :       fd_landed_vote_t const * ele = deq_fd_landed_vote_t_iter_ele_const( self->votes, iter );
    1975          93 :       err = fd_landed_vote_encode( ele, ctx );
    1976          93 :       if( FD_UNLIKELY( err ) ) return err;
    1977          93 :     }
    1978          54 :   } else {
    1979          54 :     ulong votes_len = 0;
    1980          54 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    1981          54 :     if( FD_UNLIKELY( err ) ) return err;
    1982          54 :   }
    1983          57 :   err = fd_bincode_bool_encode( self->has_root_slot, ctx );
    1984          57 :   if( FD_UNLIKELY( err ) ) return err;
    1985          57 :   if( self->has_root_slot ) {
    1986           3 :     err = fd_bincode_uint64_encode( self->root_slot, ctx );
    1987           3 :     if( FD_UNLIKELY( err ) ) return err;
    1988           3 :   }
    1989          57 :   err = fd_vote_authorized_voters_encode( &self->authorized_voters, ctx );
    1990          57 :   if( FD_UNLIKELY( err ) ) return err;
    1991          57 :   err = fd_vote_prior_voters_encode( &self->prior_voters, ctx );
    1992          57 :   if( FD_UNLIKELY( err ) ) return err;
    1993          57 :   if( self->epoch_credits ) {
    1994           3 :     ulong epoch_credits_len = deq_fd_vote_epoch_credits_t_cnt( self->epoch_credits );
    1995           3 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    1996           3 :     if( FD_UNLIKELY( err ) ) return err;
    1997         195 :     for( deq_fd_vote_epoch_credits_t_iter_t iter = deq_fd_vote_epoch_credits_t_iter_init( self->epoch_credits ); !deq_fd_vote_epoch_credits_t_iter_done( self->epoch_credits, iter ); iter = deq_fd_vote_epoch_credits_t_iter_next( self->epoch_credits, iter ) ) {
    1998         192 :       fd_vote_epoch_credits_t const * ele = deq_fd_vote_epoch_credits_t_iter_ele_const( self->epoch_credits, iter );
    1999         192 :       err = fd_vote_epoch_credits_encode( ele, ctx );
    2000         192 :       if( FD_UNLIKELY( err ) ) return err;
    2001         192 :     }
    2002          54 :   } else {
    2003          54 :     ulong epoch_credits_len = 0;
    2004          54 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    2005          54 :     if( FD_UNLIKELY( err ) ) return err;
    2006          54 :   }
    2007          57 :   err = fd_vote_block_timestamp_encode( &self->last_timestamp, ctx );
    2008          57 :   if( FD_UNLIKELY( err ) ) return err;
    2009          57 :   return FD_BINCODE_SUCCESS;
    2010          57 : }
    2011          39 : static int fd_vote_state_v3_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2012          39 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2013          39 :   int err = 0;
    2014          39 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2015          39 :   if( FD_UNLIKELY( err ) ) return err;
    2016          39 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2017          39 :   if( FD_UNLIKELY( err ) ) return err;
    2018          39 :   err = fd_bincode_uint8_decode_footprint( ctx );
    2019          39 :   if( FD_UNLIKELY( err ) ) return err;
    2020          39 :   ulong votes_len;
    2021          39 :   err = fd_bincode_uint64_decode( &votes_len, ctx );
    2022          39 :   if( FD_UNLIKELY( err ) ) return err;
    2023          39 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    2024          39 :   *total_sz += deq_fd_landed_vote_t_align() + deq_fd_landed_vote_t_footprint( votes_max );
    2025          39 :   ulong votes_sz;
    2026          39 :   if( FD_UNLIKELY( __builtin_umull_overflow( votes_len, 13, &votes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2027          39 :   err = fd_bincode_bytes_decode_footprint( votes_sz, ctx );
    2028          39 :   if( FD_UNLIKELY( err ) ) return err;
    2029          39 :   {
    2030          39 :     uchar o;
    2031          39 :     err = fd_bincode_bool_decode( &o, ctx );
    2032          39 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2033          39 :     if( o ) {
    2034           3 :       err = fd_bincode_uint64_decode_footprint( ctx );
    2035           3 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2036           3 :     }
    2037          39 :   }
    2038          39 :   err = fd_vote_authorized_voters_decode_footprint_inner( ctx, total_sz );
    2039          39 :   if( FD_UNLIKELY( err ) ) return err;
    2040          39 :   err = fd_vote_prior_voters_decode_footprint_inner( ctx, total_sz );
    2041          39 :   if( FD_UNLIKELY( err ) ) return err;
    2042          39 :   ulong epoch_credits_len;
    2043          39 :   err = fd_bincode_uint64_decode( &epoch_credits_len, ctx );
    2044          39 :   if( FD_UNLIKELY( err ) ) return err;
    2045          39 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    2046          39 :   *total_sz += deq_fd_vote_epoch_credits_t_align() + deq_fd_vote_epoch_credits_t_footprint( epoch_credits_max );
    2047          39 :   ulong epoch_credits_sz;
    2048          39 :   if( FD_UNLIKELY( __builtin_umull_overflow( epoch_credits_len, 24, &epoch_credits_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2049          39 :   err = fd_bincode_bytes_decode_footprint( epoch_credits_sz, ctx );
    2050          39 :   if( FD_UNLIKELY( err ) ) return err;
    2051          39 :   err = fd_vote_block_timestamp_decode_footprint_inner( ctx, total_sz );
    2052          39 :   if( FD_UNLIKELY( err ) ) return err;
    2053          39 :   return 0;
    2054          39 : }
    2055           0 : int fd_vote_state_v3_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2056           0 :   *total_sz += sizeof(fd_vote_state_v3_t);
    2057           0 :   void const * start_data = ctx->data;
    2058           0 :   int err = fd_vote_state_v3_decode_footprint_inner( ctx, total_sz );
    2059           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2060           0 :   ctx->data = start_data;
    2061           0 :   return err;
    2062           0 : }
    2063          27 : static void fd_vote_state_v3_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2064          27 :   fd_vote_state_v3_t * self = (fd_vote_state_v3_t *)struct_mem;
    2065          27 :   fd_pubkey_decode_inner( &self->node_pubkey, alloc_mem, ctx );
    2066          27 :   fd_pubkey_decode_inner( &self->authorized_withdrawer, alloc_mem, ctx );
    2067          27 :   fd_bincode_uint8_decode_unsafe( &self->commission, ctx );
    2068          27 :   ulong votes_len;
    2069          27 :   fd_bincode_uint64_decode_unsafe( &votes_len, ctx );
    2070          27 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    2071          27 :   self->votes = deq_fd_landed_vote_t_join_new( alloc_mem, votes_max );
    2072          27 :   for( ulong i=0; i < votes_len; i++ ) {
    2073           0 :     fd_landed_vote_t * elem = deq_fd_landed_vote_t_push_tail_nocopy( self->votes );
    2074           0 :     fd_landed_vote_new( elem );
    2075           0 :     fd_landed_vote_decode_inner( elem, alloc_mem, ctx );
    2076           0 :   }
    2077          27 :   {
    2078          27 :     uchar o;
    2079          27 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2080          27 :     self->has_root_slot = !!o;
    2081          27 :     if( o ) {
    2082           0 :       fd_bincode_uint64_decode_unsafe( &self->root_slot, ctx );
    2083           0 :     }
    2084          27 :   }
    2085          27 :   fd_vote_authorized_voters_decode_inner( &self->authorized_voters, alloc_mem, ctx );
    2086          27 :   fd_vote_prior_voters_decode_inner( &self->prior_voters, alloc_mem, ctx );
    2087          27 :   ulong epoch_credits_len;
    2088          27 :   fd_bincode_uint64_decode_unsafe( &epoch_credits_len, ctx );
    2089          27 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    2090          27 :   self->epoch_credits = deq_fd_vote_epoch_credits_t_join_new( alloc_mem, epoch_credits_max );
    2091          27 :   for( ulong i=0; i < epoch_credits_len; i++ ) {
    2092           0 :     fd_vote_epoch_credits_t * elem = deq_fd_vote_epoch_credits_t_push_tail_nocopy( self->epoch_credits );
    2093           0 :     fd_vote_epoch_credits_new( elem );
    2094           0 :     fd_vote_epoch_credits_decode_inner( elem, alloc_mem, ctx );
    2095           0 :   }
    2096          27 :   fd_vote_block_timestamp_decode_inner( &self->last_timestamp, alloc_mem, ctx );
    2097          27 : }
    2098           0 : void * fd_vote_state_v3_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2099           0 :   fd_vote_state_v3_t * self = (fd_vote_state_v3_t *)mem;
    2100           0 :   fd_vote_state_v3_new( self );
    2101           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_v3_t);
    2102           0 :   void * * alloc_mem = &alloc_region;
    2103           0 :   fd_vote_state_v3_decode_inner( mem, alloc_mem, ctx );
    2104           0 :   return self;
    2105           0 : }
    2106          54 : void fd_vote_state_v3_new(fd_vote_state_v3_t * self) {
    2107          54 :   fd_memset( self, 0, sizeof(fd_vote_state_v3_t) );
    2108          54 :   fd_pubkey_new( &self->node_pubkey );
    2109          54 :   fd_pubkey_new( &self->authorized_withdrawer );
    2110          54 :   fd_vote_authorized_voters_new( &self->authorized_voters );
    2111          54 :   fd_vote_prior_voters_new( &self->prior_voters );
    2112          54 :   fd_vote_block_timestamp_new( &self->last_timestamp );
    2113          54 : }
    2114           3 : ulong fd_vote_state_v3_size( fd_vote_state_v3_t const * self ) {
    2115           3 :   ulong size = 0;
    2116           3 :   size += fd_pubkey_size( &self->node_pubkey );
    2117           3 :   size += fd_pubkey_size( &self->authorized_withdrawer );
    2118           3 :   size += sizeof(char);
    2119           3 :   if( self->votes ) {
    2120           0 :     size += sizeof(ulong);
    2121           0 :     for( deq_fd_landed_vote_t_iter_t iter = deq_fd_landed_vote_t_iter_init( self->votes ); !deq_fd_landed_vote_t_iter_done( self->votes, iter ); iter = deq_fd_landed_vote_t_iter_next( self->votes, iter ) ) {
    2122           0 :       fd_landed_vote_t * ele = deq_fd_landed_vote_t_iter_ele( self->votes, iter );
    2123           0 :       size += fd_landed_vote_size( ele );
    2124           0 :     }
    2125           3 :   } else {
    2126           3 :     size += sizeof(ulong);
    2127           3 :   }
    2128           3 :   size += sizeof(char);
    2129           3 :   if( self->has_root_slot ) {
    2130           0 :     size += sizeof(ulong);
    2131           0 :   }
    2132           3 :   size += fd_vote_authorized_voters_size( &self->authorized_voters );
    2133           3 :   size += fd_vote_prior_voters_size( &self->prior_voters );
    2134           3 :   if( self->epoch_credits ) {
    2135           0 :     size += sizeof(ulong);
    2136           0 :     for( deq_fd_vote_epoch_credits_t_iter_t iter = deq_fd_vote_epoch_credits_t_iter_init( self->epoch_credits ); !deq_fd_vote_epoch_credits_t_iter_done( self->epoch_credits, iter ); iter = deq_fd_vote_epoch_credits_t_iter_next( self->epoch_credits, iter ) ) {
    2137           0 :       fd_vote_epoch_credits_t * ele = deq_fd_vote_epoch_credits_t_iter_ele( self->epoch_credits, iter );
    2138           0 :       size += fd_vote_epoch_credits_size( ele );
    2139           0 :     }
    2140           3 :   } else {
    2141           3 :     size += sizeof(ulong);
    2142           3 :   }
    2143           3 :   size += fd_vote_block_timestamp_size( &self->last_timestamp );
    2144           3 :   return size;
    2145           3 : }
    2146             : 
    2147           6 : int fd_vote_state_v4_encode( fd_vote_state_v4_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2148           6 :   int err;
    2149           6 :   err = fd_pubkey_encode( &self->node_pubkey, ctx );
    2150           6 :   if( FD_UNLIKELY( err ) ) return err;
    2151           6 :   err = fd_pubkey_encode( &self->authorized_withdrawer, ctx );
    2152           6 :   if( FD_UNLIKELY( err ) ) return err;
    2153           6 :   err = fd_pubkey_encode( &self->inflation_rewards_collector, ctx );
    2154           6 :   if( FD_UNLIKELY( err ) ) return err;
    2155           6 :   err = fd_pubkey_encode( &self->block_revenue_collector, ctx );
    2156           6 :   if( FD_UNLIKELY( err ) ) return err;
    2157           6 :   err = fd_bincode_uint16_encode( self->inflation_rewards_commission_bps, ctx );
    2158           6 :   if( FD_UNLIKELY( err ) ) return err;
    2159           6 :   err = fd_bincode_uint16_encode( self->block_revenue_commission_bps, ctx );
    2160           6 :   if( FD_UNLIKELY( err ) ) return err;
    2161           6 :   err = fd_bincode_uint64_encode( self->pending_delegator_rewards, ctx );
    2162           6 :   if( FD_UNLIKELY( err ) ) return err;
    2163           6 :   err = fd_bincode_bool_encode( self->has_bls_pubkey_compressed, ctx );
    2164           6 :   if( FD_UNLIKELY( err ) ) return err;
    2165           6 :   if( self->has_bls_pubkey_compressed ) {
    2166           3 :     err = fd_bls_pubkey_compressed_encode( &self->bls_pubkey_compressed, ctx );
    2167           3 :     if( FD_UNLIKELY( err ) ) return err;
    2168           3 :   }
    2169           6 :   if( self->votes ) {
    2170           3 :     ulong votes_len = deq_fd_landed_vote_t_cnt( self->votes );
    2171           3 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    2172           3 :     if( FD_UNLIKELY( err ) ) return err;
    2173          96 :     for( deq_fd_landed_vote_t_iter_t iter = deq_fd_landed_vote_t_iter_init( self->votes ); !deq_fd_landed_vote_t_iter_done( self->votes, iter ); iter = deq_fd_landed_vote_t_iter_next( self->votes, iter ) ) {
    2174          93 :       fd_landed_vote_t const * ele = deq_fd_landed_vote_t_iter_ele_const( self->votes, iter );
    2175          93 :       err = fd_landed_vote_encode( ele, ctx );
    2176          93 :       if( FD_UNLIKELY( err ) ) return err;
    2177          93 :     }
    2178           3 :   } else {
    2179           3 :     ulong votes_len = 0;
    2180           3 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    2181           3 :     if( FD_UNLIKELY( err ) ) return err;
    2182           3 :   }
    2183           6 :   err = fd_bincode_bool_encode( self->has_root_slot, ctx );
    2184           6 :   if( FD_UNLIKELY( err ) ) return err;
    2185           6 :   if( self->has_root_slot ) {
    2186           3 :     err = fd_bincode_uint64_encode( self->root_slot, ctx );
    2187           3 :     if( FD_UNLIKELY( err ) ) return err;
    2188           3 :   }
    2189           6 :   err = fd_vote_authorized_voters_encode( &self->authorized_voters, ctx );
    2190           6 :   if( FD_UNLIKELY( err ) ) return err;
    2191           6 :   if( self->epoch_credits ) {
    2192           3 :     ulong epoch_credits_len = deq_fd_vote_epoch_credits_t_cnt( self->epoch_credits );
    2193           3 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    2194           3 :     if( FD_UNLIKELY( err ) ) return err;
    2195         195 :     for( deq_fd_vote_epoch_credits_t_iter_t iter = deq_fd_vote_epoch_credits_t_iter_init( self->epoch_credits ); !deq_fd_vote_epoch_credits_t_iter_done( self->epoch_credits, iter ); iter = deq_fd_vote_epoch_credits_t_iter_next( self->epoch_credits, iter ) ) {
    2196         192 :       fd_vote_epoch_credits_t const * ele = deq_fd_vote_epoch_credits_t_iter_ele_const( self->epoch_credits, iter );
    2197         192 :       err = fd_vote_epoch_credits_encode( ele, ctx );
    2198         192 :       if( FD_UNLIKELY( err ) ) return err;
    2199         192 :     }
    2200           3 :   } else {
    2201           3 :     ulong epoch_credits_len = 0;
    2202           3 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    2203           3 :     if( FD_UNLIKELY( err ) ) return err;
    2204           3 :   }
    2205           6 :   err = fd_vote_block_timestamp_encode( &self->last_timestamp, ctx );
    2206           6 :   if( FD_UNLIKELY( err ) ) return err;
    2207           6 :   return FD_BINCODE_SUCCESS;
    2208           6 : }
    2209           3 : static int fd_vote_state_v4_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2210           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2211           3 :   int err = 0;
    2212           3 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2213           3 :   if( FD_UNLIKELY( err ) ) return err;
    2214           3 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2215           3 :   if( FD_UNLIKELY( err ) ) return err;
    2216           3 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2217           3 :   if( FD_UNLIKELY( err ) ) return err;
    2218           3 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2219           3 :   if( FD_UNLIKELY( err ) ) return err;
    2220           3 :   err = fd_bincode_uint16_decode_footprint( ctx );
    2221           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2222           3 :   err = fd_bincode_uint16_decode_footprint( ctx );
    2223           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2224           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
    2225           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2226           3 :   {
    2227           3 :     uchar o;
    2228           3 :     err = fd_bincode_bool_decode( &o, ctx );
    2229           3 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2230           3 :     if( o ) {
    2231           3 :       err = fd_bls_pubkey_compressed_decode_footprint_inner( ctx, total_sz );
    2232           3 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2233           3 :     }
    2234           3 :   }
    2235           3 :   ulong votes_len;
    2236           3 :   err = fd_bincode_uint64_decode( &votes_len, ctx );
    2237           3 :   if( FD_UNLIKELY( err ) ) return err;
    2238           3 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    2239           3 :   *total_sz += deq_fd_landed_vote_t_align() + deq_fd_landed_vote_t_footprint( votes_max );
    2240           3 :   ulong votes_sz;
    2241           3 :   if( FD_UNLIKELY( __builtin_umull_overflow( votes_len, 13, &votes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2242           3 :   err = fd_bincode_bytes_decode_footprint( votes_sz, ctx );
    2243           3 :   if( FD_UNLIKELY( err ) ) return err;
    2244           3 :   {
    2245           3 :     uchar o;
    2246           3 :     err = fd_bincode_bool_decode( &o, ctx );
    2247           3 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2248           3 :     if( o ) {
    2249           3 :       err = fd_bincode_uint64_decode_footprint( ctx );
    2250           3 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2251           3 :     }
    2252           3 :   }
    2253           3 :   err = fd_vote_authorized_voters_decode_footprint_inner( ctx, total_sz );
    2254           3 :   if( FD_UNLIKELY( err ) ) return err;
    2255           3 :   ulong epoch_credits_len;
    2256           3 :   err = fd_bincode_uint64_decode( &epoch_credits_len, ctx );
    2257           3 :   if( FD_UNLIKELY( err ) ) return err;
    2258           3 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    2259           3 :   *total_sz += deq_fd_vote_epoch_credits_t_align() + deq_fd_vote_epoch_credits_t_footprint( epoch_credits_max );
    2260           3 :   ulong epoch_credits_sz;
    2261           3 :   if( FD_UNLIKELY( __builtin_umull_overflow( epoch_credits_len, 24, &epoch_credits_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2262           3 :   err = fd_bincode_bytes_decode_footprint( epoch_credits_sz, ctx );
    2263           3 :   if( FD_UNLIKELY( err ) ) return err;
    2264           3 :   err = fd_vote_block_timestamp_decode_footprint_inner( ctx, total_sz );
    2265           3 :   if( FD_UNLIKELY( err ) ) return err;
    2266           3 :   return 0;
    2267           3 : }
    2268           0 : int fd_vote_state_v4_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2269           0 :   *total_sz += sizeof(fd_vote_state_v4_t);
    2270           0 :   void const * start_data = ctx->data;
    2271           0 :   int err = fd_vote_state_v4_decode_footprint_inner( ctx, total_sz );
    2272           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2273           0 :   ctx->data = start_data;
    2274           0 :   return err;
    2275           0 : }
    2276           0 : static void fd_vote_state_v4_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2277           0 :   fd_vote_state_v4_t * self = (fd_vote_state_v4_t *)struct_mem;
    2278           0 :   fd_pubkey_decode_inner( &self->node_pubkey, alloc_mem, ctx );
    2279           0 :   fd_pubkey_decode_inner( &self->authorized_withdrawer, alloc_mem, ctx );
    2280           0 :   fd_pubkey_decode_inner( &self->inflation_rewards_collector, alloc_mem, ctx );
    2281           0 :   fd_pubkey_decode_inner( &self->block_revenue_collector, alloc_mem, ctx );
    2282           0 :   fd_bincode_uint16_decode_unsafe( &self->inflation_rewards_commission_bps, ctx );
    2283           0 :   fd_bincode_uint16_decode_unsafe( &self->block_revenue_commission_bps, ctx );
    2284           0 :   fd_bincode_uint64_decode_unsafe( &self->pending_delegator_rewards, ctx );
    2285           0 :   {
    2286           0 :     uchar o;
    2287           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2288           0 :     self->has_bls_pubkey_compressed = !!o;
    2289           0 :     if( o ) {
    2290           0 :       fd_bls_pubkey_compressed_new( &self->bls_pubkey_compressed );
    2291           0 :       fd_bls_pubkey_compressed_decode_inner( &self->bls_pubkey_compressed, alloc_mem, ctx );
    2292           0 :     }
    2293           0 :   }
    2294           0 :   ulong votes_len;
    2295           0 :   fd_bincode_uint64_decode_unsafe( &votes_len, ctx );
    2296           0 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    2297           0 :   self->votes = deq_fd_landed_vote_t_join_new( alloc_mem, votes_max );
    2298           0 :   for( ulong i=0; i < votes_len; i++ ) {
    2299           0 :     fd_landed_vote_t * elem = deq_fd_landed_vote_t_push_tail_nocopy( self->votes );
    2300           0 :     fd_landed_vote_new( elem );
    2301           0 :     fd_landed_vote_decode_inner( elem, alloc_mem, ctx );
    2302           0 :   }
    2303           0 :   {
    2304           0 :     uchar o;
    2305           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2306           0 :     self->has_root_slot = !!o;
    2307           0 :     if( o ) {
    2308           0 :       fd_bincode_uint64_decode_unsafe( &self->root_slot, ctx );
    2309           0 :     }
    2310           0 :   }
    2311           0 :   fd_vote_authorized_voters_decode_inner( &self->authorized_voters, alloc_mem, ctx );
    2312           0 :   ulong epoch_credits_len;
    2313           0 :   fd_bincode_uint64_decode_unsafe( &epoch_credits_len, ctx );
    2314           0 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    2315           0 :   self->epoch_credits = deq_fd_vote_epoch_credits_t_join_new( alloc_mem, epoch_credits_max );
    2316           0 :   for( ulong i=0; i < epoch_credits_len; i++ ) {
    2317           0 :     fd_vote_epoch_credits_t * elem = deq_fd_vote_epoch_credits_t_push_tail_nocopy( self->epoch_credits );
    2318           0 :     fd_vote_epoch_credits_new( elem );
    2319           0 :     fd_vote_epoch_credits_decode_inner( elem, alloc_mem, ctx );
    2320           0 :   }
    2321           0 :   fd_vote_block_timestamp_decode_inner( &self->last_timestamp, alloc_mem, ctx );
    2322           0 : }
    2323           0 : void * fd_vote_state_v4_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2324           0 :   fd_vote_state_v4_t * self = (fd_vote_state_v4_t *)mem;
    2325           0 :   fd_vote_state_v4_new( self );
    2326           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_v4_t);
    2327           0 :   void * * alloc_mem = &alloc_region;
    2328           0 :   fd_vote_state_v4_decode_inner( mem, alloc_mem, ctx );
    2329           0 :   return self;
    2330           0 : }
    2331           3 : void fd_vote_state_v4_new(fd_vote_state_v4_t * self) {
    2332           3 :   fd_memset( self, 0, sizeof(fd_vote_state_v4_t) );
    2333           3 :   fd_pubkey_new( &self->node_pubkey );
    2334           3 :   fd_pubkey_new( &self->authorized_withdrawer );
    2335           3 :   fd_pubkey_new( &self->inflation_rewards_collector );
    2336           3 :   fd_pubkey_new( &self->block_revenue_collector );
    2337           3 :   fd_vote_authorized_voters_new( &self->authorized_voters );
    2338           3 :   fd_vote_block_timestamp_new( &self->last_timestamp );
    2339           3 : }
    2340           3 : ulong fd_vote_state_v4_size( fd_vote_state_v4_t const * self ) {
    2341           3 :   ulong size = 0;
    2342           3 :   size += fd_pubkey_size( &self->node_pubkey );
    2343           3 :   size += fd_pubkey_size( &self->authorized_withdrawer );
    2344           3 :   size += fd_pubkey_size( &self->inflation_rewards_collector );
    2345           3 :   size += fd_pubkey_size( &self->block_revenue_collector );
    2346           3 :   size += sizeof(ushort);
    2347           3 :   size += sizeof(ushort);
    2348           3 :   size += sizeof(ulong);
    2349           3 :   size += sizeof(char);
    2350           3 :   if( self->has_bls_pubkey_compressed ) {
    2351           0 :     size += fd_bls_pubkey_compressed_size( &self->bls_pubkey_compressed );
    2352           0 :   }
    2353           3 :   if( self->votes ) {
    2354           0 :     size += sizeof(ulong);
    2355           0 :     for( deq_fd_landed_vote_t_iter_t iter = deq_fd_landed_vote_t_iter_init( self->votes ); !deq_fd_landed_vote_t_iter_done( self->votes, iter ); iter = deq_fd_landed_vote_t_iter_next( self->votes, iter ) ) {
    2356           0 :       fd_landed_vote_t * ele = deq_fd_landed_vote_t_iter_ele( self->votes, iter );
    2357           0 :       size += fd_landed_vote_size( ele );
    2358           0 :     }
    2359           3 :   } else {
    2360           3 :     size += sizeof(ulong);
    2361           3 :   }
    2362           3 :   size += sizeof(char);
    2363           3 :   if( self->has_root_slot ) {
    2364           0 :     size += sizeof(ulong);
    2365           0 :   }
    2366           3 :   size += fd_vote_authorized_voters_size( &self->authorized_voters );
    2367           3 :   if( self->epoch_credits ) {
    2368           0 :     size += sizeof(ulong);
    2369           0 :     for( deq_fd_vote_epoch_credits_t_iter_t iter = deq_fd_vote_epoch_credits_t_iter_init( self->epoch_credits ); !deq_fd_vote_epoch_credits_t_iter_done( self->epoch_credits, iter ); iter = deq_fd_vote_epoch_credits_t_iter_next( self->epoch_credits, iter ) ) {
    2370           0 :       fd_vote_epoch_credits_t * ele = deq_fd_vote_epoch_credits_t_iter_ele( self->epoch_credits, iter );
    2371           0 :       size += fd_vote_epoch_credits_size( ele );
    2372           0 :     }
    2373           3 :   } else {
    2374           3 :     size += sizeof(ulong);
    2375           3 :   }
    2376           3 :   size += fd_vote_block_timestamp_size( &self->last_timestamp );
    2377           3 :   return size;
    2378           3 : }
    2379             : 
    2380           0 : FD_FN_PURE uchar fd_vote_state_versioned_is_uninitialized(fd_vote_state_versioned_t const * self) {
    2381           0 :   return self->discriminant == 0;
    2382           0 : }
    2383           0 : FD_FN_PURE uchar fd_vote_state_versioned_is_v1_14_11(fd_vote_state_versioned_t const * self) {
    2384           0 :   return self->discriminant == 1;
    2385           0 : }
    2386           0 : FD_FN_PURE uchar fd_vote_state_versioned_is_v3(fd_vote_state_versioned_t const * self) {
    2387           0 :   return self->discriminant == 2;
    2388           0 : }
    2389           0 : FD_FN_PURE uchar fd_vote_state_versioned_is_v4(fd_vote_state_versioned_t const * self) {
    2390           0 :   return self->discriminant == 3;
    2391           0 : }
    2392             : void fd_vote_state_versioned_inner_new( fd_vote_state_versioned_inner_t * self, uint discriminant );
    2393          54 : int fd_vote_state_versioned_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2394          54 :   int err;
    2395          54 :   switch (discriminant) {
    2396           9 :   case 0: {
    2397           9 :     return FD_BINCODE_SUCCESS;
    2398           0 :   }
    2399           3 :   case 1: {
    2400           3 :     err = fd_vote_state_1_14_11_decode_footprint_inner( ctx, total_sz );
    2401           3 :     if( FD_UNLIKELY( err ) ) return err;
    2402           3 :     return FD_BINCODE_SUCCESS;
    2403           3 :   }
    2404          39 :   case 2: {
    2405          39 :     err = fd_vote_state_v3_decode_footprint_inner( ctx, total_sz );
    2406          39 :     if( FD_UNLIKELY( err ) ) return err;
    2407          39 :     return FD_BINCODE_SUCCESS;
    2408          39 :   }
    2409           3 :   case 3: {
    2410           3 :     err = fd_vote_state_v4_decode_footprint_inner( ctx, total_sz );
    2411           3 :     if( FD_UNLIKELY( err ) ) return err;
    2412           3 :     return FD_BINCODE_SUCCESS;
    2413           3 :   }
    2414           0 :   default: return FD_BINCODE_ERR_ENCODING;
    2415          54 :   }
    2416          54 : }
    2417          54 : static int fd_vote_state_versioned_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2418          54 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2419          54 :   uint discriminant = 0;
    2420          54 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    2421          54 :   if( FD_UNLIKELY( err ) ) return err;
    2422          54 :   return fd_vote_state_versioned_inner_decode_footprint( discriminant, ctx, total_sz );
    2423          54 : }
    2424          18 : int fd_vote_state_versioned_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2425          18 :   *total_sz += sizeof(fd_vote_state_versioned_t);
    2426          18 :   void const * start_data = ctx->data;
    2427          18 :   int err =  fd_vote_state_versioned_decode_footprint_inner( ctx, total_sz );
    2428          18 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2429          18 :   ctx->data = start_data;
    2430          18 :   return err;
    2431          18 : }
    2432          36 : int fd_vote_state_versioned_seek_end( fd_bincode_decode_ctx_t * ctx ) {
    2433          36 :   ulong total_sz;
    2434          36 :   int err = fd_vote_state_versioned_decode_footprint_inner( ctx, &total_sz );
    2435          36 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2436          36 :   return err;
    2437          36 : }
    2438          33 : static void fd_vote_state_versioned_inner_decode_inner( fd_vote_state_versioned_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    2439          33 :   switch (discriminant) {
    2440           6 :   case 0: {
    2441           6 :     break;
    2442           0 :   }
    2443           0 :   case 1: {
    2444           0 :     fd_vote_state_1_14_11_decode_inner( &self->v1_14_11, alloc_mem, ctx );
    2445           0 :     break;
    2446           0 :   }
    2447          27 :   case 2: {
    2448          27 :     fd_vote_state_v3_decode_inner( &self->v3, alloc_mem, ctx );
    2449          27 :     break;
    2450           0 :   }
    2451           0 :   case 3: {
    2452           0 :     fd_vote_state_v4_decode_inner( &self->v4, alloc_mem, ctx );
    2453           0 :     break;
    2454           0 :   }
    2455          33 :   }
    2456          33 : }
    2457          33 : static void fd_vote_state_versioned_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2458          33 :   fd_vote_state_versioned_t * self = (fd_vote_state_versioned_t *)struct_mem;
    2459          33 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    2460          33 :   fd_vote_state_versioned_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    2461          33 : }
    2462          33 : void * fd_vote_state_versioned_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2463          33 :   fd_vote_state_versioned_t * self = (fd_vote_state_versioned_t *)mem;
    2464          33 :   fd_vote_state_versioned_new( self );
    2465          33 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_versioned_t);
    2466          33 :   void * * alloc_mem = &alloc_region;
    2467          33 :   fd_vote_state_versioned_decode_inner( mem, alloc_mem, ctx );
    2468          33 :   return self;
    2469          33 : }
    2470         102 : void fd_vote_state_versioned_inner_new( fd_vote_state_versioned_inner_t * self, uint discriminant ) {
    2471         102 :   switch( discriminant ) {
    2472           3 :   case 0: {
    2473           3 :     break;
    2474           0 :   }
    2475           3 :   case 1: {
    2476           3 :     fd_vote_state_1_14_11_new( &self->v1_14_11 );
    2477           3 :     break;
    2478           0 :   }
    2479          54 :   case 2: {
    2480          54 :     fd_vote_state_v3_new( &self->v3 );
    2481          54 :     break;
    2482           0 :   }
    2483           3 :   case 3: {
    2484           3 :     fd_vote_state_v4_new( &self->v4 );
    2485           3 :     break;
    2486           0 :   }
    2487          39 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    2488         102 :   }
    2489         102 : }
    2490         102 : void fd_vote_state_versioned_new_disc( fd_vote_state_versioned_t * self, uint discriminant ) {
    2491         102 :   self->discriminant = discriminant;
    2492         102 :   fd_vote_state_versioned_inner_new( &self->inner, self->discriminant );
    2493         102 : }
    2494          39 : void fd_vote_state_versioned_new( fd_vote_state_versioned_t * self ) {
    2495          39 :   fd_memset( self, 0, sizeof(fd_vote_state_versioned_t) );
    2496          39 :   fd_vote_state_versioned_new_disc( self, UINT_MAX );
    2497          39 : }
    2498             : 
    2499           6 : ulong fd_vote_state_versioned_size( fd_vote_state_versioned_t const * self ) {
    2500           6 :   ulong size = 0;
    2501           6 :   size += sizeof(uint);
    2502           6 :   switch (self->discriminant) {
    2503           0 :   case 1: {
    2504           0 :     size += fd_vote_state_1_14_11_size( &self->inner.v1_14_11 );
    2505           0 :     break;
    2506           0 :   }
    2507           3 :   case 2: {
    2508           3 :     size += fd_vote_state_v3_size( &self->inner.v3 );
    2509           3 :     break;
    2510           0 :   }
    2511           3 :   case 3: {
    2512           3 :     size += fd_vote_state_v4_size( &self->inner.v4 );
    2513           3 :     break;
    2514           0 :   }
    2515           6 :   }
    2516           6 :   return size;
    2517           6 : }
    2518             : 
    2519          69 : int fd_vote_state_versioned_inner_encode( fd_vote_state_versioned_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    2520          69 :   int err;
    2521          69 :   switch (discriminant) {
    2522           3 :   case 1: {
    2523           3 :     err = fd_vote_state_1_14_11_encode( &self->v1_14_11, ctx );
    2524           3 :     if( FD_UNLIKELY( err ) ) return err;
    2525           3 :     break;
    2526           3 :   }
    2527          57 :   case 2: {
    2528          57 :     err = fd_vote_state_v3_encode( &self->v3, ctx );
    2529          57 :     if( FD_UNLIKELY( err ) ) return err;
    2530          57 :     break;
    2531          57 :   }
    2532          57 :   case 3: {
    2533           6 :     err = fd_vote_state_v4_encode( &self->v4, ctx );
    2534           6 :     if( FD_UNLIKELY( err ) ) return err;
    2535           6 :     break;
    2536           6 :   }
    2537          69 :   }
    2538          69 :   return FD_BINCODE_SUCCESS;
    2539          69 : }
    2540          69 : int fd_vote_state_versioned_encode( fd_vote_state_versioned_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2541          69 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    2542          69 :   if( FD_UNLIKELY( err ) ) return err;
    2543          69 :   return fd_vote_state_versioned_inner_encode( &self->inner, self->discriminant, ctx );
    2544          69 : }
    2545             : 
    2546           0 : int fd_vote_state_update_encode( fd_vote_state_update_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2547           0 :   int err;
    2548           0 :   if( self->lockouts ) {
    2549           0 :     ulong lockouts_len = deq_fd_vote_lockout_t_cnt( self->lockouts );
    2550           0 :     err = fd_bincode_uint64_encode( lockouts_len, ctx );
    2551           0 :     if( FD_UNLIKELY( err ) ) return err;
    2552           0 :     for( deq_fd_vote_lockout_t_iter_t iter = deq_fd_vote_lockout_t_iter_init( self->lockouts ); !deq_fd_vote_lockout_t_iter_done( self->lockouts, iter ); iter = deq_fd_vote_lockout_t_iter_next( self->lockouts, iter ) ) {
    2553           0 :       fd_vote_lockout_t const * ele = deq_fd_vote_lockout_t_iter_ele_const( self->lockouts, iter );
    2554           0 :       err = fd_vote_lockout_encode( ele, ctx );
    2555           0 :       if( FD_UNLIKELY( err ) ) return err;
    2556           0 :     }
    2557           0 :   } else {
    2558           0 :     ulong lockouts_len = 0;
    2559           0 :     err = fd_bincode_uint64_encode( lockouts_len, ctx );
    2560           0 :     if( FD_UNLIKELY( err ) ) return err;
    2561           0 :   }
    2562           0 :   err = fd_bincode_bool_encode( self->has_root, ctx );
    2563           0 :   if( FD_UNLIKELY( err ) ) return err;
    2564           0 :   if( self->has_root ) {
    2565           0 :     err = fd_bincode_uint64_encode( self->root, ctx );
    2566           0 :     if( FD_UNLIKELY( err ) ) return err;
    2567           0 :   }
    2568           0 :   err = fd_hash_encode( &self->hash, ctx );
    2569           0 :   if( FD_UNLIKELY( err ) ) return err;
    2570           0 :   err = fd_bincode_bool_encode( self->has_timestamp, ctx );
    2571           0 :   if( FD_UNLIKELY( err ) ) return err;
    2572           0 :   if( self->has_timestamp ) {
    2573           0 :     err = fd_bincode_int64_encode( self->timestamp, ctx );
    2574           0 :     if( FD_UNLIKELY( err ) ) return err;
    2575           0 :   }
    2576           0 :   return FD_BINCODE_SUCCESS;
    2577           0 : }
    2578           0 : static int fd_vote_state_update_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2579           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2580           0 :   int err = 0;
    2581           0 :   ulong lockouts_len;
    2582           0 :   err = fd_bincode_uint64_decode( &lockouts_len, ctx );
    2583           0 :   if( FD_UNLIKELY( err ) ) return err;
    2584           0 :   ulong lockouts_max = fd_ulong_max( lockouts_len, 32 );
    2585           0 :   *total_sz += deq_fd_vote_lockout_t_align() + deq_fd_vote_lockout_t_footprint( lockouts_max );
    2586           0 :   ulong lockouts_sz;
    2587           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( lockouts_len, 12, &lockouts_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2588           0 :   err = fd_bincode_bytes_decode_footprint( lockouts_sz, ctx );
    2589           0 :   if( FD_UNLIKELY( err ) ) return err;
    2590           0 :   {
    2591           0 :     uchar o;
    2592           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2593           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2594           0 :     if( o ) {
    2595           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
    2596           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2597           0 :     }
    2598           0 :   }
    2599           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2600           0 :   if( FD_UNLIKELY( err ) ) return err;
    2601           0 :   {
    2602           0 :     uchar o;
    2603           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2604           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2605           0 :     if( o ) {
    2606           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    2607           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2608           0 :     }
    2609           0 :   }
    2610           0 :   return 0;
    2611           0 : }
    2612           0 : int fd_vote_state_update_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2613           0 :   *total_sz += sizeof(fd_vote_state_update_t);
    2614           0 :   void const * start_data = ctx->data;
    2615           0 :   int err = fd_vote_state_update_decode_footprint_inner( ctx, total_sz );
    2616           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2617           0 :   ctx->data = start_data;
    2618           0 :   return err;
    2619           0 : }
    2620           0 : static void fd_vote_state_update_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2621           0 :   fd_vote_state_update_t * self = (fd_vote_state_update_t *)struct_mem;
    2622           0 :   ulong lockouts_len;
    2623           0 :   fd_bincode_uint64_decode_unsafe( &lockouts_len, ctx );
    2624           0 :   ulong lockouts_max = fd_ulong_max( lockouts_len, 32 );
    2625           0 :   self->lockouts = deq_fd_vote_lockout_t_join_new( alloc_mem, lockouts_max );
    2626           0 :   for( ulong i=0; i < lockouts_len; i++ ) {
    2627           0 :     fd_vote_lockout_t * elem = deq_fd_vote_lockout_t_push_tail_nocopy( self->lockouts );
    2628           0 :     fd_vote_lockout_new( elem );
    2629           0 :     fd_vote_lockout_decode_inner( elem, alloc_mem, ctx );
    2630           0 :   }
    2631           0 :   {
    2632           0 :     uchar o;
    2633           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2634           0 :     self->has_root = !!o;
    2635           0 :     if( o ) {
    2636           0 :       fd_bincode_uint64_decode_unsafe( &self->root, ctx );
    2637           0 :     }
    2638           0 :   }
    2639           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    2640           0 :   {
    2641           0 :     uchar o;
    2642           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2643           0 :     self->has_timestamp = !!o;
    2644           0 :     if( o ) {
    2645           0 :       fd_bincode_int64_decode_unsafe( &self->timestamp, ctx );
    2646           0 :     }
    2647           0 :   }
    2648           0 : }
    2649           0 : void * fd_vote_state_update_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2650           0 :   fd_vote_state_update_t * self = (fd_vote_state_update_t *)mem;
    2651           0 :   fd_vote_state_update_new( self );
    2652           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_update_t);
    2653           0 :   void * * alloc_mem = &alloc_region;
    2654           0 :   fd_vote_state_update_decode_inner( mem, alloc_mem, ctx );
    2655           0 :   return self;
    2656           0 : }
    2657           0 : void fd_vote_state_update_new(fd_vote_state_update_t * self) {
    2658           0 :   fd_memset( self, 0, sizeof(fd_vote_state_update_t) );
    2659           0 :   fd_hash_new( &self->hash );
    2660           0 : }
    2661           0 : ulong fd_vote_state_update_size( fd_vote_state_update_t const * self ) {
    2662           0 :   ulong size = 0;
    2663           0 :   if( self->lockouts ) {
    2664           0 :     size += sizeof(ulong);
    2665           0 :     for( deq_fd_vote_lockout_t_iter_t iter = deq_fd_vote_lockout_t_iter_init( self->lockouts ); !deq_fd_vote_lockout_t_iter_done( self->lockouts, iter ); iter = deq_fd_vote_lockout_t_iter_next( self->lockouts, iter ) ) {
    2666           0 :       fd_vote_lockout_t * ele = deq_fd_vote_lockout_t_iter_ele( self->lockouts, iter );
    2667           0 :       size += fd_vote_lockout_size( ele );
    2668           0 :     }
    2669           0 :   } else {
    2670           0 :     size += sizeof(ulong);
    2671           0 :   }
    2672           0 :   size += sizeof(char);
    2673           0 :   if( self->has_root ) {
    2674           0 :     size += sizeof(ulong);
    2675           0 :   }
    2676           0 :   size += fd_hash_size( &self->hash );
    2677           0 :   size += sizeof(char);
    2678           0 :   if( self->has_timestamp ) {
    2679           0 :     size += sizeof(long);
    2680           0 :   }
    2681           0 :   return size;
    2682           0 : }
    2683             : 
    2684           0 : int fd_compact_vote_state_update_encode( fd_compact_vote_state_update_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2685           0 :   int err;
    2686           0 :   err = fd_bincode_uint64_encode( self->root, ctx );
    2687           0 :   if( FD_UNLIKELY( err ) ) return err;
    2688           0 :   err = fd_bincode_compact_u16_encode( &self->lockouts_len, ctx );
    2689           0 :   if( FD_UNLIKELY(err) ) return err;
    2690           0 :   if( self->lockouts_len ) {
    2691           0 :     for( ulong i=0; i < self->lockouts_len; i++ ) {
    2692           0 :       err = fd_lockout_offset_encode( self->lockouts + i, ctx );
    2693           0 :       if( FD_UNLIKELY( err ) ) return err;
    2694           0 :     }
    2695           0 :   }
    2696           0 :   err = fd_hash_encode( &self->hash, ctx );
    2697           0 :   if( FD_UNLIKELY( err ) ) return err;
    2698           0 :   err = fd_bincode_bool_encode( self->has_timestamp, ctx );
    2699           0 :   if( FD_UNLIKELY( err ) ) return err;
    2700           0 :   if( self->has_timestamp ) {
    2701           0 :     err = fd_bincode_int64_encode( self->timestamp, ctx );
    2702           0 :     if( FD_UNLIKELY( err ) ) return err;
    2703           0 :   }
    2704           0 :   return FD_BINCODE_SUCCESS;
    2705           0 : }
    2706           0 : static int fd_compact_vote_state_update_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2707           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2708           0 :   int err = 0;
    2709           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    2710           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2711           0 :   ushort lockouts_len;
    2712           0 :   err = fd_bincode_compact_u16_decode( &lockouts_len, ctx );
    2713           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2714           0 :   if( lockouts_len ) {
    2715           0 :     *total_sz += FD_LOCKOUT_OFFSET_ALIGN + sizeof(fd_lockout_offset_t)*lockouts_len;
    2716           0 :     for( ulong i=0; i < lockouts_len; i++ ) {
    2717           0 :       err = fd_lockout_offset_decode_footprint_inner( ctx, total_sz );
    2718           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2719           0 :     }
    2720           0 :   }
    2721           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2722           0 :   if( FD_UNLIKELY( err ) ) return err;
    2723           0 :   {
    2724           0 :     uchar o;
    2725           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2726           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2727           0 :     if( o ) {
    2728           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    2729           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2730           0 :     }
    2731           0 :   }
    2732           0 :   return 0;
    2733           0 : }
    2734           0 : int fd_compact_vote_state_update_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2735           0 :   *total_sz += sizeof(fd_compact_vote_state_update_t);
    2736           0 :   void const * start_data = ctx->data;
    2737           0 :   int err = fd_compact_vote_state_update_decode_footprint_inner( ctx, total_sz );
    2738           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2739           0 :   ctx->data = start_data;
    2740           0 :   return err;
    2741           0 : }
    2742           0 : static void fd_compact_vote_state_update_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2743           0 :   fd_compact_vote_state_update_t * self = (fd_compact_vote_state_update_t *)struct_mem;
    2744           0 :   fd_bincode_uint64_decode_unsafe( &self->root, ctx );
    2745           0 :   fd_bincode_compact_u16_decode_unsafe( &self->lockouts_len, ctx );
    2746           0 :   if( self->lockouts_len ) {
    2747           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_LOCKOUT_OFFSET_ALIGN );
    2748           0 :     self->lockouts = *alloc_mem;
    2749           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_lockout_offset_t)*self->lockouts_len;
    2750           0 :     for( ulong i=0; i < self->lockouts_len; i++ ) {
    2751           0 :       fd_lockout_offset_new( self->lockouts + i );
    2752           0 :       fd_lockout_offset_decode_inner( self->lockouts + i, alloc_mem, ctx );
    2753           0 :     }
    2754           0 :   } else
    2755           0 :     self->lockouts = NULL;
    2756           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    2757           0 :   {
    2758           0 :     uchar o;
    2759           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2760           0 :     self->has_timestamp = !!o;
    2761           0 :     if( o ) {
    2762           0 :       fd_bincode_int64_decode_unsafe( &self->timestamp, ctx );
    2763           0 :     }
    2764           0 :   }
    2765           0 : }
    2766           0 : void * fd_compact_vote_state_update_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2767           0 :   fd_compact_vote_state_update_t * self = (fd_compact_vote_state_update_t *)mem;
    2768           0 :   fd_compact_vote_state_update_new( self );
    2769           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_compact_vote_state_update_t);
    2770           0 :   void * * alloc_mem = &alloc_region;
    2771           0 :   fd_compact_vote_state_update_decode_inner( mem, alloc_mem, ctx );
    2772           0 :   return self;
    2773           0 : }
    2774           0 : void fd_compact_vote_state_update_new(fd_compact_vote_state_update_t * self) {
    2775           0 :   fd_memset( self, 0, sizeof(fd_compact_vote_state_update_t) );
    2776           0 :   fd_hash_new( &self->hash );
    2777           0 : }
    2778           0 : ulong fd_compact_vote_state_update_size( fd_compact_vote_state_update_t const * self ) {
    2779           0 :   ulong size = 0;
    2780           0 :   size += sizeof(ulong);
    2781           0 :   do {
    2782           0 :     ushort tmp = (ushort)self->lockouts_len;
    2783           0 :     size += fd_bincode_compact_u16_size( &tmp );
    2784           0 :     for( ulong i=0; i < self->lockouts_len; i++ )
    2785           0 :       size += fd_lockout_offset_size( self->lockouts + i );
    2786           0 :   } while(0);
    2787           0 :   size += fd_hash_size( &self->hash );
    2788           0 :   size += sizeof(char);
    2789           0 :   if( self->has_timestamp ) {
    2790           0 :     size += sizeof(long);
    2791           0 :   }
    2792           0 :   return size;
    2793           0 : }
    2794             : 
    2795           0 : int fd_compact_vote_state_update_switch_encode( fd_compact_vote_state_update_switch_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2796           0 :   int err;
    2797           0 :   err = fd_compact_vote_state_update_encode( &self->compact_vote_state_update, ctx );
    2798           0 :   if( FD_UNLIKELY( err ) ) return err;
    2799           0 :   err = fd_hash_encode( &self->hash, ctx );
    2800           0 :   if( FD_UNLIKELY( err ) ) return err;
    2801           0 :   return FD_BINCODE_SUCCESS;
    2802           0 : }
    2803           0 : static int fd_compact_vote_state_update_switch_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2804           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2805           0 :   int err = 0;
    2806           0 :   err = fd_compact_vote_state_update_decode_footprint_inner( ctx, total_sz );
    2807           0 :   if( FD_UNLIKELY( err ) ) return err;
    2808           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2809           0 :   if( FD_UNLIKELY( err ) ) return err;
    2810           0 :   return 0;
    2811           0 : }
    2812           0 : int fd_compact_vote_state_update_switch_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2813           0 :   *total_sz += sizeof(fd_compact_vote_state_update_switch_t);
    2814           0 :   void const * start_data = ctx->data;
    2815           0 :   int err = fd_compact_vote_state_update_switch_decode_footprint_inner( ctx, total_sz );
    2816           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2817           0 :   ctx->data = start_data;
    2818           0 :   return err;
    2819           0 : }
    2820           0 : static void fd_compact_vote_state_update_switch_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2821           0 :   fd_compact_vote_state_update_switch_t * self = (fd_compact_vote_state_update_switch_t *)struct_mem;
    2822           0 :   fd_compact_vote_state_update_decode_inner( &self->compact_vote_state_update, alloc_mem, ctx );
    2823           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    2824           0 : }
    2825           0 : void * fd_compact_vote_state_update_switch_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2826           0 :   fd_compact_vote_state_update_switch_t * self = (fd_compact_vote_state_update_switch_t *)mem;
    2827           0 :   fd_compact_vote_state_update_switch_new( self );
    2828           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_compact_vote_state_update_switch_t);
    2829           0 :   void * * alloc_mem = &alloc_region;
    2830           0 :   fd_compact_vote_state_update_switch_decode_inner( mem, alloc_mem, ctx );
    2831           0 :   return self;
    2832           0 : }
    2833           0 : void fd_compact_vote_state_update_switch_new(fd_compact_vote_state_update_switch_t * self) {
    2834           0 :   fd_memset( self, 0, sizeof(fd_compact_vote_state_update_switch_t) );
    2835           0 :   fd_compact_vote_state_update_new( &self->compact_vote_state_update );
    2836           0 :   fd_hash_new( &self->hash );
    2837           0 : }
    2838           0 : ulong fd_compact_vote_state_update_switch_size( fd_compact_vote_state_update_switch_t const * self ) {
    2839           0 :   ulong size = 0;
    2840           0 :   size += fd_compact_vote_state_update_size( &self->compact_vote_state_update );
    2841           0 :   size += fd_hash_size( &self->hash );
    2842           0 :   return size;
    2843           0 : }
    2844             : 
    2845           0 : int fd_compact_tower_sync_encode( fd_compact_tower_sync_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2846           0 :   int err;
    2847           0 :   err = fd_bincode_uint64_encode( self->root, ctx );
    2848           0 :   if( FD_UNLIKELY( err ) ) return err;
    2849           0 :   if( self->lockout_offsets ) {
    2850           0 :     ushort lockout_offsets_len = (ushort)deq_fd_lockout_offset_t_cnt( self->lockout_offsets );
    2851           0 :     err = fd_bincode_compact_u16_encode( &lockout_offsets_len, ctx );
    2852           0 :     if( FD_UNLIKELY( err ) ) return err;
    2853           0 :     for( deq_fd_lockout_offset_t_iter_t iter = deq_fd_lockout_offset_t_iter_init( self->lockout_offsets ); !deq_fd_lockout_offset_t_iter_done( self->lockout_offsets, iter ); iter = deq_fd_lockout_offset_t_iter_next( self->lockout_offsets, iter ) ) {
    2854           0 :       fd_lockout_offset_t const * ele = deq_fd_lockout_offset_t_iter_ele_const( self->lockout_offsets, iter );
    2855           0 :       err = fd_lockout_offset_encode( ele, ctx );
    2856           0 :       if( FD_UNLIKELY( err ) ) return err;
    2857           0 :     }
    2858           0 :   } else {
    2859           0 :     ushort lockout_offsets_len = 0;
    2860           0 :     err = fd_bincode_compact_u16_encode( &lockout_offsets_len, ctx );
    2861           0 :     if( FD_UNLIKELY( err ) ) return err;
    2862           0 :   }
    2863           0 :   err = fd_hash_encode( &self->hash, ctx );
    2864           0 :   if( FD_UNLIKELY( err ) ) return err;
    2865           0 :   err = fd_bincode_bool_encode( self->has_timestamp, ctx );
    2866           0 :   if( FD_UNLIKELY( err ) ) return err;
    2867           0 :   if( self->has_timestamp ) {
    2868           0 :     err = fd_bincode_int64_encode( self->timestamp, ctx );
    2869           0 :     if( FD_UNLIKELY( err ) ) return err;
    2870           0 :   }
    2871           0 :   err = fd_hash_encode( &self->block_id, ctx );
    2872           0 :   if( FD_UNLIKELY( err ) ) return err;
    2873           0 :   return FD_BINCODE_SUCCESS;
    2874           0 : }
    2875           0 : static int fd_compact_tower_sync_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2876           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2877           0 :   int err = 0;
    2878           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    2879           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2880           0 :   ushort lockout_offsets_len;
    2881           0 :   err = fd_bincode_compact_u16_decode( &lockout_offsets_len, ctx );
    2882           0 :   if( FD_UNLIKELY( err ) ) return err;
    2883           0 :   ulong lockout_offsets_max = fd_ulong_max( lockout_offsets_len, 32 );
    2884           0 :   *total_sz += deq_fd_lockout_offset_t_align() + deq_fd_lockout_offset_t_footprint( lockout_offsets_max );
    2885           0 :   for( ulong i = 0; i < lockout_offsets_len; ++i ) {
    2886           0 :     err = fd_lockout_offset_decode_footprint_inner( ctx, total_sz );
    2887           0 :     if( FD_UNLIKELY( err ) ) return err;
    2888           0 :   }
    2889           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2890           0 :   if( FD_UNLIKELY( err ) ) return err;
    2891           0 :   {
    2892           0 :     uchar o;
    2893           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2894           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2895           0 :     if( o ) {
    2896           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    2897           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2898           0 :     }
    2899           0 :   }
    2900           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2901           0 :   if( FD_UNLIKELY( err ) ) return err;
    2902           0 :   return 0;
    2903           0 : }
    2904           0 : int fd_compact_tower_sync_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2905           0 :   *total_sz += sizeof(fd_compact_tower_sync_t);
    2906           0 :   void const * start_data = ctx->data;
    2907           0 :   int err = fd_compact_tower_sync_decode_footprint_inner( ctx, total_sz );
    2908           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2909           0 :   ctx->data = start_data;
    2910           0 :   return err;
    2911           0 : }
    2912           0 : static void fd_compact_tower_sync_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2913           0 :   fd_compact_tower_sync_t * self = (fd_compact_tower_sync_t *)struct_mem;
    2914           0 :   fd_bincode_uint64_decode_unsafe( &self->root, ctx );
    2915           0 :   ushort lockout_offsets_len;
    2916           0 :   fd_bincode_compact_u16_decode_unsafe( &lockout_offsets_len, ctx );
    2917           0 :   ulong lockout_offsets_max = fd_ulong_max( lockout_offsets_len, 32 );
    2918           0 :   self->lockout_offsets = deq_fd_lockout_offset_t_join_new( alloc_mem, lockout_offsets_max );
    2919           0 :   for( ulong i=0; i < lockout_offsets_len; i++ ) {
    2920           0 :     fd_lockout_offset_t * elem = deq_fd_lockout_offset_t_push_tail_nocopy( self->lockout_offsets );
    2921           0 :     fd_lockout_offset_new( elem );
    2922           0 :     fd_lockout_offset_decode_inner( elem, alloc_mem, ctx );
    2923           0 :   }
    2924           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    2925           0 :   {
    2926           0 :     uchar o;
    2927           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2928           0 :     self->has_timestamp = !!o;
    2929           0 :     if( o ) {
    2930           0 :       fd_bincode_int64_decode_unsafe( &self->timestamp, ctx );
    2931           0 :     }
    2932           0 :   }
    2933           0 :   fd_hash_decode_inner( &self->block_id, alloc_mem, ctx );
    2934           0 : }
    2935           0 : void * fd_compact_tower_sync_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2936           0 :   fd_compact_tower_sync_t * self = (fd_compact_tower_sync_t *)mem;
    2937           0 :   fd_compact_tower_sync_new( self );
    2938           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_compact_tower_sync_t);
    2939           0 :   void * * alloc_mem = &alloc_region;
    2940           0 :   fd_compact_tower_sync_decode_inner( mem, alloc_mem, ctx );
    2941           0 :   return self;
    2942           0 : }
    2943           0 : void fd_compact_tower_sync_new(fd_compact_tower_sync_t * self) {
    2944           0 :   fd_memset( self, 0, sizeof(fd_compact_tower_sync_t) );
    2945           0 :   fd_hash_new( &self->hash );
    2946           0 :   fd_hash_new( &self->block_id );
    2947           0 : }
    2948           0 : ulong fd_compact_tower_sync_size( fd_compact_tower_sync_t const * self ) {
    2949           0 :   ulong size = 0;
    2950           0 :   size += sizeof(ulong);
    2951           0 :   if( self->lockout_offsets ) {
    2952           0 :     ushort lockout_offsets_len = (ushort)deq_fd_lockout_offset_t_cnt( self->lockout_offsets );
    2953           0 :     size += fd_bincode_compact_u16_size( &lockout_offsets_len );
    2954           0 :     for( deq_fd_lockout_offset_t_iter_t iter = deq_fd_lockout_offset_t_iter_init( self->lockout_offsets ); !deq_fd_lockout_offset_t_iter_done( self->lockout_offsets, iter ); iter = deq_fd_lockout_offset_t_iter_next( self->lockout_offsets, iter ) ) {
    2955           0 :       fd_lockout_offset_t * ele = deq_fd_lockout_offset_t_iter_ele( self->lockout_offsets, iter );
    2956           0 :       size += fd_lockout_offset_size( ele );
    2957           0 :     }
    2958           0 :   } else {
    2959           0 :     size += 1;
    2960           0 :   }
    2961           0 :   size += fd_hash_size( &self->hash );
    2962           0 :   size += sizeof(char);
    2963           0 :   if( self->has_timestamp ) {
    2964           0 :     size += sizeof(long);
    2965           0 :   }
    2966           0 :   size += fd_hash_size( &self->block_id );
    2967           0 :   return size;
    2968           0 : }
    2969             : 
    2970           0 : void fd_tower_sync_new(fd_tower_sync_t * self) {
    2971           0 :   fd_memset( self, 0, sizeof(fd_tower_sync_t) );
    2972           0 :   fd_hash_new( &self->hash );
    2973           0 :   fd_hash_new( &self->block_id );
    2974           0 : }
    2975           0 : ulong fd_tower_sync_size( fd_tower_sync_t const * self ) {
    2976           0 :   ulong size = 0;
    2977           0 :   if( self->lockouts ) {
    2978           0 :     size += sizeof(ulong);
    2979           0 :     for( deq_fd_vote_lockout_t_iter_t iter = deq_fd_vote_lockout_t_iter_init( self->lockouts ); !deq_fd_vote_lockout_t_iter_done( self->lockouts, iter ); iter = deq_fd_vote_lockout_t_iter_next( self->lockouts, iter ) ) {
    2980           0 :       fd_vote_lockout_t * ele = deq_fd_vote_lockout_t_iter_ele( self->lockouts, iter );
    2981           0 :       size += fd_vote_lockout_size( ele );
    2982           0 :     }
    2983           0 :   } else {
    2984           0 :     size += sizeof(ulong);
    2985           0 :   }
    2986           0 :   size += sizeof(ulong);
    2987           0 :   size += sizeof(char);
    2988           0 :   if( self->has_root ) {
    2989           0 :     size += sizeof(ulong);
    2990           0 :   }
    2991           0 :   size += fd_hash_size( &self->hash );
    2992           0 :   size += sizeof(char);
    2993           0 :   if( self->has_timestamp ) {
    2994           0 :     size += sizeof(long);
    2995           0 :   }
    2996           0 :   size += fd_hash_size( &self->block_id );
    2997           0 :   return size;
    2998           0 : }
    2999             : 
    3000           0 : int fd_tower_sync_switch_encode( fd_tower_sync_switch_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3001           0 :   int err;
    3002           0 :   err = fd_tower_sync_encode( &self->tower_sync, ctx );
    3003           0 :   if( FD_UNLIKELY( err ) ) return err;
    3004           0 :   err = fd_hash_encode( &self->hash, ctx );
    3005           0 :   if( FD_UNLIKELY( err ) ) return err;
    3006           0 :   return FD_BINCODE_SUCCESS;
    3007           0 : }
    3008           0 : static int fd_tower_sync_switch_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3009           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3010           0 :   int err = 0;
    3011           0 :   err = fd_tower_sync_decode_footprint_inner( ctx, total_sz );
    3012           0 :   if( FD_UNLIKELY( err ) ) return err;
    3013           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    3014           0 :   if( FD_UNLIKELY( err ) ) return err;
    3015           0 :   return 0;
    3016           0 : }
    3017           0 : int fd_tower_sync_switch_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3018           0 :   *total_sz += sizeof(fd_tower_sync_switch_t);
    3019           0 :   void const * start_data = ctx->data;
    3020           0 :   int err = fd_tower_sync_switch_decode_footprint_inner( ctx, total_sz );
    3021           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3022           0 :   ctx->data = start_data;
    3023           0 :   return err;
    3024           0 : }
    3025           0 : static void fd_tower_sync_switch_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3026           0 :   fd_tower_sync_switch_t * self = (fd_tower_sync_switch_t *)struct_mem;
    3027           0 :   fd_tower_sync_decode_inner( &self->tower_sync, alloc_mem, ctx );
    3028           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    3029           0 : }
    3030           0 : void * fd_tower_sync_switch_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3031           0 :   fd_tower_sync_switch_t * self = (fd_tower_sync_switch_t *)mem;
    3032           0 :   fd_tower_sync_switch_new( self );
    3033           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_tower_sync_switch_t);
    3034           0 :   void * * alloc_mem = &alloc_region;
    3035           0 :   fd_tower_sync_switch_decode_inner( mem, alloc_mem, ctx );
    3036           0 :   return self;
    3037           0 : }
    3038           0 : void fd_tower_sync_switch_new(fd_tower_sync_switch_t * self) {
    3039           0 :   fd_memset( self, 0, sizeof(fd_tower_sync_switch_t) );
    3040           0 :   fd_tower_sync_new( &self->tower_sync );
    3041           0 :   fd_hash_new( &self->hash );
    3042           0 : }
    3043           0 : ulong fd_tower_sync_switch_size( fd_tower_sync_switch_t const * self ) {
    3044           0 :   ulong size = 0;
    3045           0 :   size += fd_tower_sync_size( &self->tower_sync );
    3046           0 :   size += fd_hash_size( &self->hash );
    3047           0 :   return size;
    3048           0 : }
    3049             : 
    3050           0 : int fd_slot_history_encode( fd_slot_history_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3051           0 :   int err;
    3052           0 :   err = fd_bincode_bool_encode( self->has_bits, ctx );
    3053           0 :   if( FD_UNLIKELY( err ) ) return err;
    3054           0 :   if( self->has_bits ) {
    3055           0 :     err = fd_bincode_uint64_encode( self->bits_bitvec_len, ctx );
    3056           0 :     if( FD_UNLIKELY(err) ) return err;
    3057           0 :     if( self->bits_bitvec_len ) {
    3058           0 :       for( ulong i=0; i < self->bits_bitvec_len; i++ ) {
    3059           0 :         err = fd_bincode_uint64_encode( self->bits_bitvec[i], ctx );
    3060           0 :       }
    3061           0 :     }
    3062           0 :     if( FD_UNLIKELY( err ) ) return err;
    3063           0 :   }
    3064           0 :   err = fd_bincode_uint64_encode( self->bits_len, ctx );
    3065           0 :   if( FD_UNLIKELY( err ) ) return err;
    3066           0 :   err = fd_bincode_uint64_encode( self->next_slot, ctx );
    3067           0 :   if( FD_UNLIKELY( err ) ) return err;
    3068           0 :   return FD_BINCODE_SUCCESS;
    3069           0 : }
    3070           0 : int fd_slot_history_encode_global( fd_slot_history_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3071           0 :   int err;
    3072           0 :   err = fd_bincode_bool_encode( self->has_bits, ctx );
    3073           0 :   if( FD_UNLIKELY( err ) ) return err;
    3074           0 :   if( self->has_bits ) {
    3075           0 :   if( FD_UNLIKELY( err ) ) return err;
    3076           0 :     err = fd_bincode_uint64_encode( self->bits_bitvec_len, ctx );
    3077           0 :     if( FD_UNLIKELY( err ) ) return err;
    3078           0 :     if( self->bits_bitvec_len ) {
    3079           0 :       uchar * bits_bitvec_laddr = (uchar*)self + self->bits_bitvec_offset;
    3080           0 :       ulong * bits_bitvec = (ulong *)bits_bitvec_laddr;
    3081           0 :       for( ulong i=0; i < self->bits_bitvec_len; i++ ) {
    3082           0 :         err = fd_bincode_uint64_encode( bits_bitvec[i], ctx );
    3083           0 :         if( FD_UNLIKELY( err ) ) return err;
    3084           0 :       }
    3085           0 :     }
    3086           0 :     if( FD_UNLIKELY( err ) ) return err;
    3087           0 :   }
    3088           0 :   err = fd_bincode_uint64_encode( self->bits_len, ctx );
    3089           0 :   if( FD_UNLIKELY( err ) ) return err;
    3090           0 :   err = fd_bincode_uint64_encode( self->next_slot, ctx );
    3091           0 :   if( FD_UNLIKELY( err ) ) return err;
    3092           0 :   return FD_BINCODE_SUCCESS;
    3093           0 : }
    3094          69 : static int fd_slot_history_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3095          69 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3096          69 :   int err = 0;
    3097          69 :   {
    3098          69 :     uchar o;
    3099          69 :     ulong inner_len = 0UL;
    3100          69 :     err = fd_bincode_bool_decode( &o, ctx );
    3101          69 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3102          69 :     if( o ) {
    3103           3 :       ulong bits_bitvec_len;
    3104           3 :       err = fd_bincode_uint64_decode( &bits_bitvec_len, ctx );
    3105           3 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3106           3 :       if( bits_bitvec_len ) {
    3107           3 :         *total_sz += 8UL + sizeof(ulong)*bits_bitvec_len;
    3108       49155 :         for( ulong i=0; i < bits_bitvec_len; i++ ) {
    3109       49152 :           err = fd_bincode_uint64_decode_footprint( ctx );
    3110       49152 :           if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3111       49152 :         }
    3112           3 :       }
    3113           3 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3114           3 :       inner_len = bits_bitvec_len;
    3115           3 :       if( inner_len==0 ) return FD_BINCODE_ERR_ENCODING;
    3116           3 :     }
    3117          69 :     ulong len;
    3118          69 :     err = fd_bincode_uint64_decode( &len, ctx );
    3119          69 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3120          69 :     if( len > inner_len * sizeof(ulong) * 8UL ) return FD_BINCODE_ERR_ENCODING;
    3121          69 :   }
    3122          69 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3123          69 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3124          69 :   return 0;
    3125          69 : }
    3126          69 : int fd_slot_history_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3127          69 :   *total_sz += sizeof(fd_slot_history_t);
    3128          69 :   void const * start_data = ctx->data;
    3129          69 :   int err = fd_slot_history_decode_footprint_inner( ctx, total_sz );
    3130          69 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3131          69 :   ctx->data = start_data;
    3132          69 :   return err;
    3133          69 : }
    3134           0 : static void fd_slot_history_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3135           0 :   fd_slot_history_t * self = (fd_slot_history_t *)struct_mem;
    3136           0 :   {
    3137           0 :     uchar o;
    3138           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    3139           0 :     self->has_bits = !!o;
    3140           0 :     if( o ) {
    3141           0 :       fd_bincode_uint64_decode_unsafe( &self->bits_bitvec_len, ctx );
    3142           0 :       if( self->bits_bitvec_len ) {
    3143           0 :         *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), 8UL );
    3144           0 :         self->bits_bitvec = *alloc_mem;
    3145           0 :         *alloc_mem = (uchar *)(*alloc_mem) + sizeof(ulong)*self->bits_bitvec_len;
    3146           0 :         for( ulong i=0; i < self->bits_bitvec_len; i++ ) {
    3147           0 :           fd_bincode_uint64_decode_unsafe( self->bits_bitvec + i, ctx );
    3148           0 :         }
    3149           0 :       } else
    3150           0 :         self->bits_bitvec = NULL;
    3151           0 :     } else {
    3152           0 :       self->bits_bitvec = NULL;
    3153           0 :     }
    3154           0 :     fd_bincode_uint64_decode_unsafe( &self->bits_len, ctx );
    3155           0 :   }
    3156           0 :   fd_bincode_uint64_decode_unsafe( &self->next_slot, ctx );
    3157           0 : }
    3158           0 : void * fd_slot_history_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3159           0 :   fd_slot_history_t * self = (fd_slot_history_t *)mem;
    3160           0 :   fd_slot_history_new( self );
    3161           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_history_t);
    3162           0 :   void * * alloc_mem = &alloc_region;
    3163           0 :   fd_slot_history_decode_inner( mem, alloc_mem, ctx );
    3164           0 :   return self;
    3165           0 : }
    3166          66 : static void fd_slot_history_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3167          66 :   fd_slot_history_global_t * self = (fd_slot_history_global_t *)struct_mem;
    3168          66 :   {
    3169          66 :     uchar o;
    3170          66 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    3171          66 :     self->has_bits = !!o;
    3172          66 :     if( o ) {
    3173           0 :       fd_bincode_uint64_decode_unsafe( &self->bits_bitvec_len, ctx );
    3174           0 :       if( self->bits_bitvec_len ) {
    3175           0 :         *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), 8UL );
    3176           0 :         self->bits_bitvec_offset = (ulong)*alloc_mem - (ulong)struct_mem;
    3177           0 :         uchar * cur_mem = (uchar *)(*alloc_mem);
    3178           0 :         *alloc_mem = (uchar *)(*alloc_mem) + sizeof(ulong)*self->bits_bitvec_len;
    3179           0 :         for( ulong i=0; i < self->bits_bitvec_len; i++ ) {
    3180           0 :           fd_bincode_uint64_decode_unsafe( (ulong*)(cur_mem + sizeof(ulong) * i), ctx );
    3181           0 :         }
    3182           0 :       } else {
    3183           0 :         self->bits_bitvec_offset = 0UL;
    3184           0 :       }
    3185           0 :     }
    3186          66 :     fd_bincode_uint64_decode_unsafe( &self->bits_len, ctx );
    3187          66 :   }
    3188          66 :   fd_bincode_uint64_decode_unsafe( &self->next_slot, ctx );
    3189          66 : }
    3190          66 : void * fd_slot_history_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3191          66 :   fd_slot_history_global_t * self = (fd_slot_history_global_t *)mem;
    3192          66 :   fd_slot_history_new( (fd_slot_history_t *)self );
    3193          66 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_history_global_t);
    3194          66 :   void * * alloc_mem = &alloc_region;
    3195          66 :   fd_slot_history_decode_inner_global( mem, alloc_mem, ctx );
    3196          66 :   return self;
    3197          66 : }
    3198          66 : void fd_slot_history_new(fd_slot_history_t * self) {
    3199          66 :   fd_memset( self, 0, sizeof(fd_slot_history_t) );
    3200          66 : }
    3201           0 : ulong fd_slot_history_size( fd_slot_history_t const * self ) {
    3202           0 :   ulong size = 0;
    3203           0 :   size += sizeof(char);
    3204           0 :   if( self->has_bits ) {
    3205           0 :     do {
    3206           0 :       size += sizeof(ulong);
    3207           0 :       size += self->bits_bitvec_len * sizeof(ulong);
    3208           0 :     } while(0);
    3209           0 :   }
    3210           0 :   size += sizeof(ulong);
    3211           0 :   size += sizeof(ulong);
    3212           0 :   return size;
    3213           0 : }
    3214             : 
    3215           0 : ulong fd_slot_history_size_global( fd_slot_history_global_t const * self ) {
    3216           0 :   ulong size = 0;
    3217           0 :   do {
    3218           0 :     size += sizeof(char);
    3219           0 :     if( self->has_bits ) {
    3220           0 :     do {
    3221           0 :       size += sizeof(ulong);
    3222           0 :     ulong * bits_bitvec = self->bits_bitvec_offset ? (ulong *)fd_type_pun( (uchar *)self + self->bits_bitvec_offset ) : NULL;
    3223           0 :       size += self->bits_bitvec_len * sizeof(ulong);
    3224           0 :     } while(0);
    3225           0 :     }
    3226           0 :   } while(0);
    3227           0 :   size += sizeof(ulong);
    3228           0 :   return size;
    3229           0 : }
    3230             : 
    3231         234 : int fd_slot_hash_encode( fd_slot_hash_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3232         234 :   int err;
    3233         234 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    3234         234 :   if( FD_UNLIKELY( err ) ) return err;
    3235         234 :   err = fd_hash_encode( &self->hash, ctx );
    3236         234 :   if( FD_UNLIKELY( err ) ) return err;
    3237         234 :   return FD_BINCODE_SUCCESS;
    3238         234 : }
    3239           0 : static inline int fd_slot_hash_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3240           0 :   if( (ulong)ctx->data + 40UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3241           0 :   ctx->data = (void *)( (ulong)ctx->data + 40UL );
    3242           0 :   return 0;
    3243           0 : }
    3244         318 : static void fd_slot_hash_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3245         318 :   fd_slot_hash_t * self = (fd_slot_hash_t *)struct_mem;
    3246         318 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    3247         318 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    3248         318 : }
    3249           0 : void * fd_slot_hash_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3250           0 :   fd_slot_hash_t * self = (fd_slot_hash_t *)mem;
    3251           0 :   fd_slot_hash_new( self );
    3252           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_hash_t);
    3253           0 :   void * * alloc_mem = &alloc_region;
    3254           0 :   fd_slot_hash_decode_inner( mem, alloc_mem, ctx );
    3255           0 :   return self;
    3256           0 : }
    3257           0 : int fd_slot_hashes_encode( fd_slot_hashes_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3258           0 :   int err;
    3259           0 :   if( self->hashes ) {
    3260           0 :     ulong hashes_len = deq_fd_slot_hash_t_cnt( self->hashes );
    3261           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3262           0 :     if( FD_UNLIKELY( err ) ) return err;
    3263           0 :     for( deq_fd_slot_hash_t_iter_t iter = deq_fd_slot_hash_t_iter_init( self->hashes ); !deq_fd_slot_hash_t_iter_done( self->hashes, iter ); iter = deq_fd_slot_hash_t_iter_next( self->hashes, iter ) ) {
    3264           0 :       fd_slot_hash_t const * ele = deq_fd_slot_hash_t_iter_ele_const( self->hashes, iter );
    3265           0 :       err = fd_slot_hash_encode( ele, ctx );
    3266           0 :       if( FD_UNLIKELY( err ) ) return err;
    3267           0 :     }
    3268           0 :   } else {
    3269           0 :     ulong hashes_len = 0;
    3270           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3271           0 :     if( FD_UNLIKELY( err ) ) return err;
    3272           0 :   }
    3273           0 :   return FD_BINCODE_SUCCESS;
    3274           0 : }
    3275         123 : int fd_slot_hashes_encode_global( fd_slot_hashes_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3276         123 :   int err;
    3277         123 :   if( self->hashes_offset ) {
    3278         123 :   uchar * hashes_laddr = (uchar*)self + self->hashes_offset;
    3279         123 :    fd_slot_hash_t * hashes = deq_fd_slot_hash_t_join( hashes_laddr );
    3280         123 :     ulong hashes_len = deq_fd_slot_hash_t_cnt( hashes );
    3281         123 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3282         123 :     if( FD_UNLIKELY( err ) ) return err;
    3283         357 :     for( deq_fd_slot_hash_t_iter_t iter = deq_fd_slot_hash_t_iter_init( hashes ); !deq_fd_slot_hash_t_iter_done( hashes, iter ); iter = deq_fd_slot_hash_t_iter_next( hashes, iter ) ) {
    3284         234 :       fd_slot_hash_t const * ele = deq_fd_slot_hash_t_iter_ele_const( hashes, iter );
    3285         234 :       err = fd_slot_hash_encode( ele, ctx );
    3286         234 :       if( FD_UNLIKELY( err ) ) return err;
    3287         234 :     }
    3288         123 :   } else {
    3289           0 :     ulong hashes_len = 0;
    3290           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3291           0 :     if( FD_UNLIKELY( err ) ) return err;
    3292           0 :   }
    3293         123 :   return FD_BINCODE_SUCCESS;
    3294         123 : }
    3295         162 : static int fd_slot_hashes_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3296         162 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3297         162 :   int err = 0;
    3298         162 :   ulong hashes_len;
    3299         162 :   err = fd_bincode_uint64_decode( &hashes_len, ctx );
    3300         162 :   if( FD_UNLIKELY( err ) ) return err;
    3301         162 :   ulong hashes_max = fd_ulong_max( hashes_len, 512 );
    3302         162 :   *total_sz += deq_fd_slot_hash_t_align() + deq_fd_slot_hash_t_footprint( hashes_max );
    3303         162 :   ulong hashes_sz;
    3304         162 :   if( FD_UNLIKELY( __builtin_umull_overflow( hashes_len, 40, &hashes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    3305         162 :   err = fd_bincode_bytes_decode_footprint( hashes_sz, ctx );
    3306         162 :   if( FD_UNLIKELY( err ) ) return err;
    3307         162 :   return 0;
    3308         162 : }
    3309         162 : int fd_slot_hashes_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3310         162 :   *total_sz += sizeof(fd_slot_hashes_t);
    3311         162 :   void const * start_data = ctx->data;
    3312         162 :   int err = fd_slot_hashes_decode_footprint_inner( ctx, total_sz );
    3313         162 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3314         162 :   ctx->data = start_data;
    3315         162 :   return err;
    3316         162 : }
    3317           0 : static void fd_slot_hashes_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3318           0 :   fd_slot_hashes_t * self = (fd_slot_hashes_t *)struct_mem;
    3319           0 :   ulong hashes_len;
    3320           0 :   fd_bincode_uint64_decode_unsafe( &hashes_len, ctx );
    3321           0 :   ulong hashes_max = fd_ulong_max( hashes_len, 512 );
    3322           0 :   self->hashes = deq_fd_slot_hash_t_join_new( alloc_mem, hashes_max );
    3323           0 :   for( ulong i=0; i < hashes_len; i++ ) {
    3324           0 :     fd_slot_hash_t * elem = deq_fd_slot_hash_t_push_tail_nocopy( self->hashes );
    3325           0 :     fd_slot_hash_new( elem );
    3326           0 :     fd_slot_hash_decode_inner( elem, alloc_mem, ctx );
    3327           0 :   }
    3328           0 : }
    3329           0 : void * fd_slot_hashes_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3330           0 :   fd_slot_hashes_t * self = (fd_slot_hashes_t *)mem;
    3331           0 :   fd_slot_hashes_new( self );
    3332           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_hashes_t);
    3333           0 :   void * * alloc_mem = &alloc_region;
    3334           0 :   fd_slot_hashes_decode_inner( mem, alloc_mem, ctx );
    3335           0 :   return self;
    3336           0 : }
    3337         210 : static void fd_slot_hashes_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3338         210 :   fd_slot_hashes_global_t * self = (fd_slot_hashes_global_t *)struct_mem;
    3339         210 :   ulong hashes_len;
    3340         210 :   fd_bincode_uint64_decode_unsafe( &hashes_len, ctx );
    3341         210 :   *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, deq_fd_slot_hash_t_align() );
    3342         210 :   ulong hashes_max = fd_ulong_max( hashes_len, 512 );
    3343         210 :   fd_slot_hash_t * hashes = deq_fd_slot_hash_t_join_new( alloc_mem, hashes_max );
    3344         528 :   for( ulong i=0; i < hashes_len; i++ ) {
    3345         318 :     fd_slot_hash_t * elem = deq_fd_slot_hash_t_push_tail_nocopy( hashes );
    3346         318 :     fd_slot_hash_new( (fd_slot_hash_t*)fd_type_pun( elem ) );
    3347         318 :     fd_slot_hash_decode_inner( elem, alloc_mem, ctx );
    3348         318 :   }
    3349         210 :   self->hashes_offset = (ulong)deq_fd_slot_hash_t_leave( hashes ) - (ulong)struct_mem;
    3350         210 : }
    3351         210 : void * fd_slot_hashes_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3352         210 :   fd_slot_hashes_global_t * self = (fd_slot_hashes_global_t *)mem;
    3353         210 :   fd_slot_hashes_new( (fd_slot_hashes_t *)self );
    3354         210 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_hashes_global_t);
    3355         210 :   void * * alloc_mem = &alloc_region;
    3356         210 :   fd_slot_hashes_decode_inner_global( mem, alloc_mem, ctx );
    3357         210 :   return self;
    3358         210 : }
    3359         210 : void fd_slot_hashes_new(fd_slot_hashes_t * self) {
    3360         210 :   fd_memset( self, 0, sizeof(fd_slot_hashes_t) );
    3361         210 : }
    3362           0 : ulong fd_slot_hashes_size( fd_slot_hashes_t const * self ) {
    3363           0 :   ulong size = 0;
    3364           0 :   if( self->hashes ) {
    3365           0 :     size += sizeof(ulong);
    3366           0 :     for( deq_fd_slot_hash_t_iter_t iter = deq_fd_slot_hash_t_iter_init( self->hashes ); !deq_fd_slot_hash_t_iter_done( self->hashes, iter ); iter = deq_fd_slot_hash_t_iter_next( self->hashes, iter ) ) {
    3367           0 :       fd_slot_hash_t * ele = deq_fd_slot_hash_t_iter_ele( self->hashes, iter );
    3368           0 :       size += fd_slot_hash_size( ele );
    3369           0 :     }
    3370           0 :   } else {
    3371           0 :     size += sizeof(ulong);
    3372           0 :   }
    3373           0 :   return size;
    3374           0 : }
    3375             : 
    3376           0 : ulong fd_slot_hashes_size_global( fd_slot_hashes_global_t const * self ) {
    3377           0 :   ulong size = 0;
    3378           0 :   if( self->hashes_offset!=0 ) {
    3379           0 :     fd_slot_hash_t * hashes = (fd_slot_hash_t *)deq_fd_slot_hash_t_join( fd_type_pun( (uchar *)self + self->hashes_offset ) );
    3380           0 :     size += sizeof(ulong);
    3381           0 :     for( deq_fd_slot_hash_t_iter_t iter = deq_fd_slot_hash_t_iter_init( hashes ); !deq_fd_slot_hash_t_iter_done( hashes, iter ); iter = deq_fd_slot_hash_t_iter_next( hashes, iter ) ) {
    3382           0 :       fd_slot_hash_t * ele = deq_fd_slot_hash_t_iter_ele( hashes, iter );
    3383           0 :       size += fd_slot_hash_size( ele );
    3384           0 :     }
    3385           0 :   } else {
    3386           0 :     size += sizeof(ulong);
    3387           0 :   }
    3388           0 :   return size;
    3389           0 : }
    3390             : 
    3391           0 : int fd_block_block_hash_entry_encode( fd_block_block_hash_entry_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3392           0 :   int err;
    3393           0 :   err = fd_hash_encode( &self->blockhash, ctx );
    3394           0 :   if( FD_UNLIKELY( err ) ) return err;
    3395           0 :   err = fd_fee_calculator_encode( &self->fee_calculator, ctx );
    3396           0 :   if( FD_UNLIKELY( err ) ) return err;
    3397           0 :   return FD_BINCODE_SUCCESS;
    3398           0 : }
    3399           0 : static inline int fd_block_block_hash_entry_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3400           0 :   if( (ulong)ctx->data + 40UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3401           0 :   ctx->data = (void *)( (ulong)ctx->data + 40UL );
    3402           0 :   return 0;
    3403           0 : }
    3404       34041 : static void fd_block_block_hash_entry_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3405       34041 :   fd_block_block_hash_entry_t * self = (fd_block_block_hash_entry_t *)struct_mem;
    3406       34041 :   fd_hash_decode_inner( &self->blockhash, alloc_mem, ctx );
    3407       34041 :   fd_fee_calculator_decode_inner( &self->fee_calculator, alloc_mem, ctx );
    3408       34041 : }
    3409           0 : void * fd_block_block_hash_entry_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3410           0 :   fd_block_block_hash_entry_t * self = (fd_block_block_hash_entry_t *)mem;
    3411           0 :   fd_block_block_hash_entry_new( self );
    3412           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_block_block_hash_entry_t);
    3413           0 :   void * * alloc_mem = &alloc_region;
    3414           0 :   fd_block_block_hash_entry_decode_inner( mem, alloc_mem, ctx );
    3415           0 :   return self;
    3416           0 : }
    3417           0 : int fd_recent_block_hashes_encode( fd_recent_block_hashes_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3418           0 :   int err;
    3419           0 :   if( self->hashes ) {
    3420           0 :     ulong hashes_len = deq_fd_block_block_hash_entry_t_cnt( self->hashes );
    3421           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3422           0 :     if( FD_UNLIKELY( err ) ) return err;
    3423           0 :     for( deq_fd_block_block_hash_entry_t_iter_t iter = deq_fd_block_block_hash_entry_t_iter_init( self->hashes ); !deq_fd_block_block_hash_entry_t_iter_done( self->hashes, iter ); iter = deq_fd_block_block_hash_entry_t_iter_next( self->hashes, iter ) ) {
    3424           0 :       fd_block_block_hash_entry_t const * ele = deq_fd_block_block_hash_entry_t_iter_ele_const( self->hashes, iter );
    3425           0 :       err = fd_block_block_hash_entry_encode( ele, ctx );
    3426           0 :       if( FD_UNLIKELY( err ) ) return err;
    3427           0 :     }
    3428           0 :   } else {
    3429           0 :     ulong hashes_len = 0;
    3430           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3431           0 :     if( FD_UNLIKELY( err ) ) return err;
    3432           0 :   }
    3433           0 :   return FD_BINCODE_SUCCESS;
    3434           0 : }
    3435           0 : int fd_recent_block_hashes_encode_global( fd_recent_block_hashes_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3436           0 :   int err;
    3437           0 :   if( self->hashes_offset ) {
    3438           0 :   uchar * hashes_laddr = (uchar*)self + self->hashes_offset;
    3439           0 :    fd_block_block_hash_entry_t * hashes = deq_fd_block_block_hash_entry_t_join( hashes_laddr );
    3440           0 :     ulong hashes_len = deq_fd_block_block_hash_entry_t_cnt( hashes );
    3441           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3442           0 :     if( FD_UNLIKELY( err ) ) return err;
    3443           0 :     for( deq_fd_block_block_hash_entry_t_iter_t iter = deq_fd_block_block_hash_entry_t_iter_init( hashes ); !deq_fd_block_block_hash_entry_t_iter_done( hashes, iter ); iter = deq_fd_block_block_hash_entry_t_iter_next( hashes, iter ) ) {
    3444           0 :       fd_block_block_hash_entry_t const * ele = deq_fd_block_block_hash_entry_t_iter_ele_const( hashes, iter );
    3445           0 :       err = fd_block_block_hash_entry_encode( ele, ctx );
    3446           0 :       if( FD_UNLIKELY( err ) ) return err;
    3447           0 :     }
    3448           0 :   } else {
    3449           0 :     ulong hashes_len = 0;
    3450           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3451           0 :     if( FD_UNLIKELY( err ) ) return err;
    3452           0 :   }
    3453           0 :   return FD_BINCODE_SUCCESS;
    3454           0 : }
    3455         522 : static int fd_recent_block_hashes_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3456         522 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3457         522 :   int err = 0;
    3458         522 :   ulong hashes_len;
    3459         522 :   err = fd_bincode_uint64_decode( &hashes_len, ctx );
    3460         522 :   if( FD_UNLIKELY( err ) ) return err;
    3461         522 :   ulong hashes_max = fd_ulong_max( hashes_len, 151 );
    3462         522 :   *total_sz += deq_fd_block_block_hash_entry_t_align() + deq_fd_block_block_hash_entry_t_footprint( hashes_max );
    3463         522 :   ulong hashes_sz;
    3464         522 :   if( FD_UNLIKELY( __builtin_umull_overflow( hashes_len, 40, &hashes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    3465         522 :   err = fd_bincode_bytes_decode_footprint( hashes_sz, ctx );
    3466         522 :   if( FD_UNLIKELY( err ) ) return err;
    3467         522 :   return 0;
    3468         522 : }
    3469         522 : int fd_recent_block_hashes_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3470         522 :   *total_sz += sizeof(fd_recent_block_hashes_t);
    3471         522 :   void const * start_data = ctx->data;
    3472         522 :   int err = fd_recent_block_hashes_decode_footprint_inner( ctx, total_sz );
    3473         522 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3474         522 :   ctx->data = start_data;
    3475         522 :   return err;
    3476         522 : }
    3477           0 : static void fd_recent_block_hashes_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3478           0 :   fd_recent_block_hashes_t * self = (fd_recent_block_hashes_t *)struct_mem;
    3479           0 :   ulong hashes_len;
    3480           0 :   fd_bincode_uint64_decode_unsafe( &hashes_len, ctx );
    3481           0 :   ulong hashes_max = fd_ulong_max( hashes_len, 151 );
    3482           0 :   self->hashes = deq_fd_block_block_hash_entry_t_join_new( alloc_mem, hashes_max );
    3483           0 :   for( ulong i=0; i < hashes_len; i++ ) {
    3484           0 :     fd_block_block_hash_entry_t * elem = deq_fd_block_block_hash_entry_t_push_tail_nocopy( self->hashes );
    3485           0 :     fd_block_block_hash_entry_new( elem );
    3486           0 :     fd_block_block_hash_entry_decode_inner( elem, alloc_mem, ctx );
    3487           0 :   }
    3488           0 : }
    3489           0 : void * fd_recent_block_hashes_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3490           0 :   fd_recent_block_hashes_t * self = (fd_recent_block_hashes_t *)mem;
    3491           0 :   fd_recent_block_hashes_new( self );
    3492           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_recent_block_hashes_t);
    3493           0 :   void * * alloc_mem = &alloc_region;
    3494           0 :   fd_recent_block_hashes_decode_inner( mem, alloc_mem, ctx );
    3495           0 :   return self;
    3496           0 : }
    3497         519 : static void fd_recent_block_hashes_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3498         519 :   fd_recent_block_hashes_global_t * self = (fd_recent_block_hashes_global_t *)struct_mem;
    3499         519 :   ulong hashes_len;
    3500         519 :   fd_bincode_uint64_decode_unsafe( &hashes_len, ctx );
    3501         519 :   *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, deq_fd_block_block_hash_entry_t_align() );
    3502         519 :   ulong hashes_max = fd_ulong_max( hashes_len, 151 );
    3503         519 :   fd_block_block_hash_entry_t * hashes = deq_fd_block_block_hash_entry_t_join_new( alloc_mem, hashes_max );
    3504       34560 :   for( ulong i=0; i < hashes_len; i++ ) {
    3505       34041 :     fd_block_block_hash_entry_t * elem = deq_fd_block_block_hash_entry_t_push_tail_nocopy( hashes );
    3506       34041 :     fd_block_block_hash_entry_new( (fd_block_block_hash_entry_t*)fd_type_pun( elem ) );
    3507       34041 :     fd_block_block_hash_entry_decode_inner( elem, alloc_mem, ctx );
    3508       34041 :   }
    3509         519 :   self->hashes_offset = (ulong)deq_fd_block_block_hash_entry_t_leave( hashes ) - (ulong)struct_mem;
    3510         519 : }
    3511         519 : void * fd_recent_block_hashes_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3512         519 :   fd_recent_block_hashes_global_t * self = (fd_recent_block_hashes_global_t *)mem;
    3513         519 :   fd_recent_block_hashes_new( (fd_recent_block_hashes_t *)self );
    3514         519 :   void * alloc_region = (uchar *)mem + sizeof(fd_recent_block_hashes_global_t);
    3515         519 :   void * * alloc_mem = &alloc_region;
    3516         519 :   fd_recent_block_hashes_decode_inner_global( mem, alloc_mem, ctx );
    3517         519 :   return self;
    3518         519 : }
    3519         519 : void fd_recent_block_hashes_new(fd_recent_block_hashes_t * self) {
    3520         519 :   fd_memset( self, 0, sizeof(fd_recent_block_hashes_t) );
    3521         519 : }
    3522           0 : ulong fd_recent_block_hashes_size( fd_recent_block_hashes_t const * self ) {
    3523           0 :   ulong size = 0;
    3524           0 :   if( self->hashes ) {
    3525           0 :     size += sizeof(ulong);
    3526           0 :     for( deq_fd_block_block_hash_entry_t_iter_t iter = deq_fd_block_block_hash_entry_t_iter_init( self->hashes ); !deq_fd_block_block_hash_entry_t_iter_done( self->hashes, iter ); iter = deq_fd_block_block_hash_entry_t_iter_next( self->hashes, iter ) ) {
    3527           0 :       fd_block_block_hash_entry_t * ele = deq_fd_block_block_hash_entry_t_iter_ele( self->hashes, iter );
    3528           0 :       size += fd_block_block_hash_entry_size( ele );
    3529           0 :     }
    3530           0 :   } else {
    3531           0 :     size += sizeof(ulong);
    3532           0 :   }
    3533           0 :   return size;
    3534           0 : }
    3535             : 
    3536           0 : ulong fd_recent_block_hashes_size_global( fd_recent_block_hashes_global_t const * self ) {
    3537           0 :   ulong size = 0;
    3538           0 :   if( self->hashes_offset!=0 ) {
    3539           0 :     fd_block_block_hash_entry_t * hashes = (fd_block_block_hash_entry_t *)deq_fd_block_block_hash_entry_t_join( fd_type_pun( (uchar *)self + self->hashes_offset ) );
    3540           0 :     size += sizeof(ulong);
    3541           0 :     for( deq_fd_block_block_hash_entry_t_iter_t iter = deq_fd_block_block_hash_entry_t_iter_init( hashes ); !deq_fd_block_block_hash_entry_t_iter_done( hashes, iter ); iter = deq_fd_block_block_hash_entry_t_iter_next( hashes, iter ) ) {
    3542           0 :       fd_block_block_hash_entry_t * ele = deq_fd_block_block_hash_entry_t_iter_ele( hashes, iter );
    3543           0 :       size += fd_block_block_hash_entry_size( ele );
    3544           0 :     }
    3545           0 :   } else {
    3546           0 :     size += sizeof(ulong);
    3547           0 :   }
    3548           0 :   return size;
    3549           0 : }
    3550             : 
    3551           0 : int fd_slot_meta_encode( fd_slot_meta_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3552           0 :   int err;
    3553           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    3554           0 :   if( FD_UNLIKELY( err ) ) return err;
    3555           0 :   err = fd_bincode_uint64_encode( self->consumed, ctx );
    3556           0 :   if( FD_UNLIKELY( err ) ) return err;
    3557           0 :   err = fd_bincode_uint64_encode( self->received, ctx );
    3558           0 :   if( FD_UNLIKELY( err ) ) return err;
    3559           0 :   err = fd_bincode_uint64_encode( (ulong)self->first_shred_timestamp, ctx );
    3560           0 :   if( FD_UNLIKELY( err ) ) return err;
    3561           0 :   err = fd_bincode_uint64_encode( self->last_index, ctx );
    3562           0 :   if( FD_UNLIKELY( err ) ) return err;
    3563           0 :   err = fd_bincode_uint64_encode( self->parent_slot, ctx );
    3564           0 :   if( FD_UNLIKELY( err ) ) return err;
    3565           0 :   err = fd_bincode_uint64_encode( self->next_slot_len, ctx );
    3566           0 :   if( FD_UNLIKELY(err) ) return err;
    3567           0 :   if( self->next_slot_len ) {
    3568           0 :     for( ulong i=0; i < self->next_slot_len; i++ ) {
    3569           0 :       err = fd_bincode_uint64_encode( self->next_slot[i], ctx );
    3570           0 :     }
    3571           0 :   }
    3572           0 :   err = fd_bincode_uint8_encode( (uchar)(self->is_connected), ctx );
    3573           0 :   if( FD_UNLIKELY( err ) ) return err;
    3574           0 :   return FD_BINCODE_SUCCESS;
    3575           0 : }
    3576           0 : static int fd_slot_meta_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3577           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3578           0 :   int err = 0;
    3579           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3580           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3581           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3582           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3583           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3584           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3585           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3586           0 :   if( FD_UNLIKELY( err ) ) return err;
    3587           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3588           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3589           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3590           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3591           0 :   ulong next_slot_len;
    3592           0 :   err = fd_bincode_uint64_decode( &next_slot_len, ctx );
    3593           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3594           0 :   if( next_slot_len ) {
    3595           0 :     *total_sz += 8UL + sizeof(ulong)*next_slot_len;
    3596           0 :     for( ulong i=0; i < next_slot_len; i++ ) {
    3597           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
    3598           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3599           0 :     }
    3600           0 :   }
    3601           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    3602           0 :   if( FD_UNLIKELY( err ) ) return err;
    3603           0 :   return 0;
    3604           0 : }
    3605           0 : int fd_slot_meta_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3606           0 :   *total_sz += sizeof(fd_slot_meta_t);
    3607           0 :   void const * start_data = ctx->data;
    3608           0 :   int err = fd_slot_meta_decode_footprint_inner( ctx, total_sz );
    3609           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3610           0 :   ctx->data = start_data;
    3611           0 :   return err;
    3612           0 : }
    3613           0 : static void fd_slot_meta_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3614           0 :   fd_slot_meta_t * self = (fd_slot_meta_t *)struct_mem;
    3615           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    3616           0 :   fd_bincode_uint64_decode_unsafe( &self->consumed, ctx );
    3617           0 :   fd_bincode_uint64_decode_unsafe( &self->received, ctx );
    3618           0 :   fd_bincode_uint64_decode_unsafe( (ulong *) &self->first_shred_timestamp, ctx );
    3619           0 :   fd_bincode_uint64_decode_unsafe( &self->last_index, ctx );
    3620           0 :   fd_bincode_uint64_decode_unsafe( &self->parent_slot, ctx );
    3621           0 :   fd_bincode_uint64_decode_unsafe( &self->next_slot_len, ctx );
    3622           0 :   if( self->next_slot_len ) {
    3623           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), 8UL );
    3624           0 :     self->next_slot = *alloc_mem;
    3625           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(ulong)*self->next_slot_len;
    3626           0 :     for( ulong i=0; i < self->next_slot_len; i++ ) {
    3627           0 :       fd_bincode_uint64_decode_unsafe( self->next_slot + i, ctx );
    3628           0 :     }
    3629           0 :   } else
    3630           0 :     self->next_slot = NULL;
    3631           0 :   fd_bincode_uint8_decode_unsafe( &self->is_connected, ctx );
    3632           0 : }
    3633           0 : void * fd_slot_meta_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3634           0 :   fd_slot_meta_t * self = (fd_slot_meta_t *)mem;
    3635           0 :   fd_slot_meta_new( self );
    3636           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_meta_t);
    3637           0 :   void * * alloc_mem = &alloc_region;
    3638           0 :   fd_slot_meta_decode_inner( mem, alloc_mem, ctx );
    3639           0 :   return self;
    3640           0 : }
    3641           0 : void fd_slot_meta_new(fd_slot_meta_t * self) {
    3642           0 :   fd_memset( self, 0, sizeof(fd_slot_meta_t) );
    3643           0 : }
    3644           0 : ulong fd_slot_meta_size( fd_slot_meta_t const * self ) {
    3645           0 :   ulong size = 0;
    3646           0 :   size += sizeof(ulong);
    3647           0 :   size += sizeof(ulong);
    3648           0 :   size += sizeof(ulong);
    3649           0 :   size += sizeof(long);
    3650           0 :   size += sizeof(ulong);
    3651           0 :   size += sizeof(ulong);
    3652           0 :   do {
    3653           0 :     size += sizeof(ulong);
    3654           0 :     size += self->next_slot_len * sizeof(ulong);
    3655           0 :   } while(0);
    3656           0 :   size += sizeof(char);
    3657           0 :   return size;
    3658           0 : }
    3659             : 
    3660           0 : int fd_sysvar_fees_encode( fd_sysvar_fees_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3661           0 :   int err;
    3662           0 :   err = fd_fee_calculator_encode( &self->fee_calculator, ctx );
    3663           0 :   if( FD_UNLIKELY( err ) ) return err;
    3664           0 :   return FD_BINCODE_SUCCESS;
    3665           0 : }
    3666           0 : static inline int fd_sysvar_fees_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3667           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3668           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
    3669           0 :   return 0;
    3670           0 : }
    3671           0 : static void fd_sysvar_fees_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3672           0 :   fd_sysvar_fees_t * self = (fd_sysvar_fees_t *)struct_mem;
    3673           0 :   fd_fee_calculator_decode_inner( &self->fee_calculator, alloc_mem, ctx );
    3674           0 : }
    3675           0 : void * fd_sysvar_fees_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3676           0 :   fd_sysvar_fees_t * self = (fd_sysvar_fees_t *)mem;
    3677           0 :   fd_sysvar_fees_new( self );
    3678           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_sysvar_fees_t);
    3679           0 :   void * * alloc_mem = &alloc_region;
    3680           0 :   fd_sysvar_fees_decode_inner( mem, alloc_mem, ctx );
    3681           0 :   return self;
    3682           0 : }
    3683          39 : int fd_sysvar_epoch_rewards_encode( fd_sysvar_epoch_rewards_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3684          39 :   int err;
    3685          39 :   err = fd_bincode_uint64_encode( self->distribution_starting_block_height, ctx );
    3686          39 :   if( FD_UNLIKELY( err ) ) return err;
    3687          39 :   err = fd_bincode_uint64_encode( self->num_partitions, ctx );
    3688          39 :   if( FD_UNLIKELY( err ) ) return err;
    3689          39 :   err = fd_hash_encode( &self->parent_blockhash, ctx );
    3690          39 :   if( FD_UNLIKELY( err ) ) return err;
    3691          39 :   err = fd_bincode_uint128_encode( self->total_points, ctx );
    3692          39 :   if( FD_UNLIKELY( err ) ) return err;
    3693          39 :   err = fd_bincode_uint64_encode( self->total_rewards, ctx );
    3694          39 :   if( FD_UNLIKELY( err ) ) return err;
    3695          39 :   err = fd_bincode_uint64_encode( self->distributed_rewards, ctx );
    3696          39 :   if( FD_UNLIKELY( err ) ) return err;
    3697          39 :   err = fd_bincode_bool_encode( (uchar)(self->active), ctx );
    3698          39 :   if( FD_UNLIKELY( err ) ) return err;
    3699          39 :   return FD_BINCODE_SUCCESS;
    3700          39 : }
    3701          54 : static int fd_sysvar_epoch_rewards_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3702          54 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3703          54 :   int err = 0;
    3704          54 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3705          54 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3706          54 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3707          54 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3708          54 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    3709          54 :   if( FD_UNLIKELY( err ) ) return err;
    3710          54 :   err = fd_bincode_uint128_decode_footprint( ctx );
    3711          54 :   if( FD_UNLIKELY( err ) ) return err;
    3712          54 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3713          54 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3714          54 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3715          54 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3716          54 :   err = fd_bincode_bool_decode_footprint( ctx );
    3717          54 :   if( FD_UNLIKELY( err ) ) return err;
    3718          54 :   return 0;
    3719          54 : }
    3720          54 : int fd_sysvar_epoch_rewards_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3721          54 :   *total_sz += sizeof(fd_sysvar_epoch_rewards_t);
    3722          54 :   void const * start_data = ctx->data;
    3723          54 :   int err = fd_sysvar_epoch_rewards_decode_footprint_inner( ctx, total_sz );
    3724          54 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3725          54 :   ctx->data = start_data;
    3726          54 :   return err;
    3727          54 : }
    3728          51 : static void fd_sysvar_epoch_rewards_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3729          51 :   fd_sysvar_epoch_rewards_t * self = (fd_sysvar_epoch_rewards_t *)struct_mem;
    3730          51 :   fd_bincode_uint64_decode_unsafe( &self->distribution_starting_block_height, ctx );
    3731          51 :   fd_bincode_uint64_decode_unsafe( &self->num_partitions, ctx );
    3732          51 :   fd_hash_decode_inner( &self->parent_blockhash, alloc_mem, ctx );
    3733          51 :   fd_bincode_uint128_decode_unsafe( &self->total_points, ctx );
    3734          51 :   fd_bincode_uint64_decode_unsafe( &self->total_rewards, ctx );
    3735          51 :   fd_bincode_uint64_decode_unsafe( &self->distributed_rewards, ctx );
    3736          51 :   fd_bincode_bool_decode_unsafe( &self->active, ctx );
    3737          51 : }
    3738          51 : void * fd_sysvar_epoch_rewards_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3739          51 :   fd_sysvar_epoch_rewards_t * self = (fd_sysvar_epoch_rewards_t *)mem;
    3740          51 :   fd_sysvar_epoch_rewards_new( self );
    3741          51 :   void * alloc_region = (uchar *)mem + sizeof(fd_sysvar_epoch_rewards_t);
    3742          51 :   void * * alloc_mem = &alloc_region;
    3743          51 :   fd_sysvar_epoch_rewards_decode_inner( mem, alloc_mem, ctx );
    3744          51 :   return self;
    3745          51 : }
    3746          51 : void fd_sysvar_epoch_rewards_new(fd_sysvar_epoch_rewards_t * self) {
    3747          51 :   fd_memset( self, 0, sizeof(fd_sysvar_epoch_rewards_t) );
    3748          51 :   fd_hash_new( &self->parent_blockhash );
    3749          51 : }
    3750           0 : int fd_config_keys_pair_encode( fd_config_keys_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3751           0 :   int err;
    3752           0 :   err = fd_pubkey_encode( &self->key, ctx );
    3753           0 :   if( FD_UNLIKELY( err ) ) return err;
    3754           0 :   err = fd_bincode_bool_encode( (uchar)(self->signer), ctx );
    3755           0 :   if( FD_UNLIKELY( err ) ) return err;
    3756           0 :   return FD_BINCODE_SUCCESS;
    3757           0 : }
    3758           0 : static int fd_config_keys_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3759           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3760           0 :   int err = 0;
    3761           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    3762           0 :   if( FD_UNLIKELY( err ) ) return err;
    3763           0 :   err = fd_bincode_bool_decode_footprint( ctx );
    3764           0 :   if( FD_UNLIKELY( err ) ) return err;
    3765           0 :   return 0;
    3766           0 : }
    3767           0 : int fd_config_keys_pair_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3768           0 :   *total_sz += sizeof(fd_config_keys_pair_t);
    3769           0 :   void const * start_data = ctx->data;
    3770           0 :   int err = fd_config_keys_pair_decode_footprint_inner( ctx, total_sz );
    3771           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3772           0 :   ctx->data = start_data;
    3773           0 :   return err;
    3774           0 : }
    3775           0 : static void fd_config_keys_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3776           0 :   fd_config_keys_pair_t * self = (fd_config_keys_pair_t *)struct_mem;
    3777           0 :   fd_pubkey_decode_inner( &self->key, alloc_mem, ctx );
    3778           0 :   fd_bincode_bool_decode_unsafe( &self->signer, ctx );
    3779           0 : }
    3780           0 : void * fd_config_keys_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3781           0 :   fd_config_keys_pair_t * self = (fd_config_keys_pair_t *)mem;
    3782           0 :   fd_config_keys_pair_new( self );
    3783           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_config_keys_pair_t);
    3784           0 :   void * * alloc_mem = &alloc_region;
    3785           0 :   fd_config_keys_pair_decode_inner( mem, alloc_mem, ctx );
    3786           0 :   return self;
    3787           0 : }
    3788           0 : void fd_config_keys_pair_new(fd_config_keys_pair_t * self) {
    3789           0 :   fd_memset( self, 0, sizeof(fd_config_keys_pair_t) );
    3790           0 :   fd_pubkey_new( &self->key );
    3791           0 : }
    3792          12 : int fd_stake_config_encode( fd_stake_config_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3793          12 :   int err;
    3794          12 :   err = fd_bincode_compact_u16_encode( &self->config_keys_len, ctx );
    3795          12 :   if( FD_UNLIKELY(err) ) return err;
    3796          12 :   if( self->config_keys_len ) {
    3797           0 :     for( ulong i=0; i < self->config_keys_len; i++ ) {
    3798           0 :       err = fd_config_keys_pair_encode( self->config_keys + i, ctx );
    3799           0 :       if( FD_UNLIKELY( err ) ) return err;
    3800           0 :     }
    3801           0 :   }
    3802          12 :   err = fd_bincode_double_encode( self->warmup_cooldown_rate, ctx );
    3803          12 :   if( FD_UNLIKELY( err ) ) return err;
    3804          12 :   err = fd_bincode_uint8_encode( (uchar)(self->slash_penalty), ctx );
    3805          12 :   if( FD_UNLIKELY( err ) ) return err;
    3806          12 :   return FD_BINCODE_SUCCESS;
    3807          12 : }
    3808           0 : static int fd_stake_config_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3809           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3810           0 :   int err = 0;
    3811           0 :   ushort config_keys_len;
    3812           0 :   err = fd_bincode_compact_u16_decode( &config_keys_len, ctx );
    3813           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3814           0 :   if( config_keys_len ) {
    3815           0 :     *total_sz += FD_CONFIG_KEYS_PAIR_ALIGN + sizeof(fd_config_keys_pair_t)*config_keys_len;
    3816           0 :     for( ulong i=0; i < config_keys_len; i++ ) {
    3817           0 :       err = fd_config_keys_pair_decode_footprint_inner( ctx, total_sz );
    3818           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3819           0 :     }
    3820           0 :   }
    3821           0 :   err = fd_bincode_double_decode_footprint( ctx );
    3822           0 :   if( FD_UNLIKELY( err ) ) return err;
    3823           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    3824           0 :   if( FD_UNLIKELY( err ) ) return err;
    3825           0 :   return 0;
    3826           0 : }
    3827           0 : int fd_stake_config_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3828           0 :   *total_sz += sizeof(fd_stake_config_t);
    3829           0 :   void const * start_data = ctx->data;
    3830           0 :   int err = fd_stake_config_decode_footprint_inner( ctx, total_sz );
    3831           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3832           0 :   ctx->data = start_data;
    3833           0 :   return err;
    3834           0 : }
    3835           0 : static void fd_stake_config_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3836           0 :   fd_stake_config_t * self = (fd_stake_config_t *)struct_mem;
    3837           0 :   fd_bincode_compact_u16_decode_unsafe( &self->config_keys_len, ctx );
    3838           0 :   if( self->config_keys_len ) {
    3839           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_CONFIG_KEYS_PAIR_ALIGN );
    3840           0 :     self->config_keys = *alloc_mem;
    3841           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_config_keys_pair_t)*self->config_keys_len;
    3842           0 :     for( ulong i=0; i < self->config_keys_len; i++ ) {
    3843           0 :       fd_config_keys_pair_new( self->config_keys + i );
    3844           0 :       fd_config_keys_pair_decode_inner( self->config_keys + i, alloc_mem, ctx );
    3845           0 :     }
    3846           0 :   } else
    3847           0 :     self->config_keys = NULL;
    3848           0 :   fd_bincode_double_decode_unsafe( &self->warmup_cooldown_rate, ctx );
    3849           0 :   fd_bincode_uint8_decode_unsafe( &self->slash_penalty, ctx );
    3850           0 : }
    3851           0 : void * fd_stake_config_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3852           0 :   fd_stake_config_t * self = (fd_stake_config_t *)mem;
    3853           0 :   fd_stake_config_new( self );
    3854           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_config_t);
    3855           0 :   void * * alloc_mem = &alloc_region;
    3856           0 :   fd_stake_config_decode_inner( mem, alloc_mem, ctx );
    3857           0 :   return self;
    3858           0 : }
    3859           0 : void fd_stake_config_new(fd_stake_config_t * self) {
    3860           0 :   fd_memset( self, 0, sizeof(fd_stake_config_t) );
    3861           0 : }
    3862           0 : ulong fd_stake_config_size( fd_stake_config_t const * self ) {
    3863           0 :   ulong size = 0;
    3864           0 :   do {
    3865           0 :     ushort tmp = (ushort)self->config_keys_len;
    3866           0 :     size += fd_bincode_compact_u16_size( &tmp );
    3867           0 :     for( ulong i=0; i < self->config_keys_len; i++ )
    3868           0 :       size += fd_config_keys_pair_size( self->config_keys + i );
    3869           0 :   } while(0);
    3870           0 :   size += sizeof(double);
    3871           0 :   size += sizeof(char);
    3872           0 :   return size;
    3873           0 : }
    3874             : 
    3875           0 : FD_FN_PURE uchar fd_cluster_type_is_Testnet(fd_cluster_type_t const * self) {
    3876           0 :   return self->discriminant == 0;
    3877           0 : }
    3878           0 : FD_FN_PURE uchar fd_cluster_type_is_MainnetBeta(fd_cluster_type_t const * self) {
    3879           0 :   return self->discriminant == 1;
    3880           0 : }
    3881           0 : FD_FN_PURE uchar fd_cluster_type_is_Devnet(fd_cluster_type_t const * self) {
    3882           0 :   return self->discriminant == 2;
    3883           0 : }
    3884           0 : FD_FN_PURE uchar fd_cluster_type_is_Development(fd_cluster_type_t const * self) {
    3885           0 :   return self->discriminant == 3;
    3886           0 : }
    3887           0 : int fd_cluster_type_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3888           0 :   int err;
    3889           0 :   switch (discriminant) {
    3890           0 :   case 0: {
    3891           0 :     return FD_BINCODE_SUCCESS;
    3892           0 :   }
    3893           0 :   case 1: {
    3894           0 :     return FD_BINCODE_SUCCESS;
    3895           0 :   }
    3896           0 :   case 2: {
    3897           0 :     return FD_BINCODE_SUCCESS;
    3898           0 :   }
    3899           0 :   case 3: {
    3900           0 :     return FD_BINCODE_SUCCESS;
    3901           0 :   }
    3902           0 :   default: return FD_BINCODE_ERR_ENCODING;
    3903           0 :   }
    3904           0 : }
    3905           0 : static int fd_cluster_type_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3906           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3907           0 :   uint discriminant = 0;
    3908           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    3909           0 :   if( FD_UNLIKELY( err ) ) return err;
    3910           0 :   return fd_cluster_type_inner_decode_footprint( discriminant, ctx, total_sz );
    3911           0 : }
    3912           0 : int fd_cluster_type_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3913           0 :   *total_sz += sizeof(fd_cluster_type_t);
    3914           0 :   void const * start_data = ctx->data;
    3915           0 :   int err =  fd_cluster_type_decode_footprint_inner( ctx, total_sz );
    3916           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3917           0 :   ctx->data = start_data;
    3918           0 :   return err;
    3919           0 : }
    3920           0 : static void fd_cluster_type_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3921           0 :   fd_cluster_type_t * self = (fd_cluster_type_t *)struct_mem;
    3922           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    3923           0 : }
    3924           0 : void * fd_cluster_type_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3925           0 :   fd_cluster_type_t * self = (fd_cluster_type_t *)mem;
    3926           0 :   fd_cluster_type_new( self );
    3927           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_cluster_type_t);
    3928           0 :   void * * alloc_mem = &alloc_region;
    3929           0 :   fd_cluster_type_decode_inner( mem, alloc_mem, ctx );
    3930           0 :   return self;
    3931           0 : }
    3932             : 
    3933           0 : ulong fd_cluster_type_size( fd_cluster_type_t const * self ) {
    3934           0 :   ulong size = 0;
    3935           0 :   size += sizeof(uint);
    3936           0 :   switch (self->discriminant) {
    3937           0 :   }
    3938           0 :   return size;
    3939           0 : }
    3940             : 
    3941           0 : int fd_cluster_type_encode( fd_cluster_type_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3942           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    3943           0 :   if( FD_UNLIKELY( err ) ) return err;
    3944           0 :   return err;
    3945           0 : }
    3946             : 
    3947           0 : int fd_cluster_version_encode( fd_cluster_version_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3948           0 :   int err;
    3949           0 :   err = fd_bincode_uint32_encode( self->major, ctx );
    3950           0 :   if( FD_UNLIKELY( err ) ) return err;
    3951           0 :   err = fd_bincode_uint32_encode( self->minor, ctx );
    3952           0 :   if( FD_UNLIKELY( err ) ) return err;
    3953           0 :   err = fd_bincode_uint32_encode( self->patch, ctx );
    3954           0 :   if( FD_UNLIKELY( err ) ) return err;
    3955           0 :   return FD_BINCODE_SUCCESS;
    3956           0 : }
    3957           0 : static inline int fd_cluster_version_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3958           0 :   if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3959           0 :   ctx->data = (void *)( (ulong)ctx->data + 12UL );
    3960           0 :   return 0;
    3961           0 : }
    3962           0 : static void fd_cluster_version_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3963           0 :   fd_cluster_version_t * self = (fd_cluster_version_t *)struct_mem;
    3964           0 :   fd_bincode_uint32_decode_unsafe( &self->major, ctx );
    3965           0 :   fd_bincode_uint32_decode_unsafe( &self->minor, ctx );
    3966           0 :   fd_bincode_uint32_decode_unsafe( &self->patch, ctx );
    3967           0 : }
    3968           0 : void * fd_cluster_version_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3969           0 :   fd_cluster_version_t * self = (fd_cluster_version_t *)mem;
    3970           0 :   fd_cluster_version_new( self );
    3971           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_cluster_version_t);
    3972           0 :   void * * alloc_mem = &alloc_region;
    3973           0 :   fd_cluster_version_decode_inner( mem, alloc_mem, ctx );
    3974           0 :   return self;
    3975           0 : }
    3976           0 : int fd_vote_encode( fd_vote_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3977           0 :   int err;
    3978           0 :   if( self->slots ) {
    3979           0 :     ulong slots_len = deq_ulong_cnt( self->slots );
    3980           0 :     err = fd_bincode_uint64_encode( slots_len, ctx );
    3981           0 :     if( FD_UNLIKELY( err ) ) return err;
    3982           0 :     for( deq_ulong_iter_t iter = deq_ulong_iter_init( self->slots ); !deq_ulong_iter_done( self->slots, iter ); iter = deq_ulong_iter_next( self->slots, iter ) ) {
    3983           0 :       ulong const * ele = deq_ulong_iter_ele_const( self->slots, iter );
    3984           0 :       err = fd_bincode_uint64_encode( ele[0], ctx );
    3985           0 :     }
    3986           0 :   } else {
    3987           0 :     ulong slots_len = 0;
    3988           0 :     err = fd_bincode_uint64_encode( slots_len, ctx );
    3989           0 :     if( FD_UNLIKELY( err ) ) return err;
    3990           0 :   }
    3991           0 :   err = fd_hash_encode( &self->hash, ctx );
    3992           0 :   if( FD_UNLIKELY( err ) ) return err;
    3993           0 :   err = fd_bincode_bool_encode( self->has_timestamp, ctx );
    3994           0 :   if( FD_UNLIKELY( err ) ) return err;
    3995           0 :   if( self->has_timestamp ) {
    3996           0 :     err = fd_bincode_int64_encode( self->timestamp, ctx );
    3997           0 :     if( FD_UNLIKELY( err ) ) return err;
    3998           0 :   }
    3999           0 :   return FD_BINCODE_SUCCESS;
    4000           0 : }
    4001           0 : static int fd_vote_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4002           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4003           0 :   int err = 0;
    4004           0 :   ulong slots_len;
    4005           0 :   err = fd_bincode_uint64_decode( &slots_len, ctx );
    4006           0 :   if( FD_UNLIKELY( err ) ) return err;
    4007           0 :   ulong slots_max = slots_len == 0 ? 1 : slots_len;
    4008           0 :   *total_sz += deq_ulong_align() + deq_ulong_footprint( slots_max ) ;
    4009           0 :   ulong slots_sz;
    4010           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( slots_len, 8, &slots_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    4011           0 :   err = fd_bincode_bytes_decode_footprint( slots_sz, ctx );
    4012           0 :   if( FD_UNLIKELY( err ) ) return err;
    4013           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    4014           0 :   if( FD_UNLIKELY( err ) ) return err;
    4015           0 :   {
    4016           0 :     uchar o;
    4017           0 :     err = fd_bincode_bool_decode( &o, ctx );
    4018           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4019           0 :     if( o ) {
    4020           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    4021           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4022           0 :     }
    4023           0 :   }
    4024           0 :   return 0;
    4025           0 : }
    4026           0 : int fd_vote_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4027           0 :   *total_sz += sizeof(fd_vote_t);
    4028           0 :   void const * start_data = ctx->data;
    4029           0 :   int err = fd_vote_decode_footprint_inner( ctx, total_sz );
    4030           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4031           0 :   ctx->data = start_data;
    4032           0 :   return err;
    4033           0 : }
    4034           0 : static void fd_vote_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4035           0 :   fd_vote_t * self = (fd_vote_t *)struct_mem;
    4036           0 :   ulong slots_len;
    4037           0 :   fd_bincode_uint64_decode_unsafe( &slots_len, ctx );
    4038           0 :   self->slots = deq_ulong_join_new( alloc_mem, slots_len );
    4039           0 :   for( ulong i=0; i < slots_len; i++ ) {
    4040           0 :     ulong * elem = deq_ulong_push_tail_nocopy( self->slots );
    4041           0 :     fd_bincode_uint64_decode_unsafe( elem, ctx );
    4042           0 :   }
    4043           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    4044           0 :   {
    4045           0 :     uchar o;
    4046           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    4047           0 :     self->has_timestamp = !!o;
    4048           0 :     if( o ) {
    4049           0 :       fd_bincode_int64_decode_unsafe( &self->timestamp, ctx );
    4050           0 :     }
    4051           0 :   }
    4052           0 : }
    4053           0 : void * fd_vote_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4054           0 :   fd_vote_t * self = (fd_vote_t *)mem;
    4055           0 :   fd_vote_new( self );
    4056           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_t);
    4057           0 :   void * * alloc_mem = &alloc_region;
    4058           0 :   fd_vote_decode_inner( mem, alloc_mem, ctx );
    4059           0 :   return self;
    4060           0 : }
    4061           0 : void fd_vote_new(fd_vote_t * self) {
    4062           0 :   fd_memset( self, 0, sizeof(fd_vote_t) );
    4063           0 :   fd_hash_new( &self->hash );
    4064           0 : }
    4065           0 : ulong fd_vote_size( fd_vote_t const * self ) {
    4066           0 :   ulong size = 0;
    4067           0 :   if( self->slots ) {
    4068           0 :     size += sizeof(ulong);
    4069           0 :     ulong slots_len = deq_ulong_cnt(self->slots);
    4070           0 :     size += slots_len * sizeof(ulong);
    4071           0 :   } else {
    4072           0 :     size += sizeof(ulong);
    4073           0 :   }
    4074           0 :   size += fd_hash_size( &self->hash );
    4075           0 :   size += sizeof(char);
    4076           0 :   if( self->has_timestamp ) {
    4077           0 :     size += sizeof(long);
    4078           0 :   }
    4079           0 :   return size;
    4080           0 : }
    4081             : 
    4082           0 : int fd_vote_init_encode( fd_vote_init_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4083           0 :   int err;
    4084           0 :   err = fd_pubkey_encode( &self->node_pubkey, ctx );
    4085           0 :   if( FD_UNLIKELY( err ) ) return err;
    4086           0 :   err = fd_pubkey_encode( &self->authorized_voter, ctx );
    4087           0 :   if( FD_UNLIKELY( err ) ) return err;
    4088           0 :   err = fd_pubkey_encode( &self->authorized_withdrawer, ctx );
    4089           0 :   if( FD_UNLIKELY( err ) ) return err;
    4090           0 :   err = fd_bincode_uint8_encode( (uchar)(self->commission), ctx );
    4091           0 :   if( FD_UNLIKELY( err ) ) return err;
    4092           0 :   return FD_BINCODE_SUCCESS;
    4093           0 : }
    4094           6 : static inline int fd_vote_init_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4095           6 :   if( (ulong)ctx->data + 97UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4096           6 :   ctx->data = (void *)( (ulong)ctx->data + 97UL );
    4097           6 :   return 0;
    4098           6 : }
    4099           6 : static void fd_vote_init_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4100           6 :   fd_vote_init_t * self = (fd_vote_init_t *)struct_mem;
    4101           6 :   fd_pubkey_decode_inner( &self->node_pubkey, alloc_mem, ctx );
    4102           6 :   fd_pubkey_decode_inner( &self->authorized_voter, alloc_mem, ctx );
    4103           6 :   fd_pubkey_decode_inner( &self->authorized_withdrawer, alloc_mem, ctx );
    4104           6 :   fd_bincode_uint8_decode_unsafe( &self->commission, ctx );
    4105           6 : }
    4106           0 : void * fd_vote_init_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4107           0 :   fd_vote_init_t * self = (fd_vote_init_t *)mem;
    4108           0 :   fd_vote_init_new( self );
    4109           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_init_t);
    4110           0 :   void * * alloc_mem = &alloc_region;
    4111           0 :   fd_vote_init_decode_inner( mem, alloc_mem, ctx );
    4112           0 :   return self;
    4113           0 : }
    4114           0 : int fd_vote_init_v2_encode( fd_vote_init_v2_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4115           0 :   int err;
    4116           0 :   err = fd_pubkey_encode( &self->node_pubkey, ctx );
    4117           0 :   if( FD_UNLIKELY( err ) ) return err;
    4118           0 :   err = fd_pubkey_encode( &self->authorized_voter, ctx );
    4119           0 :   if( FD_UNLIKELY( err ) ) return err;
    4120           0 :   err = fd_bls_pubkey_compressed_encode( &self->authorized_voter_bls_pubkey, ctx );
    4121           0 :   if( FD_UNLIKELY( err ) ) return err;
    4122           0 :   err = fd_bls_proof_of_possession_encode( &self->authorized_voter_bls_proof_of_possession, ctx );
    4123           0 :   if( FD_UNLIKELY( err ) ) return err;
    4124           0 :   err = fd_pubkey_encode( &self->authorized_withdrawer, ctx );
    4125           0 :   if( FD_UNLIKELY( err ) ) return err;
    4126           0 :   err = fd_bincode_uint16_encode( self->inflation_rewards_commission_bps, ctx );
    4127           0 :   if( FD_UNLIKELY( err ) ) return err;
    4128           0 :   err = fd_pubkey_encode( &self->inflation_rewards_collector, ctx );
    4129           0 :   if( FD_UNLIKELY( err ) ) return err;
    4130           0 :   err = fd_bincode_uint16_encode( self->block_revenue_commission_bps, ctx );
    4131           0 :   if( FD_UNLIKELY( err ) ) return err;
    4132           0 :   err = fd_pubkey_encode( &self->block_revenue_collector, ctx );
    4133           0 :   if( FD_UNLIKELY( err ) ) return err;
    4134           0 :   return FD_BINCODE_SUCCESS;
    4135           0 : }
    4136           6 : static inline int fd_vote_init_v2_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4137           6 :   if( (ulong)ctx->data + 308UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4138           6 :   ctx->data = (void *)( (ulong)ctx->data + 308UL );
    4139           6 :   return 0;
    4140           6 : }
    4141           6 : static void fd_vote_init_v2_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4142           6 :   fd_vote_init_v2_t * self = (fd_vote_init_v2_t *)struct_mem;
    4143           6 :   fd_pubkey_decode_inner( &self->node_pubkey, alloc_mem, ctx );
    4144           6 :   fd_pubkey_decode_inner( &self->authorized_voter, alloc_mem, ctx );
    4145           6 :   fd_bls_pubkey_compressed_decode_inner( &self->authorized_voter_bls_pubkey, alloc_mem, ctx );
    4146           6 :   fd_bls_proof_of_possession_decode_inner( &self->authorized_voter_bls_proof_of_possession, alloc_mem, ctx );
    4147           6 :   fd_pubkey_decode_inner( &self->authorized_withdrawer, alloc_mem, ctx );
    4148           6 :   fd_bincode_uint16_decode_unsafe( &self->inflation_rewards_commission_bps, ctx );
    4149           6 :   fd_pubkey_decode_inner( &self->inflation_rewards_collector, alloc_mem, ctx );
    4150           6 :   fd_bincode_uint16_decode_unsafe( &self->block_revenue_commission_bps, ctx );
    4151           6 :   fd_pubkey_decode_inner( &self->block_revenue_collector, alloc_mem, ctx );
    4152           6 : }
    4153           0 : void * fd_vote_init_v2_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4154           0 :   fd_vote_init_v2_t * self = (fd_vote_init_v2_t *)mem;
    4155           0 :   fd_vote_init_v2_new( self );
    4156           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_init_v2_t);
    4157           0 :   void * * alloc_mem = &alloc_region;
    4158           0 :   fd_vote_init_v2_decode_inner( mem, alloc_mem, ctx );
    4159           0 :   return self;
    4160           0 : }
    4161           0 : int fd_voter_with_bls_args_encode( fd_voter_with_bls_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4162           0 :   int err;
    4163           0 :   err = fd_bls_pubkey_compressed_encode( &self->bls_pubkey, ctx );
    4164           0 :   if( FD_UNLIKELY( err ) ) return err;
    4165           0 :   err = fd_bls_proof_of_possession_encode( &self->bls_proof_of_possession, ctx );
    4166           0 :   if( FD_UNLIKELY( err ) ) return err;
    4167           0 :   return FD_BINCODE_SUCCESS;
    4168           0 : }
    4169           0 : static inline int fd_voter_with_bls_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4170           0 :   if( (ulong)ctx->data + 144UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4171           0 :   ctx->data = (void *)( (ulong)ctx->data + 144UL );
    4172           0 :   return 0;
    4173           0 : }
    4174           0 : static void fd_voter_with_bls_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4175           0 :   fd_voter_with_bls_args_t * self = (fd_voter_with_bls_args_t *)struct_mem;
    4176           0 :   fd_bls_pubkey_compressed_decode_inner( &self->bls_pubkey, alloc_mem, ctx );
    4177           0 :   fd_bls_proof_of_possession_decode_inner( &self->bls_proof_of_possession, alloc_mem, ctx );
    4178           0 : }
    4179           0 : void * fd_voter_with_bls_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4180           0 :   fd_voter_with_bls_args_t * self = (fd_voter_with_bls_args_t *)mem;
    4181           0 :   fd_voter_with_bls_args_new( self );
    4182           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_voter_with_bls_args_t);
    4183           0 :   void * * alloc_mem = &alloc_region;
    4184           0 :   fd_voter_with_bls_args_decode_inner( mem, alloc_mem, ctx );
    4185           0 :   return self;
    4186           0 : }
    4187           0 : FD_FN_PURE uchar fd_vote_authorize_is_voter(fd_vote_authorize_t const * self) {
    4188           0 :   return self->discriminant == 0;
    4189           0 : }
    4190           0 : FD_FN_PURE uchar fd_vote_authorize_is_withdrawer(fd_vote_authorize_t const * self) {
    4191           0 :   return self->discriminant == 1;
    4192           0 : }
    4193           0 : FD_FN_PURE uchar fd_vote_authorize_is_voter_with_bls(fd_vote_authorize_t const * self) {
    4194           0 :   return self->discriminant == 2;
    4195           0 : }
    4196             : void fd_vote_authorize_inner_new( fd_vote_authorize_inner_t * self, uint discriminant );
    4197           0 : int fd_vote_authorize_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4198           0 :   int err;
    4199           0 :   switch (discriminant) {
    4200           0 :   case 0: {
    4201           0 :     return FD_BINCODE_SUCCESS;
    4202           0 :   }
    4203           0 :   case 1: {
    4204           0 :     return FD_BINCODE_SUCCESS;
    4205           0 :   }
    4206           0 :   case 2: {
    4207           0 :     err = fd_voter_with_bls_args_decode_footprint_inner( ctx, total_sz );
    4208           0 :     if( FD_UNLIKELY( err ) ) return err;
    4209           0 :     return FD_BINCODE_SUCCESS;
    4210           0 :   }
    4211           0 :   default: return FD_BINCODE_ERR_ENCODING;
    4212           0 :   }
    4213           0 : }
    4214           0 : static int fd_vote_authorize_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4215           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4216           0 :   uint discriminant = 0;
    4217           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    4218           0 :   if( FD_UNLIKELY( err ) ) return err;
    4219           0 :   return fd_vote_authorize_inner_decode_footprint( discriminant, ctx, total_sz );
    4220           0 : }
    4221           0 : int fd_vote_authorize_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4222           0 :   *total_sz += sizeof(fd_vote_authorize_t);
    4223           0 :   void const * start_data = ctx->data;
    4224           0 :   int err =  fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4225           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4226           0 :   ctx->data = start_data;
    4227           0 :   return err;
    4228           0 : }
    4229           0 : static void fd_vote_authorize_inner_decode_inner( fd_vote_authorize_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    4230           0 :   switch (discriminant) {
    4231           0 :   case 0: {
    4232           0 :     break;
    4233           0 :   }
    4234           0 :   case 1: {
    4235           0 :     break;
    4236           0 :   }
    4237           0 :   case 2: {
    4238           0 :     fd_voter_with_bls_args_decode_inner( &self->voter_with_bls, alloc_mem, ctx );
    4239           0 :     break;
    4240           0 :   }
    4241           0 :   }
    4242           0 : }
    4243           0 : static void fd_vote_authorize_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4244           0 :   fd_vote_authorize_t * self = (fd_vote_authorize_t *)struct_mem;
    4245           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    4246           0 :   fd_vote_authorize_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    4247           0 : }
    4248           0 : void * fd_vote_authorize_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4249           0 :   fd_vote_authorize_t * self = (fd_vote_authorize_t *)mem;
    4250           0 :   fd_vote_authorize_new( self );
    4251           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorize_t);
    4252           0 :   void * * alloc_mem = &alloc_region;
    4253           0 :   fd_vote_authorize_decode_inner( mem, alloc_mem, ctx );
    4254           0 :   return self;
    4255           0 : }
    4256           0 : void fd_vote_authorize_inner_new( fd_vote_authorize_inner_t * self, uint discriminant ) {
    4257           0 :   switch( discriminant ) {
    4258           0 :   case 0: {
    4259           0 :     break;
    4260           0 :   }
    4261           0 :   case 1: {
    4262           0 :     break;
    4263           0 :   }
    4264           0 :   case 2: {
    4265           0 :     fd_voter_with_bls_args_new( &self->voter_with_bls );
    4266           0 :     break;
    4267           0 :   }
    4268           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    4269           0 :   }
    4270           0 : }
    4271           0 : void fd_vote_authorize_new_disc( fd_vote_authorize_t * self, uint discriminant ) {
    4272           0 :   self->discriminant = discriminant;
    4273           0 :   fd_vote_authorize_inner_new( &self->inner, self->discriminant );
    4274           0 : }
    4275           0 : void fd_vote_authorize_new( fd_vote_authorize_t * self ) {
    4276           0 :   fd_memset( self, 0, sizeof(fd_vote_authorize_t) );
    4277           0 :   fd_vote_authorize_new_disc( self, UINT_MAX );
    4278           0 : }
    4279             : 
    4280           0 : ulong fd_vote_authorize_size( fd_vote_authorize_t const * self ) {
    4281           0 :   ulong size = 0;
    4282           0 :   size += sizeof(uint);
    4283           0 :   switch (self->discriminant) {
    4284           0 :   case 2: {
    4285           0 :     size += fd_voter_with_bls_args_size( &self->inner.voter_with_bls );
    4286           0 :     break;
    4287           0 :   }
    4288           0 :   }
    4289           0 :   return size;
    4290           0 : }
    4291             : 
    4292           0 : int fd_vote_authorize_inner_encode( fd_vote_authorize_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    4293           0 :   int err;
    4294           0 :   switch (discriminant) {
    4295           0 :   case 2: {
    4296           0 :     err = fd_voter_with_bls_args_encode( &self->voter_with_bls, ctx );
    4297           0 :     if( FD_UNLIKELY( err ) ) return err;
    4298           0 :     break;
    4299           0 :   }
    4300           0 :   }
    4301           0 :   return FD_BINCODE_SUCCESS;
    4302           0 : }
    4303           0 : int fd_vote_authorize_encode( fd_vote_authorize_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4304           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    4305           0 :   if( FD_UNLIKELY( err ) ) return err;
    4306           0 :   return fd_vote_authorize_inner_encode( &self->inner, self->discriminant, ctx );
    4307           0 : }
    4308             : 
    4309           0 : int fd_vote_authorize_pubkey_encode( fd_vote_authorize_pubkey_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4310           0 :   int err;
    4311           0 :   err = fd_pubkey_encode( &self->pubkey, ctx );
    4312           0 :   if( FD_UNLIKELY( err ) ) return err;
    4313           0 :   err = fd_vote_authorize_encode( &self->vote_authorize, ctx );
    4314           0 :   if( FD_UNLIKELY( err ) ) return err;
    4315           0 :   return FD_BINCODE_SUCCESS;
    4316           0 : }
    4317           0 : static int fd_vote_authorize_pubkey_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4318           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4319           0 :   int err = 0;
    4320           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    4321           0 :   if( FD_UNLIKELY( err ) ) return err;
    4322           0 :   err = fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4323           0 :   if( FD_UNLIKELY( err ) ) return err;
    4324           0 :   return 0;
    4325           0 : }
    4326           0 : int fd_vote_authorize_pubkey_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4327           0 :   *total_sz += sizeof(fd_vote_authorize_pubkey_t);
    4328           0 :   void const * start_data = ctx->data;
    4329           0 :   int err = fd_vote_authorize_pubkey_decode_footprint_inner( ctx, total_sz );
    4330           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4331           0 :   ctx->data = start_data;
    4332           0 :   return err;
    4333           0 : }
    4334           0 : static void fd_vote_authorize_pubkey_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4335           0 :   fd_vote_authorize_pubkey_t * self = (fd_vote_authorize_pubkey_t *)struct_mem;
    4336           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
    4337           0 :   fd_vote_authorize_decode_inner( &self->vote_authorize, alloc_mem, ctx );
    4338           0 : }
    4339           0 : void * fd_vote_authorize_pubkey_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4340           0 :   fd_vote_authorize_pubkey_t * self = (fd_vote_authorize_pubkey_t *)mem;
    4341           0 :   fd_vote_authorize_pubkey_new( self );
    4342           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorize_pubkey_t);
    4343           0 :   void * * alloc_mem = &alloc_region;
    4344           0 :   fd_vote_authorize_pubkey_decode_inner( mem, alloc_mem, ctx );
    4345           0 :   return self;
    4346           0 : }
    4347           0 : void fd_vote_authorize_pubkey_new(fd_vote_authorize_pubkey_t * self) {
    4348           0 :   fd_memset( self, 0, sizeof(fd_vote_authorize_pubkey_t) );
    4349           0 :   fd_pubkey_new( &self->pubkey );
    4350           0 :   fd_vote_authorize_new( &self->vote_authorize );
    4351           0 : }
    4352           0 : ulong fd_vote_authorize_pubkey_size( fd_vote_authorize_pubkey_t const * self ) {
    4353           0 :   ulong size = 0;
    4354           0 :   size += fd_pubkey_size( &self->pubkey );
    4355           0 :   size += fd_vote_authorize_size( &self->vote_authorize );
    4356           0 :   return size;
    4357           0 : }
    4358             : 
    4359           0 : int fd_vote_switch_encode( fd_vote_switch_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4360           0 :   int err;
    4361           0 :   err = fd_vote_encode( &self->vote, ctx );
    4362           0 :   if( FD_UNLIKELY( err ) ) return err;
    4363           0 :   err = fd_hash_encode( &self->hash, ctx );
    4364           0 :   if( FD_UNLIKELY( err ) ) return err;
    4365           0 :   return FD_BINCODE_SUCCESS;
    4366           0 : }
    4367           0 : static int fd_vote_switch_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4368           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4369           0 :   int err = 0;
    4370           0 :   err = fd_vote_decode_footprint_inner( ctx, total_sz );
    4371           0 :   if( FD_UNLIKELY( err ) ) return err;
    4372           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    4373           0 :   if( FD_UNLIKELY( err ) ) return err;
    4374           0 :   return 0;
    4375           0 : }
    4376           0 : int fd_vote_switch_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4377           0 :   *total_sz += sizeof(fd_vote_switch_t);
    4378           0 :   void const * start_data = ctx->data;
    4379           0 :   int err = fd_vote_switch_decode_footprint_inner( ctx, total_sz );
    4380           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4381           0 :   ctx->data = start_data;
    4382           0 :   return err;
    4383           0 : }
    4384           0 : static void fd_vote_switch_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4385           0 :   fd_vote_switch_t * self = (fd_vote_switch_t *)struct_mem;
    4386           0 :   fd_vote_decode_inner( &self->vote, alloc_mem, ctx );
    4387           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    4388           0 : }
    4389           0 : void * fd_vote_switch_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4390           0 :   fd_vote_switch_t * self = (fd_vote_switch_t *)mem;
    4391           0 :   fd_vote_switch_new( self );
    4392           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_switch_t);
    4393           0 :   void * * alloc_mem = &alloc_region;
    4394           0 :   fd_vote_switch_decode_inner( mem, alloc_mem, ctx );
    4395           0 :   return self;
    4396           0 : }
    4397           0 : void fd_vote_switch_new(fd_vote_switch_t * self) {
    4398           0 :   fd_memset( self, 0, sizeof(fd_vote_switch_t) );
    4399           0 :   fd_vote_new( &self->vote );
    4400           0 :   fd_hash_new( &self->hash );
    4401           0 : }
    4402           0 : ulong fd_vote_switch_size( fd_vote_switch_t const * self ) {
    4403           0 :   ulong size = 0;
    4404           0 :   size += fd_vote_size( &self->vote );
    4405           0 :   size += fd_hash_size( &self->hash );
    4406           0 :   return size;
    4407           0 : }
    4408             : 
    4409           0 : int fd_update_vote_state_switch_encode( fd_update_vote_state_switch_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4410           0 :   int err;
    4411           0 :   err = fd_vote_state_update_encode( &self->vote_state_update, ctx );
    4412           0 :   if( FD_UNLIKELY( err ) ) return err;
    4413           0 :   err = fd_hash_encode( &self->hash, ctx );
    4414           0 :   if( FD_UNLIKELY( err ) ) return err;
    4415           0 :   return FD_BINCODE_SUCCESS;
    4416           0 : }
    4417           0 : static int fd_update_vote_state_switch_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4418           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4419           0 :   int err = 0;
    4420           0 :   err = fd_vote_state_update_decode_footprint_inner( ctx, total_sz );
    4421           0 :   if( FD_UNLIKELY( err ) ) return err;
    4422           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    4423           0 :   if( FD_UNLIKELY( err ) ) return err;
    4424           0 :   return 0;
    4425           0 : }
    4426           0 : int fd_update_vote_state_switch_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4427           0 :   *total_sz += sizeof(fd_update_vote_state_switch_t);
    4428           0 :   void const * start_data = ctx->data;
    4429           0 :   int err = fd_update_vote_state_switch_decode_footprint_inner( ctx, total_sz );
    4430           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4431           0 :   ctx->data = start_data;
    4432           0 :   return err;
    4433           0 : }
    4434           0 : static void fd_update_vote_state_switch_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4435           0 :   fd_update_vote_state_switch_t * self = (fd_update_vote_state_switch_t *)struct_mem;
    4436           0 :   fd_vote_state_update_decode_inner( &self->vote_state_update, alloc_mem, ctx );
    4437           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    4438           0 : }
    4439           0 : void * fd_update_vote_state_switch_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4440           0 :   fd_update_vote_state_switch_t * self = (fd_update_vote_state_switch_t *)mem;
    4441           0 :   fd_update_vote_state_switch_new( self );
    4442           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_update_vote_state_switch_t);
    4443           0 :   void * * alloc_mem = &alloc_region;
    4444           0 :   fd_update_vote_state_switch_decode_inner( mem, alloc_mem, ctx );
    4445           0 :   return self;
    4446           0 : }
    4447           0 : void fd_update_vote_state_switch_new(fd_update_vote_state_switch_t * self) {
    4448           0 :   fd_memset( self, 0, sizeof(fd_update_vote_state_switch_t) );
    4449           0 :   fd_vote_state_update_new( &self->vote_state_update );
    4450           0 :   fd_hash_new( &self->hash );
    4451           0 : }
    4452           0 : ulong fd_update_vote_state_switch_size( fd_update_vote_state_switch_t const * self ) {
    4453           0 :   ulong size = 0;
    4454           0 :   size += fd_vote_state_update_size( &self->vote_state_update );
    4455           0 :   size += fd_hash_size( &self->hash );
    4456           0 :   return size;
    4457           0 : }
    4458             : 
    4459           0 : int fd_vote_authorize_with_seed_args_encode( fd_vote_authorize_with_seed_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4460           0 :   int err;
    4461           0 :   err = fd_vote_authorize_encode( &self->authorization_type, ctx );
    4462           0 :   if( FD_UNLIKELY( err ) ) return err;
    4463           0 :   err = fd_pubkey_encode( &self->current_authority_derived_key_owner, ctx );
    4464           0 :   if( FD_UNLIKELY( err ) ) return err;
    4465           0 :   err = fd_bincode_uint64_encode( self->current_authority_derived_key_seed_len, ctx );
    4466           0 :   if( FD_UNLIKELY(err) ) return err;
    4467           0 :   if( self->current_authority_derived_key_seed_len ) {
    4468           0 :     err = fd_bincode_bytes_encode( self->current_authority_derived_key_seed, self->current_authority_derived_key_seed_len, ctx );
    4469           0 :     if( FD_UNLIKELY( err ) ) return err;
    4470           0 :   }
    4471           0 :   err = fd_pubkey_encode( &self->new_authority, ctx );
    4472           0 :   if( FD_UNLIKELY( err ) ) return err;
    4473           0 :   return FD_BINCODE_SUCCESS;
    4474           0 : }
    4475           0 : static int fd_vote_authorize_with_seed_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4476           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4477           0 :   int err = 0;
    4478           0 :   err = fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4479           0 :   if( FD_UNLIKELY( err ) ) return err;
    4480           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    4481           0 :   if( FD_UNLIKELY( err ) ) return err;
    4482           0 :   ulong current_authority_derived_key_seed_len;
    4483           0 :   err = fd_bincode_uint64_decode( &current_authority_derived_key_seed_len, ctx );
    4484           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4485           0 :   *total_sz += current_authority_derived_key_seed_len;
    4486           0 :   if( current_authority_derived_key_seed_len ) {
    4487           0 :     err = fd_bincode_bytes_decode_footprint( current_authority_derived_key_seed_len, ctx );
    4488           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4489           0 :     err = !fd_utf8_verify( (char const *) ctx->data - current_authority_derived_key_seed_len, current_authority_derived_key_seed_len );
    4490           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4491           0 :   }
    4492           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    4493           0 :   if( FD_UNLIKELY( err ) ) return err;
    4494           0 :   return 0;
    4495           0 : }
    4496           0 : int fd_vote_authorize_with_seed_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4497           0 :   *total_sz += sizeof(fd_vote_authorize_with_seed_args_t);
    4498           0 :   void const * start_data = ctx->data;
    4499           0 :   int err = fd_vote_authorize_with_seed_args_decode_footprint_inner( ctx, total_sz );
    4500           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4501           0 :   ctx->data = start_data;
    4502           0 :   return err;
    4503           0 : }
    4504           0 : static void fd_vote_authorize_with_seed_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4505           0 :   fd_vote_authorize_with_seed_args_t * self = (fd_vote_authorize_with_seed_args_t *)struct_mem;
    4506           0 :   fd_vote_authorize_decode_inner( &self->authorization_type, alloc_mem, ctx );
    4507           0 :   fd_pubkey_decode_inner( &self->current_authority_derived_key_owner, alloc_mem, ctx );
    4508           0 :   fd_bincode_uint64_decode_unsafe( &self->current_authority_derived_key_seed_len, ctx );
    4509           0 :   if( self->current_authority_derived_key_seed_len ) {
    4510           0 :     self->current_authority_derived_key_seed = *alloc_mem;
    4511           0 :     fd_bincode_bytes_decode_unsafe( self->current_authority_derived_key_seed, self->current_authority_derived_key_seed_len, ctx );
    4512           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->current_authority_derived_key_seed_len;
    4513           0 :   } else
    4514           0 :     self->current_authority_derived_key_seed = NULL;
    4515           0 :   fd_pubkey_decode_inner( &self->new_authority, alloc_mem, ctx );
    4516           0 : }
    4517           0 : void * fd_vote_authorize_with_seed_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4518           0 :   fd_vote_authorize_with_seed_args_t * self = (fd_vote_authorize_with_seed_args_t *)mem;
    4519           0 :   fd_vote_authorize_with_seed_args_new( self );
    4520           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorize_with_seed_args_t);
    4521           0 :   void * * alloc_mem = &alloc_region;
    4522           0 :   fd_vote_authorize_with_seed_args_decode_inner( mem, alloc_mem, ctx );
    4523           0 :   return self;
    4524           0 : }
    4525           0 : void fd_vote_authorize_with_seed_args_new(fd_vote_authorize_with_seed_args_t * self) {
    4526           0 :   fd_memset( self, 0, sizeof(fd_vote_authorize_with_seed_args_t) );
    4527           0 :   fd_vote_authorize_new( &self->authorization_type );
    4528           0 :   fd_pubkey_new( &self->current_authority_derived_key_owner );
    4529           0 :   fd_pubkey_new( &self->new_authority );
    4530           0 : }
    4531           0 : ulong fd_vote_authorize_with_seed_args_size( fd_vote_authorize_with_seed_args_t const * self ) {
    4532           0 :   ulong size = 0;
    4533           0 :   size += fd_vote_authorize_size( &self->authorization_type );
    4534           0 :   size += fd_pubkey_size( &self->current_authority_derived_key_owner );
    4535           0 :   do {
    4536           0 :     size += sizeof(ulong);
    4537           0 :     size += self->current_authority_derived_key_seed_len;
    4538           0 :   } while(0);
    4539           0 :   size += fd_pubkey_size( &self->new_authority );
    4540           0 :   return size;
    4541           0 : }
    4542             : 
    4543           0 : int fd_vote_authorize_checked_with_seed_args_encode( fd_vote_authorize_checked_with_seed_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4544           0 :   int err;
    4545           0 :   err = fd_vote_authorize_encode( &self->authorization_type, ctx );
    4546           0 :   if( FD_UNLIKELY( err ) ) return err;
    4547           0 :   err = fd_pubkey_encode( &self->current_authority_derived_key_owner, ctx );
    4548           0 :   if( FD_UNLIKELY( err ) ) return err;
    4549           0 :   err = fd_bincode_uint64_encode( self->current_authority_derived_key_seed_len, ctx );
    4550           0 :   if( FD_UNLIKELY(err) ) return err;
    4551           0 :   if( self->current_authority_derived_key_seed_len ) {
    4552           0 :     err = fd_bincode_bytes_encode( self->current_authority_derived_key_seed, self->current_authority_derived_key_seed_len, ctx );
    4553           0 :     if( FD_UNLIKELY( err ) ) return err;
    4554           0 :   }
    4555           0 :   return FD_BINCODE_SUCCESS;
    4556           0 : }
    4557           0 : static int fd_vote_authorize_checked_with_seed_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4558           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4559           0 :   int err = 0;
    4560           0 :   err = fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4561           0 :   if( FD_UNLIKELY( err ) ) return err;
    4562           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    4563           0 :   if( FD_UNLIKELY( err ) ) return err;
    4564           0 :   ulong current_authority_derived_key_seed_len;
    4565           0 :   err = fd_bincode_uint64_decode( &current_authority_derived_key_seed_len, ctx );
    4566           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4567           0 :   *total_sz += current_authority_derived_key_seed_len;
    4568           0 :   if( current_authority_derived_key_seed_len ) {
    4569           0 :     err = fd_bincode_bytes_decode_footprint( current_authority_derived_key_seed_len, ctx );
    4570           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4571           0 :     err = !fd_utf8_verify( (char const *) ctx->data - current_authority_derived_key_seed_len, current_authority_derived_key_seed_len );
    4572           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4573           0 :   }
    4574           0 :   return 0;
    4575           0 : }
    4576           0 : int fd_vote_authorize_checked_with_seed_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4577           0 :   *total_sz += sizeof(fd_vote_authorize_checked_with_seed_args_t);
    4578           0 :   void const * start_data = ctx->data;
    4579           0 :   int err = fd_vote_authorize_checked_with_seed_args_decode_footprint_inner( ctx, total_sz );
    4580           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4581           0 :   ctx->data = start_data;
    4582           0 :   return err;
    4583           0 : }
    4584           0 : static void fd_vote_authorize_checked_with_seed_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4585           0 :   fd_vote_authorize_checked_with_seed_args_t * self = (fd_vote_authorize_checked_with_seed_args_t *)struct_mem;
    4586           0 :   fd_vote_authorize_decode_inner( &self->authorization_type, alloc_mem, ctx );
    4587           0 :   fd_pubkey_decode_inner( &self->current_authority_derived_key_owner, alloc_mem, ctx );
    4588           0 :   fd_bincode_uint64_decode_unsafe( &self->current_authority_derived_key_seed_len, ctx );
    4589           0 :   if( self->current_authority_derived_key_seed_len ) {
    4590           0 :     self->current_authority_derived_key_seed = *alloc_mem;
    4591           0 :     fd_bincode_bytes_decode_unsafe( self->current_authority_derived_key_seed, self->current_authority_derived_key_seed_len, ctx );
    4592           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->current_authority_derived_key_seed_len;
    4593           0 :   } else
    4594           0 :     self->current_authority_derived_key_seed = NULL;
    4595           0 : }
    4596           0 : void * fd_vote_authorize_checked_with_seed_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4597           0 :   fd_vote_authorize_checked_with_seed_args_t * self = (fd_vote_authorize_checked_with_seed_args_t *)mem;
    4598           0 :   fd_vote_authorize_checked_with_seed_args_new( self );
    4599           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorize_checked_with_seed_args_t);
    4600           0 :   void * * alloc_mem = &alloc_region;
    4601           0 :   fd_vote_authorize_checked_with_seed_args_decode_inner( mem, alloc_mem, ctx );
    4602           0 :   return self;
    4603           0 : }
    4604           0 : void fd_vote_authorize_checked_with_seed_args_new(fd_vote_authorize_checked_with_seed_args_t * self) {
    4605           0 :   fd_memset( self, 0, sizeof(fd_vote_authorize_checked_with_seed_args_t) );
    4606           0 :   fd_vote_authorize_new( &self->authorization_type );
    4607           0 :   fd_pubkey_new( &self->current_authority_derived_key_owner );
    4608           0 : }
    4609           0 : ulong fd_vote_authorize_checked_with_seed_args_size( fd_vote_authorize_checked_with_seed_args_t const * self ) {
    4610           0 :   ulong size = 0;
    4611           0 :   size += fd_vote_authorize_size( &self->authorization_type );
    4612           0 :   size += fd_pubkey_size( &self->current_authority_derived_key_owner );
    4613           0 :   do {
    4614           0 :     size += sizeof(ulong);
    4615           0 :     size += self->current_authority_derived_key_seed_len;
    4616           0 :   } while(0);
    4617           0 :   return size;
    4618           0 : }
    4619             : 
    4620           0 : FD_FN_PURE uchar fd_commission_kind_is_inflation_rewards(fd_commission_kind_t const * self) {
    4621           0 :   return self->discriminant == 0;
    4622           0 : }
    4623           0 : FD_FN_PURE uchar fd_commission_kind_is_block_revenue(fd_commission_kind_t const * self) {
    4624           0 :   return self->discriminant == 1;
    4625           0 : }
    4626           0 : int fd_commission_kind_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4627           0 :   int err;
    4628           0 :   switch (discriminant) {
    4629           0 :   case 0: {
    4630           0 :     return FD_BINCODE_SUCCESS;
    4631           0 :   }
    4632           0 :   case 1: {
    4633           0 :     return FD_BINCODE_SUCCESS;
    4634           0 :   }
    4635           0 :   default: return FD_BINCODE_ERR_ENCODING;
    4636           0 :   }
    4637           0 : }
    4638           0 : static int fd_commission_kind_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4639           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4640           0 :   uint discriminant = 0;
    4641           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    4642           0 :   if( FD_UNLIKELY( err ) ) return err;
    4643           0 :   return fd_commission_kind_inner_decode_footprint( discriminant, ctx, total_sz );
    4644           0 : }
    4645           0 : int fd_commission_kind_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4646           0 :   *total_sz += sizeof(fd_commission_kind_t);
    4647           0 :   void const * start_data = ctx->data;
    4648           0 :   int err =  fd_commission_kind_decode_footprint_inner( ctx, total_sz );
    4649           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4650           0 :   ctx->data = start_data;
    4651           0 :   return err;
    4652           0 : }
    4653           0 : static void fd_commission_kind_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4654           0 :   fd_commission_kind_t * self = (fd_commission_kind_t *)struct_mem;
    4655           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    4656           0 : }
    4657           0 : void * fd_commission_kind_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4658           0 :   fd_commission_kind_t * self = (fd_commission_kind_t *)mem;
    4659           0 :   fd_commission_kind_new( self );
    4660           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_commission_kind_t);
    4661           0 :   void * * alloc_mem = &alloc_region;
    4662           0 :   fd_commission_kind_decode_inner( mem, alloc_mem, ctx );
    4663           0 :   return self;
    4664           0 : }
    4665             : 
    4666           0 : ulong fd_commission_kind_size( fd_commission_kind_t const * self ) {
    4667           0 :   ulong size = 0;
    4668           0 :   size += sizeof(uint);
    4669           0 :   switch (self->discriminant) {
    4670           0 :   }
    4671           0 :   return size;
    4672           0 : }
    4673             : 
    4674           0 : int fd_commission_kind_encode( fd_commission_kind_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4675           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    4676           0 :   if( FD_UNLIKELY( err ) ) return err;
    4677           0 :   return err;
    4678           0 : }
    4679             : 
    4680           0 : int fd_update_commission_bps_args_encode( fd_update_commission_bps_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4681           0 :   int err;
    4682           0 :   err = fd_bincode_uint16_encode( self->commission_bps, ctx );
    4683           0 :   if( FD_UNLIKELY( err ) ) return err;
    4684           0 :   err = fd_commission_kind_encode( &self->kind, ctx );
    4685           0 :   if( FD_UNLIKELY( err ) ) return err;
    4686           0 :   return FD_BINCODE_SUCCESS;
    4687           0 : }
    4688           0 : static int fd_update_commission_bps_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4689           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4690           0 :   int err = 0;
    4691           0 :   err = fd_bincode_uint16_decode_footprint( ctx );
    4692           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4693           0 :   err = fd_commission_kind_decode_footprint_inner( ctx, total_sz );
    4694           0 :   if( FD_UNLIKELY( err ) ) return err;
    4695           0 :   return 0;
    4696           0 : }
    4697           0 : int fd_update_commission_bps_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4698           0 :   *total_sz += sizeof(fd_update_commission_bps_args_t);
    4699           0 :   void const * start_data = ctx->data;
    4700           0 :   int err = fd_update_commission_bps_args_decode_footprint_inner( ctx, total_sz );
    4701           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4702           0 :   ctx->data = start_data;
    4703           0 :   return err;
    4704           0 : }
    4705           0 : static void fd_update_commission_bps_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4706           0 :   fd_update_commission_bps_args_t * self = (fd_update_commission_bps_args_t *)struct_mem;
    4707           0 :   fd_bincode_uint16_decode_unsafe( &self->commission_bps, ctx );
    4708           0 :   fd_commission_kind_decode_inner( &self->kind, alloc_mem, ctx );
    4709           0 : }
    4710           0 : void * fd_update_commission_bps_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4711           0 :   fd_update_commission_bps_args_t * self = (fd_update_commission_bps_args_t *)mem;
    4712           0 :   fd_update_commission_bps_args_new( self );
    4713           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_update_commission_bps_args_t);
    4714           0 :   void * * alloc_mem = &alloc_region;
    4715           0 :   fd_update_commission_bps_args_decode_inner( mem, alloc_mem, ctx );
    4716           0 :   return self;
    4717           0 : }
    4718           0 : void fd_update_commission_bps_args_new(fd_update_commission_bps_args_t * self) {
    4719           0 :   fd_memset( self, 0, sizeof(fd_update_commission_bps_args_t) );
    4720           0 :   fd_commission_kind_new( &self->kind );
    4721           0 : }
    4722           0 : int fd_deposit_delegator_rewards_args_encode( fd_deposit_delegator_rewards_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4723           0 :   int err;
    4724           0 :   err = fd_bincode_uint64_encode( self->deposit, ctx );
    4725           0 :   if( FD_UNLIKELY( err ) ) return err;
    4726           0 :   return FD_BINCODE_SUCCESS;
    4727           0 : }
    4728           0 : static inline int fd_deposit_delegator_rewards_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4729           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4730           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
    4731           0 :   return 0;
    4732           0 : }
    4733           0 : static void fd_deposit_delegator_rewards_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4734           0 :   fd_deposit_delegator_rewards_args_t * self = (fd_deposit_delegator_rewards_args_t *)struct_mem;
    4735           0 :   fd_bincode_uint64_decode_unsafe( &self->deposit, ctx );
    4736           0 : }
    4737           0 : void * fd_deposit_delegator_rewards_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4738           0 :   fd_deposit_delegator_rewards_args_t * self = (fd_deposit_delegator_rewards_args_t *)mem;
    4739           0 :   fd_deposit_delegator_rewards_args_new( self );
    4740           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_deposit_delegator_rewards_args_t);
    4741           0 :   void * * alloc_mem = &alloc_region;
    4742           0 :   fd_deposit_delegator_rewards_args_decode_inner( mem, alloc_mem, ctx );
    4743           0 :   return self;
    4744           0 : }
    4745           0 : FD_FN_PURE uchar fd_vote_instruction_is_initialize_account(fd_vote_instruction_t const * self) {
    4746           0 :   return self->discriminant == 0;
    4747           0 : }
    4748           0 : FD_FN_PURE uchar fd_vote_instruction_is_authorize(fd_vote_instruction_t const * self) {
    4749           0 :   return self->discriminant == 1;
    4750           0 : }
    4751           0 : FD_FN_PURE uchar fd_vote_instruction_is_vote(fd_vote_instruction_t const * self) {
    4752           0 :   return self->discriminant == 2;
    4753           0 : }
    4754           0 : FD_FN_PURE uchar fd_vote_instruction_is_withdraw(fd_vote_instruction_t const * self) {
    4755           0 :   return self->discriminant == 3;
    4756           0 : }
    4757           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_validator_identity(fd_vote_instruction_t const * self) {
    4758           0 :   return self->discriminant == 4;
    4759           0 : }
    4760           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_commission(fd_vote_instruction_t const * self) {
    4761           0 :   return self->discriminant == 5;
    4762           0 : }
    4763           0 : FD_FN_PURE uchar fd_vote_instruction_is_vote_switch(fd_vote_instruction_t const * self) {
    4764           0 :   return self->discriminant == 6;
    4765           0 : }
    4766           0 : FD_FN_PURE uchar fd_vote_instruction_is_authorize_checked(fd_vote_instruction_t const * self) {
    4767           0 :   return self->discriminant == 7;
    4768           0 : }
    4769           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_vote_state(fd_vote_instruction_t const * self) {
    4770           0 :   return self->discriminant == 8;
    4771           0 : }
    4772           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_vote_state_switch(fd_vote_instruction_t const * self) {
    4773           0 :   return self->discriminant == 9;
    4774           0 : }
    4775           0 : FD_FN_PURE uchar fd_vote_instruction_is_authorize_with_seed(fd_vote_instruction_t const * self) {
    4776           0 :   return self->discriminant == 10;
    4777           0 : }
    4778           0 : FD_FN_PURE uchar fd_vote_instruction_is_authorize_checked_with_seed(fd_vote_instruction_t const * self) {
    4779           0 :   return self->discriminant == 11;
    4780           0 : }
    4781           0 : FD_FN_PURE uchar fd_vote_instruction_is_compact_update_vote_state(fd_vote_instruction_t const * self) {
    4782           0 :   return self->discriminant == 12;
    4783           0 : }
    4784           0 : FD_FN_PURE uchar fd_vote_instruction_is_compact_update_vote_state_switch(fd_vote_instruction_t const * self) {
    4785           0 :   return self->discriminant == 13;
    4786           0 : }
    4787           0 : FD_FN_PURE uchar fd_vote_instruction_is_tower_sync(fd_vote_instruction_t const * self) {
    4788           0 :   return self->discriminant == 14;
    4789           0 : }
    4790           0 : FD_FN_PURE uchar fd_vote_instruction_is_tower_sync_switch(fd_vote_instruction_t const * self) {
    4791           0 :   return self->discriminant == 15;
    4792           0 : }
    4793           0 : FD_FN_PURE uchar fd_vote_instruction_is_initialize_account_v2(fd_vote_instruction_t const * self) {
    4794           0 :   return self->discriminant == 16;
    4795           0 : }
    4796           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_commission_collector(fd_vote_instruction_t const * self) {
    4797           0 :   return self->discriminant == 17;
    4798           0 : }
    4799           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_commission_bps(fd_vote_instruction_t const * self) {
    4800           0 :   return self->discriminant == 18;
    4801           0 : }
    4802           0 : FD_FN_PURE uchar fd_vote_instruction_is_deposit_delegator_rewards(fd_vote_instruction_t const * self) {
    4803           0 :   return self->discriminant == 19;
    4804           0 : }
    4805             : void fd_vote_instruction_inner_new( fd_vote_instruction_inner_t * self, uint discriminant );
    4806          12 : int fd_vote_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4807          12 :   int err;
    4808          12 :   switch (discriminant) {
    4809           6 :   case 0: {
    4810           6 :     err = fd_vote_init_decode_footprint_inner( ctx, total_sz );
    4811           6 :     if( FD_UNLIKELY( err ) ) return err;
    4812           6 :     return FD_BINCODE_SUCCESS;
    4813           6 :   }
    4814           0 :   case 1: {
    4815           0 :     err = fd_vote_authorize_pubkey_decode_footprint_inner( ctx, total_sz );
    4816           0 :     if( FD_UNLIKELY( err ) ) return err;
    4817           0 :     return FD_BINCODE_SUCCESS;
    4818           0 :   }
    4819           0 :   case 2: {
    4820           0 :     err = fd_vote_decode_footprint_inner( ctx, total_sz );
    4821           0 :     if( FD_UNLIKELY( err ) ) return err;
    4822           0 :     return FD_BINCODE_SUCCESS;
    4823           0 :   }
    4824           0 :   case 3: {
    4825           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    4826           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4827           0 :     return FD_BINCODE_SUCCESS;
    4828           0 :   }
    4829           0 :   case 4: {
    4830           0 :     return FD_BINCODE_SUCCESS;
    4831           0 :   }
    4832           0 :   case 5: {
    4833           0 :     err = fd_bincode_uint8_decode_footprint( ctx );
    4834           0 :   if( FD_UNLIKELY( err ) ) return err;
    4835           0 :     return FD_BINCODE_SUCCESS;
    4836           0 :   }
    4837           0 :   case 6: {
    4838           0 :     err = fd_vote_switch_decode_footprint_inner( ctx, total_sz );
    4839           0 :     if( FD_UNLIKELY( err ) ) return err;
    4840           0 :     return FD_BINCODE_SUCCESS;
    4841           0 :   }
    4842           0 :   case 7: {
    4843           0 :     err = fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4844           0 :     if( FD_UNLIKELY( err ) ) return err;
    4845           0 :     return FD_BINCODE_SUCCESS;
    4846           0 :   }
    4847           0 :   case 8: {
    4848           0 :     err = fd_vote_state_update_decode_footprint_inner( ctx, total_sz );
    4849           0 :     if( FD_UNLIKELY( err ) ) return err;
    4850           0 :     return FD_BINCODE_SUCCESS;
    4851           0 :   }
    4852           0 :   case 9: {
    4853           0 :     err = fd_update_vote_state_switch_decode_footprint_inner( ctx, total_sz );
    4854           0 :     if( FD_UNLIKELY( err ) ) return err;
    4855           0 :     return FD_BINCODE_SUCCESS;
    4856           0 :   }
    4857           0 :   case 10: {
    4858           0 :     err = fd_vote_authorize_with_seed_args_decode_footprint_inner( ctx, total_sz );
    4859           0 :     if( FD_UNLIKELY( err ) ) return err;
    4860           0 :     return FD_BINCODE_SUCCESS;
    4861           0 :   }
    4862           0 :   case 11: {
    4863           0 :     err = fd_vote_authorize_checked_with_seed_args_decode_footprint_inner( ctx, total_sz );
    4864           0 :     if( FD_UNLIKELY( err ) ) return err;
    4865           0 :     return FD_BINCODE_SUCCESS;
    4866           0 :   }
    4867           0 :   case 12: {
    4868           0 :     err = fd_compact_vote_state_update_decode_footprint_inner( ctx, total_sz );
    4869           0 :     if( FD_UNLIKELY( err ) ) return err;
    4870           0 :     return FD_BINCODE_SUCCESS;
    4871           0 :   }
    4872           0 :   case 13: {
    4873           0 :     err = fd_compact_vote_state_update_switch_decode_footprint_inner( ctx, total_sz );
    4874           0 :     if( FD_UNLIKELY( err ) ) return err;
    4875           0 :     return FD_BINCODE_SUCCESS;
    4876           0 :   }
    4877           0 :   case 14: {
    4878           0 :     err = fd_tower_sync_decode_footprint_inner( ctx, total_sz );
    4879           0 :     if( FD_UNLIKELY( err ) ) return err;
    4880           0 :     return FD_BINCODE_SUCCESS;
    4881           0 :   }
    4882           0 :   case 15: {
    4883           0 :     err = fd_tower_sync_switch_decode_footprint_inner( ctx, total_sz );
    4884           0 :     if( FD_UNLIKELY( err ) ) return err;
    4885           0 :     return FD_BINCODE_SUCCESS;
    4886           0 :   }
    4887           6 :   case 16: {
    4888           6 :     err = fd_vote_init_v2_decode_footprint_inner( ctx, total_sz );
    4889           6 :     if( FD_UNLIKELY( err ) ) return err;
    4890           6 :     return FD_BINCODE_SUCCESS;
    4891           6 :   }
    4892           0 :   case 17: {
    4893           0 :     err = fd_commission_kind_decode_footprint_inner( ctx, total_sz );
    4894           0 :     if( FD_UNLIKELY( err ) ) return err;
    4895           0 :     return FD_BINCODE_SUCCESS;
    4896           0 :   }
    4897           0 :   case 18: {
    4898           0 :     err = fd_update_commission_bps_args_decode_footprint_inner( ctx, total_sz );
    4899           0 :     if( FD_UNLIKELY( err ) ) return err;
    4900           0 :     return FD_BINCODE_SUCCESS;
    4901           0 :   }
    4902           0 :   case 19: {
    4903           0 :     err = fd_deposit_delegator_rewards_args_decode_footprint_inner( ctx, total_sz );
    4904           0 :     if( FD_UNLIKELY( err ) ) return err;
    4905           0 :     return FD_BINCODE_SUCCESS;
    4906           0 :   }
    4907           0 :   default: return FD_BINCODE_ERR_ENCODING;
    4908          12 :   }
    4909          12 : }
    4910          12 : static int fd_vote_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4911          12 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4912          12 :   uint discriminant = 0;
    4913          12 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    4914          12 :   if( FD_UNLIKELY( err ) ) return err;
    4915          12 :   return fd_vote_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    4916          12 : }
    4917          12 : int fd_vote_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4918          12 :   *total_sz += sizeof(fd_vote_instruction_t);
    4919          12 :   void const * start_data = ctx->data;
    4920          12 :   int err =  fd_vote_instruction_decode_footprint_inner( ctx, total_sz );
    4921          12 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4922          12 :   ctx->data = start_data;
    4923          12 :   return err;
    4924          12 : }
    4925          12 : static void fd_vote_instruction_inner_decode_inner( fd_vote_instruction_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    4926          12 :   switch (discriminant) {
    4927           6 :   case 0: {
    4928           6 :     fd_vote_init_decode_inner( &self->initialize_account, alloc_mem, ctx );
    4929           6 :     break;
    4930           0 :   }
    4931           0 :   case 1: {
    4932           0 :     fd_vote_authorize_pubkey_decode_inner( &self->authorize, alloc_mem, ctx );
    4933           0 :     break;
    4934           0 :   }
    4935           0 :   case 2: {
    4936           0 :     fd_vote_decode_inner( &self->vote, alloc_mem, ctx );
    4937           0 :     break;
    4938           0 :   }
    4939           0 :   case 3: {
    4940           0 :     fd_bincode_uint64_decode_unsafe( &self->withdraw, ctx );
    4941           0 :     break;
    4942           0 :   }
    4943           0 :   case 4: {
    4944           0 :     break;
    4945           0 :   }
    4946           0 :   case 5: {
    4947           0 :     fd_bincode_uint8_decode_unsafe( &self->update_commission, ctx );
    4948           0 :     break;
    4949           0 :   }
    4950           0 :   case 6: {
    4951           0 :     fd_vote_switch_decode_inner( &self->vote_switch, alloc_mem, ctx );
    4952           0 :     break;
    4953           0 :   }
    4954           0 :   case 7: {
    4955           0 :     fd_vote_authorize_decode_inner( &self->authorize_checked, alloc_mem, ctx );
    4956           0 :     break;
    4957           0 :   }
    4958           0 :   case 8: {
    4959           0 :     fd_vote_state_update_decode_inner( &self->update_vote_state, alloc_mem, ctx );
    4960           0 :     break;
    4961           0 :   }
    4962           0 :   case 9: {
    4963           0 :     fd_update_vote_state_switch_decode_inner( &self->update_vote_state_switch, alloc_mem, ctx );
    4964           0 :     break;
    4965           0 :   }
    4966           0 :   case 10: {
    4967           0 :     fd_vote_authorize_with_seed_args_decode_inner( &self->authorize_with_seed, alloc_mem, ctx );
    4968           0 :     break;
    4969           0 :   }
    4970           0 :   case 11: {
    4971           0 :     fd_vote_authorize_checked_with_seed_args_decode_inner( &self->authorize_checked_with_seed, alloc_mem, ctx );
    4972           0 :     break;
    4973           0 :   }
    4974           0 :   case 12: {
    4975           0 :     fd_compact_vote_state_update_decode_inner( &self->compact_update_vote_state, alloc_mem, ctx );
    4976           0 :     break;
    4977           0 :   }
    4978           0 :   case 13: {
    4979           0 :     fd_compact_vote_state_update_switch_decode_inner( &self->compact_update_vote_state_switch, alloc_mem, ctx );
    4980           0 :     break;
    4981           0 :   }
    4982           0 :   case 14: {
    4983           0 :     fd_tower_sync_decode_inner( &self->tower_sync, alloc_mem, ctx );
    4984           0 :     break;
    4985           0 :   }
    4986           0 :   case 15: {
    4987           0 :     fd_tower_sync_switch_decode_inner( &self->tower_sync_switch, alloc_mem, ctx );
    4988           0 :     break;
    4989           0 :   }
    4990           6 :   case 16: {
    4991           6 :     fd_vote_init_v2_decode_inner( &self->initialize_account_v2, alloc_mem, ctx );
    4992           6 :     break;
    4993           0 :   }
    4994           0 :   case 17: {
    4995           0 :     fd_commission_kind_decode_inner( &self->update_commission_collector, alloc_mem, ctx );
    4996           0 :     break;
    4997           0 :   }
    4998           0 :   case 18: {
    4999           0 :     fd_update_commission_bps_args_decode_inner( &self->update_commission_bps, alloc_mem, ctx );
    5000           0 :     break;
    5001           0 :   }
    5002           0 :   case 19: {
    5003           0 :     fd_deposit_delegator_rewards_args_decode_inner( &self->deposit_delegator_rewards, alloc_mem, ctx );
    5004           0 :     break;
    5005           0 :   }
    5006          12 :   }
    5007          12 : }
    5008          12 : static void fd_vote_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5009          12 :   fd_vote_instruction_t * self = (fd_vote_instruction_t *)struct_mem;
    5010          12 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    5011          12 :   fd_vote_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    5012          12 : }
    5013          12 : void * fd_vote_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5014          12 :   fd_vote_instruction_t * self = (fd_vote_instruction_t *)mem;
    5015          12 :   fd_vote_instruction_new( self );
    5016          12 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_instruction_t);
    5017          12 :   void * * alloc_mem = &alloc_region;
    5018          12 :   fd_vote_instruction_decode_inner( mem, alloc_mem, ctx );
    5019          12 :   return self;
    5020          12 : }
    5021          12 : void fd_vote_instruction_inner_new( fd_vote_instruction_inner_t * self, uint discriminant ) {
    5022          12 :   switch( discriminant ) {
    5023           0 :   case 0: {
    5024           0 :     fd_vote_init_new( &self->initialize_account );
    5025           0 :     break;
    5026           0 :   }
    5027           0 :   case 1: {
    5028           0 :     fd_vote_authorize_pubkey_new( &self->authorize );
    5029           0 :     break;
    5030           0 :   }
    5031           0 :   case 2: {
    5032           0 :     fd_vote_new( &self->vote );
    5033           0 :     break;
    5034           0 :   }
    5035           0 :   case 3: {
    5036           0 :     break;
    5037           0 :   }
    5038           0 :   case 4: {
    5039           0 :     break;
    5040           0 :   }
    5041           0 :   case 5: {
    5042           0 :     break;
    5043           0 :   }
    5044           0 :   case 6: {
    5045           0 :     fd_vote_switch_new( &self->vote_switch );
    5046           0 :     break;
    5047           0 :   }
    5048           0 :   case 7: {
    5049           0 :     fd_vote_authorize_new( &self->authorize_checked );
    5050           0 :     break;
    5051           0 :   }
    5052           0 :   case 8: {
    5053           0 :     fd_vote_state_update_new( &self->update_vote_state );
    5054           0 :     break;
    5055           0 :   }
    5056           0 :   case 9: {
    5057           0 :     fd_update_vote_state_switch_new( &self->update_vote_state_switch );
    5058           0 :     break;
    5059           0 :   }
    5060           0 :   case 10: {
    5061           0 :     fd_vote_authorize_with_seed_args_new( &self->authorize_with_seed );
    5062           0 :     break;
    5063           0 :   }
    5064           0 :   case 11: {
    5065           0 :     fd_vote_authorize_checked_with_seed_args_new( &self->authorize_checked_with_seed );
    5066           0 :     break;
    5067           0 :   }
    5068           0 :   case 12: {
    5069           0 :     fd_compact_vote_state_update_new( &self->compact_update_vote_state );
    5070           0 :     break;
    5071           0 :   }
    5072           0 :   case 13: {
    5073           0 :     fd_compact_vote_state_update_switch_new( &self->compact_update_vote_state_switch );
    5074           0 :     break;
    5075           0 :   }
    5076           0 :   case 14: {
    5077           0 :     fd_tower_sync_new( &self->tower_sync );
    5078           0 :     break;
    5079           0 :   }
    5080           0 :   case 15: {
    5081           0 :     fd_tower_sync_switch_new( &self->tower_sync_switch );
    5082           0 :     break;
    5083           0 :   }
    5084           0 :   case 16: {
    5085           0 :     fd_vote_init_v2_new( &self->initialize_account_v2 );
    5086           0 :     break;
    5087           0 :   }
    5088           0 :   case 17: {
    5089           0 :     fd_commission_kind_new( &self->update_commission_collector );
    5090           0 :     break;
    5091           0 :   }
    5092           0 :   case 18: {
    5093           0 :     fd_update_commission_bps_args_new( &self->update_commission_bps );
    5094           0 :     break;
    5095           0 :   }
    5096           0 :   case 19: {
    5097           0 :     fd_deposit_delegator_rewards_args_new( &self->deposit_delegator_rewards );
    5098           0 :     break;
    5099           0 :   }
    5100          12 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    5101          12 :   }
    5102          12 : }
    5103          12 : void fd_vote_instruction_new_disc( fd_vote_instruction_t * self, uint discriminant ) {
    5104          12 :   self->discriminant = discriminant;
    5105          12 :   fd_vote_instruction_inner_new( &self->inner, self->discriminant );
    5106          12 : }
    5107          12 : void fd_vote_instruction_new( fd_vote_instruction_t * self ) {
    5108          12 :   fd_memset( self, 0, sizeof(fd_vote_instruction_t) );
    5109          12 :   fd_vote_instruction_new_disc( self, UINT_MAX );
    5110          12 : }
    5111             : 
    5112           0 : ulong fd_vote_instruction_size( fd_vote_instruction_t const * self ) {
    5113           0 :   ulong size = 0;
    5114           0 :   size += sizeof(uint);
    5115           0 :   switch (self->discriminant) {
    5116           0 :   case 0: {
    5117           0 :     size += fd_vote_init_size( &self->inner.initialize_account );
    5118           0 :     break;
    5119           0 :   }
    5120           0 :   case 1: {
    5121           0 :     size += fd_vote_authorize_pubkey_size( &self->inner.authorize );
    5122           0 :     break;
    5123           0 :   }
    5124           0 :   case 2: {
    5125           0 :     size += fd_vote_size( &self->inner.vote );
    5126           0 :     break;
    5127           0 :   }
    5128           0 :   case 3: {
    5129           0 :     size += sizeof(ulong);
    5130           0 :     break;
    5131           0 :   }
    5132           0 :   case 5: {
    5133           0 :     size += sizeof(char);
    5134           0 :     break;
    5135           0 :   }
    5136           0 :   case 6: {
    5137           0 :     size += fd_vote_switch_size( &self->inner.vote_switch );
    5138           0 :     break;
    5139           0 :   }
    5140           0 :   case 7: {
    5141           0 :     size += fd_vote_authorize_size( &self->inner.authorize_checked );
    5142           0 :     break;
    5143           0 :   }
    5144           0 :   case 8: {
    5145           0 :     size += fd_vote_state_update_size( &self->inner.update_vote_state );
    5146           0 :     break;
    5147           0 :   }
    5148           0 :   case 9: {
    5149           0 :     size += fd_update_vote_state_switch_size( &self->inner.update_vote_state_switch );
    5150           0 :     break;
    5151           0 :   }
    5152           0 :   case 10: {
    5153           0 :     size += fd_vote_authorize_with_seed_args_size( &self->inner.authorize_with_seed );
    5154           0 :     break;
    5155           0 :   }
    5156           0 :   case 11: {
    5157           0 :     size += fd_vote_authorize_checked_with_seed_args_size( &self->inner.authorize_checked_with_seed );
    5158           0 :     break;
    5159           0 :   }
    5160           0 :   case 12: {
    5161           0 :     size += fd_compact_vote_state_update_size( &self->inner.compact_update_vote_state );
    5162           0 :     break;
    5163           0 :   }
    5164           0 :   case 13: {
    5165           0 :     size += fd_compact_vote_state_update_switch_size( &self->inner.compact_update_vote_state_switch );
    5166           0 :     break;
    5167           0 :   }
    5168           0 :   case 14: {
    5169           0 :     size += fd_tower_sync_size( &self->inner.tower_sync );
    5170           0 :     break;
    5171           0 :   }
    5172           0 :   case 15: {
    5173           0 :     size += fd_tower_sync_switch_size( &self->inner.tower_sync_switch );
    5174           0 :     break;
    5175           0 :   }
    5176           0 :   case 16: {
    5177           0 :     size += fd_vote_init_v2_size( &self->inner.initialize_account_v2 );
    5178           0 :     break;
    5179           0 :   }
    5180           0 :   case 17: {
    5181           0 :     size += fd_commission_kind_size( &self->inner.update_commission_collector );
    5182           0 :     break;
    5183           0 :   }
    5184           0 :   case 18: {
    5185           0 :     size += fd_update_commission_bps_args_size( &self->inner.update_commission_bps );
    5186           0 :     break;
    5187           0 :   }
    5188           0 :   case 19: {
    5189           0 :     size += fd_deposit_delegator_rewards_args_size( &self->inner.deposit_delegator_rewards );
    5190           0 :     break;
    5191           0 :   }
    5192           0 :   }
    5193           0 :   return size;
    5194           0 : }
    5195             : 
    5196           0 : int fd_vote_instruction_inner_encode( fd_vote_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    5197           0 :   int err;
    5198           0 :   switch (discriminant) {
    5199           0 :   case 0: {
    5200           0 :     err = fd_vote_init_encode( &self->initialize_account, ctx );
    5201           0 :     if( FD_UNLIKELY( err ) ) return err;
    5202           0 :     break;
    5203           0 :   }
    5204           0 :   case 1: {
    5205           0 :     err = fd_vote_authorize_pubkey_encode( &self->authorize, ctx );
    5206           0 :     if( FD_UNLIKELY( err ) ) return err;
    5207           0 :     break;
    5208           0 :   }
    5209           0 :   case 2: {
    5210           0 :     err = fd_vote_encode( &self->vote, ctx );
    5211           0 :     if( FD_UNLIKELY( err ) ) return err;
    5212           0 :     break;
    5213           0 :   }
    5214           0 :   case 3: {
    5215           0 :     err = fd_bincode_uint64_encode( self->withdraw, ctx );
    5216           0 :     if( FD_UNLIKELY( err ) ) return err;
    5217           0 :     break;
    5218           0 :   }
    5219           0 :   case 5: {
    5220           0 :     err = fd_bincode_uint8_encode( (uchar)(self->update_commission), ctx );
    5221           0 :   if( FD_UNLIKELY( err ) ) return err;
    5222           0 :     break;
    5223           0 :   }
    5224           0 :   case 6: {
    5225           0 :     err = fd_vote_switch_encode( &self->vote_switch, ctx );
    5226           0 :     if( FD_UNLIKELY( err ) ) return err;
    5227           0 :     break;
    5228           0 :   }
    5229           0 :   case 7: {
    5230           0 :     err = fd_vote_authorize_encode( &self->authorize_checked, ctx );
    5231           0 :     if( FD_UNLIKELY( err ) ) return err;
    5232           0 :     break;
    5233           0 :   }
    5234           0 :   case 8: {
    5235           0 :     err = fd_vote_state_update_encode( &self->update_vote_state, ctx );
    5236           0 :     if( FD_UNLIKELY( err ) ) return err;
    5237           0 :     break;
    5238           0 :   }
    5239           0 :   case 9: {
    5240           0 :     err = fd_update_vote_state_switch_encode( &self->update_vote_state_switch, ctx );
    5241           0 :     if( FD_UNLIKELY( err ) ) return err;
    5242           0 :     break;
    5243           0 :   }
    5244           0 :   case 10: {
    5245           0 :     err = fd_vote_authorize_with_seed_args_encode( &self->authorize_with_seed, ctx );
    5246           0 :     if( FD_UNLIKELY( err ) ) return err;
    5247           0 :     break;
    5248           0 :   }
    5249           0 :   case 11: {
    5250           0 :     err = fd_vote_authorize_checked_with_seed_args_encode( &self->authorize_checked_with_seed, ctx );
    5251           0 :     if( FD_UNLIKELY( err ) ) return err;
    5252           0 :     break;
    5253           0 :   }
    5254           0 :   case 12: {
    5255           0 :     err = fd_compact_vote_state_update_encode( &self->compact_update_vote_state, ctx );
    5256           0 :     if( FD_UNLIKELY( err ) ) return err;
    5257           0 :     break;
    5258           0 :   }
    5259           0 :   case 13: {
    5260           0 :     err = fd_compact_vote_state_update_switch_encode( &self->compact_update_vote_state_switch, ctx );
    5261           0 :     if( FD_UNLIKELY( err ) ) return err;
    5262           0 :     break;
    5263           0 :   }
    5264           0 :   case 14: {
    5265           0 :     err = fd_tower_sync_encode( &self->tower_sync, ctx );
    5266           0 :     if( FD_UNLIKELY( err ) ) return err;
    5267           0 :     break;
    5268           0 :   }
    5269           0 :   case 15: {
    5270           0 :     err = fd_tower_sync_switch_encode( &self->tower_sync_switch, ctx );
    5271           0 :     if( FD_UNLIKELY( err ) ) return err;
    5272           0 :     break;
    5273           0 :   }
    5274           0 :   case 16: {
    5275           0 :     err = fd_vote_init_v2_encode( &self->initialize_account_v2, ctx );
    5276           0 :     if( FD_UNLIKELY( err ) ) return err;
    5277           0 :     break;
    5278           0 :   }
    5279           0 :   case 17: {
    5280           0 :     err = fd_commission_kind_encode( &self->update_commission_collector, ctx );
    5281           0 :     if( FD_UNLIKELY( err ) ) return err;
    5282           0 :     break;
    5283           0 :   }
    5284           0 :   case 18: {
    5285           0 :     err = fd_update_commission_bps_args_encode( &self->update_commission_bps, ctx );
    5286           0 :     if( FD_UNLIKELY( err ) ) return err;
    5287           0 :     break;
    5288           0 :   }
    5289           0 :   case 19: {
    5290           0 :     err = fd_deposit_delegator_rewards_args_encode( &self->deposit_delegator_rewards, ctx );
    5291           0 :     if( FD_UNLIKELY( err ) ) return err;
    5292           0 :     break;
    5293           0 :   }
    5294           0 :   }
    5295           0 :   return FD_BINCODE_SUCCESS;
    5296           0 : }
    5297           0 : int fd_vote_instruction_encode( fd_vote_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5298           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    5299           0 :   if( FD_UNLIKELY( err ) ) return err;
    5300           0 :   return fd_vote_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    5301           0 : }
    5302             : 
    5303           0 : int fd_system_program_instruction_create_account_encode( fd_system_program_instruction_create_account_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5304           0 :   int err;
    5305           0 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
    5306           0 :   if( FD_UNLIKELY( err ) ) return err;
    5307           0 :   err = fd_bincode_uint64_encode( self->space, ctx );
    5308           0 :   if( FD_UNLIKELY( err ) ) return err;
    5309           0 :   err = fd_pubkey_encode( &self->owner, ctx );
    5310           0 :   if( FD_UNLIKELY( err ) ) return err;
    5311           0 :   return FD_BINCODE_SUCCESS;
    5312           0 : }
    5313          78 : static inline int fd_system_program_instruction_create_account_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5314          78 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5315          78 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
    5316          78 :   return 0;
    5317          78 : }
    5318          78 : static void fd_system_program_instruction_create_account_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5319          78 :   fd_system_program_instruction_create_account_t * self = (fd_system_program_instruction_create_account_t *)struct_mem;
    5320          78 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
    5321          78 :   fd_bincode_uint64_decode_unsafe( &self->space, ctx );
    5322          78 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
    5323          78 : }
    5324           0 : void * fd_system_program_instruction_create_account_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5325           0 :   fd_system_program_instruction_create_account_t * self = (fd_system_program_instruction_create_account_t *)mem;
    5326           0 :   fd_system_program_instruction_create_account_new( self );
    5327           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_create_account_t);
    5328           0 :   void * * alloc_mem = &alloc_region;
    5329           0 :   fd_system_program_instruction_create_account_decode_inner( mem, alloc_mem, ctx );
    5330           0 :   return self;
    5331           0 : }
    5332           0 : int fd_system_program_instruction_create_account_with_seed_encode( fd_system_program_instruction_create_account_with_seed_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5333           0 :   int err;
    5334           0 :   err = fd_pubkey_encode( &self->base, ctx );
    5335           0 :   if( FD_UNLIKELY( err ) ) return err;
    5336           0 :   err = fd_bincode_uint64_encode( self->seed_len, ctx );
    5337           0 :   if( FD_UNLIKELY(err) ) return err;
    5338           0 :   if( self->seed_len ) {
    5339           0 :     err = fd_bincode_bytes_encode( self->seed, self->seed_len, ctx );
    5340           0 :     if( FD_UNLIKELY( err ) ) return err;
    5341           0 :   }
    5342           0 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
    5343           0 :   if( FD_UNLIKELY( err ) ) return err;
    5344           0 :   err = fd_bincode_uint64_encode( self->space, ctx );
    5345           0 :   if( FD_UNLIKELY( err ) ) return err;
    5346           0 :   err = fd_pubkey_encode( &self->owner, ctx );
    5347           0 :   if( FD_UNLIKELY( err ) ) return err;
    5348           0 :   return FD_BINCODE_SUCCESS;
    5349           0 : }
    5350           0 : static int fd_system_program_instruction_create_account_with_seed_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5351           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5352           0 :   int err = 0;
    5353           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5354           0 :   if( FD_UNLIKELY( err ) ) return err;
    5355           0 :   ulong seed_len;
    5356           0 :   err = fd_bincode_uint64_decode( &seed_len, ctx );
    5357           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5358           0 :   *total_sz += seed_len;
    5359           0 :   if( seed_len ) {
    5360           0 :     err = fd_bincode_bytes_decode_footprint( seed_len, ctx );
    5361           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5362           0 :     err = !fd_utf8_verify( (char const *) ctx->data - seed_len, seed_len );
    5363           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5364           0 :   }
    5365           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    5366           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5367           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    5368           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5369           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5370           0 :   if( FD_UNLIKELY( err ) ) return err;
    5371           0 :   return 0;
    5372           0 : }
    5373           0 : int fd_system_program_instruction_create_account_with_seed_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5374           0 :   *total_sz += sizeof(fd_system_program_instruction_create_account_with_seed_t);
    5375           0 :   void const * start_data = ctx->data;
    5376           0 :   int err = fd_system_program_instruction_create_account_with_seed_decode_footprint_inner( ctx, total_sz );
    5377           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5378           0 :   ctx->data = start_data;
    5379           0 :   return err;
    5380           0 : }
    5381           0 : static void fd_system_program_instruction_create_account_with_seed_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5382           0 :   fd_system_program_instruction_create_account_with_seed_t * self = (fd_system_program_instruction_create_account_with_seed_t *)struct_mem;
    5383           0 :   fd_pubkey_decode_inner( &self->base, alloc_mem, ctx );
    5384           0 :   fd_bincode_uint64_decode_unsafe( &self->seed_len, ctx );
    5385           0 :   if( self->seed_len ) {
    5386           0 :     self->seed = *alloc_mem;
    5387           0 :     fd_bincode_bytes_decode_unsafe( self->seed, self->seed_len, ctx );
    5388           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->seed_len;
    5389           0 :   } else
    5390           0 :     self->seed = NULL;
    5391           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
    5392           0 :   fd_bincode_uint64_decode_unsafe( &self->space, ctx );
    5393           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
    5394           0 : }
    5395           0 : void * fd_system_program_instruction_create_account_with_seed_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5396           0 :   fd_system_program_instruction_create_account_with_seed_t * self = (fd_system_program_instruction_create_account_with_seed_t *)mem;
    5397           0 :   fd_system_program_instruction_create_account_with_seed_new( self );
    5398           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_create_account_with_seed_t);
    5399           0 :   void * * alloc_mem = &alloc_region;
    5400           0 :   fd_system_program_instruction_create_account_with_seed_decode_inner( mem, alloc_mem, ctx );
    5401           0 :   return self;
    5402           0 : }
    5403           0 : void fd_system_program_instruction_create_account_with_seed_new(fd_system_program_instruction_create_account_with_seed_t * self) {
    5404           0 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_create_account_with_seed_t) );
    5405           0 :   fd_pubkey_new( &self->base );
    5406           0 :   fd_pubkey_new( &self->owner );
    5407           0 : }
    5408           0 : ulong fd_system_program_instruction_create_account_with_seed_size( fd_system_program_instruction_create_account_with_seed_t const * self ) {
    5409           0 :   ulong size = 0;
    5410           0 :   size += fd_pubkey_size( &self->base );
    5411           0 :   do {
    5412           0 :     size += sizeof(ulong);
    5413           0 :     size += self->seed_len;
    5414           0 :   } while(0);
    5415           0 :   size += sizeof(ulong);
    5416           0 :   size += sizeof(ulong);
    5417           0 :   size += fd_pubkey_size( &self->owner );
    5418           0 :   return size;
    5419           0 : }
    5420             : 
    5421           0 : int fd_system_program_instruction_allocate_with_seed_encode( fd_system_program_instruction_allocate_with_seed_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5422           0 :   int err;
    5423           0 :   err = fd_pubkey_encode( &self->base, ctx );
    5424           0 :   if( FD_UNLIKELY( err ) ) return err;
    5425           0 :   err = fd_bincode_uint64_encode( self->seed_len, ctx );
    5426           0 :   if( FD_UNLIKELY(err) ) return err;
    5427           0 :   if( self->seed_len ) {
    5428           0 :     err = fd_bincode_bytes_encode( self->seed, self->seed_len, ctx );
    5429           0 :     if( FD_UNLIKELY( err ) ) return err;
    5430           0 :   }
    5431           0 :   err = fd_bincode_uint64_encode( self->space, ctx );
    5432           0 :   if( FD_UNLIKELY( err ) ) return err;
    5433           0 :   err = fd_pubkey_encode( &self->owner, ctx );
    5434           0 :   if( FD_UNLIKELY( err ) ) return err;
    5435           0 :   return FD_BINCODE_SUCCESS;
    5436           0 : }
    5437           0 : static int fd_system_program_instruction_allocate_with_seed_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5438           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5439           0 :   int err = 0;
    5440           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5441           0 :   if( FD_UNLIKELY( err ) ) return err;
    5442           0 :   ulong seed_len;
    5443           0 :   err = fd_bincode_uint64_decode( &seed_len, ctx );
    5444           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5445           0 :   *total_sz += seed_len;
    5446           0 :   if( seed_len ) {
    5447           0 :     err = fd_bincode_bytes_decode_footprint( seed_len, ctx );
    5448           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5449           0 :     err = !fd_utf8_verify( (char const *) ctx->data - seed_len, seed_len );
    5450           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5451           0 :   }
    5452           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    5453           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5454           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5455           0 :   if( FD_UNLIKELY( err ) ) return err;
    5456           0 :   return 0;
    5457           0 : }
    5458           0 : int fd_system_program_instruction_allocate_with_seed_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5459           0 :   *total_sz += sizeof(fd_system_program_instruction_allocate_with_seed_t);
    5460           0 :   void const * start_data = ctx->data;
    5461           0 :   int err = fd_system_program_instruction_allocate_with_seed_decode_footprint_inner( ctx, total_sz );
    5462           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5463           0 :   ctx->data = start_data;
    5464           0 :   return err;
    5465           0 : }
    5466           0 : static void fd_system_program_instruction_allocate_with_seed_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5467           0 :   fd_system_program_instruction_allocate_with_seed_t * self = (fd_system_program_instruction_allocate_with_seed_t *)struct_mem;
    5468           0 :   fd_pubkey_decode_inner( &self->base, alloc_mem, ctx );
    5469           0 :   fd_bincode_uint64_decode_unsafe( &self->seed_len, ctx );
    5470           0 :   if( self->seed_len ) {
    5471           0 :     self->seed = *alloc_mem;
    5472           0 :     fd_bincode_bytes_decode_unsafe( self->seed, self->seed_len, ctx );
    5473           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->seed_len;
    5474           0 :   } else
    5475           0 :     self->seed = NULL;
    5476           0 :   fd_bincode_uint64_decode_unsafe( &self->space, ctx );
    5477           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
    5478           0 : }
    5479           0 : void * fd_system_program_instruction_allocate_with_seed_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5480           0 :   fd_system_program_instruction_allocate_with_seed_t * self = (fd_system_program_instruction_allocate_with_seed_t *)mem;
    5481           0 :   fd_system_program_instruction_allocate_with_seed_new( self );
    5482           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_allocate_with_seed_t);
    5483           0 :   void * * alloc_mem = &alloc_region;
    5484           0 :   fd_system_program_instruction_allocate_with_seed_decode_inner( mem, alloc_mem, ctx );
    5485           0 :   return self;
    5486           0 : }
    5487           0 : void fd_system_program_instruction_allocate_with_seed_new(fd_system_program_instruction_allocate_with_seed_t * self) {
    5488           0 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_allocate_with_seed_t) );
    5489           0 :   fd_pubkey_new( &self->base );
    5490           0 :   fd_pubkey_new( &self->owner );
    5491           0 : }
    5492           0 : ulong fd_system_program_instruction_allocate_with_seed_size( fd_system_program_instruction_allocate_with_seed_t const * self ) {
    5493           0 :   ulong size = 0;
    5494           0 :   size += fd_pubkey_size( &self->base );
    5495           0 :   do {
    5496           0 :     size += sizeof(ulong);
    5497           0 :     size += self->seed_len;
    5498           0 :   } while(0);
    5499           0 :   size += sizeof(ulong);
    5500           0 :   size += fd_pubkey_size( &self->owner );
    5501           0 :   return size;
    5502           0 : }
    5503             : 
    5504           0 : int fd_system_program_instruction_assign_with_seed_encode( fd_system_program_instruction_assign_with_seed_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5505           0 :   int err;
    5506           0 :   err = fd_pubkey_encode( &self->base, ctx );
    5507           0 :   if( FD_UNLIKELY( err ) ) return err;
    5508           0 :   err = fd_bincode_uint64_encode( self->seed_len, ctx );
    5509           0 :   if( FD_UNLIKELY(err) ) return err;
    5510           0 :   if( self->seed_len ) {
    5511           0 :     err = fd_bincode_bytes_encode( self->seed, self->seed_len, ctx );
    5512           0 :     if( FD_UNLIKELY( err ) ) return err;
    5513           0 :   }
    5514           0 :   err = fd_pubkey_encode( &self->owner, ctx );
    5515           0 :   if( FD_UNLIKELY( err ) ) return err;
    5516           0 :   return FD_BINCODE_SUCCESS;
    5517           0 : }
    5518           0 : static int fd_system_program_instruction_assign_with_seed_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5519           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5520           0 :   int err = 0;
    5521           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5522           0 :   if( FD_UNLIKELY( err ) ) return err;
    5523           0 :   ulong seed_len;
    5524           0 :   err = fd_bincode_uint64_decode( &seed_len, ctx );
    5525           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5526           0 :   *total_sz += seed_len;
    5527           0 :   if( seed_len ) {
    5528           0 :     err = fd_bincode_bytes_decode_footprint( seed_len, ctx );
    5529           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5530           0 :     err = !fd_utf8_verify( (char const *) ctx->data - seed_len, seed_len );
    5531           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5532           0 :   }
    5533           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5534           0 :   if( FD_UNLIKELY( err ) ) return err;
    5535           0 :   return 0;
    5536           0 : }
    5537           0 : int fd_system_program_instruction_assign_with_seed_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5538           0 :   *total_sz += sizeof(fd_system_program_instruction_assign_with_seed_t);
    5539           0 :   void const * start_data = ctx->data;
    5540           0 :   int err = fd_system_program_instruction_assign_with_seed_decode_footprint_inner( ctx, total_sz );
    5541           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5542           0 :   ctx->data = start_data;
    5543           0 :   return err;
    5544           0 : }
    5545           0 : static void fd_system_program_instruction_assign_with_seed_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5546           0 :   fd_system_program_instruction_assign_with_seed_t * self = (fd_system_program_instruction_assign_with_seed_t *)struct_mem;
    5547           0 :   fd_pubkey_decode_inner( &self->base, alloc_mem, ctx );
    5548           0 :   fd_bincode_uint64_decode_unsafe( &self->seed_len, ctx );
    5549           0 :   if( self->seed_len ) {
    5550           0 :     self->seed = *alloc_mem;
    5551           0 :     fd_bincode_bytes_decode_unsafe( self->seed, self->seed_len, ctx );
    5552           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->seed_len;
    5553           0 :   } else
    5554           0 :     self->seed = NULL;
    5555           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
    5556           0 : }
    5557           0 : void * fd_system_program_instruction_assign_with_seed_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5558           0 :   fd_system_program_instruction_assign_with_seed_t * self = (fd_system_program_instruction_assign_with_seed_t *)mem;
    5559           0 :   fd_system_program_instruction_assign_with_seed_new( self );
    5560           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_assign_with_seed_t);
    5561           0 :   void * * alloc_mem = &alloc_region;
    5562           0 :   fd_system_program_instruction_assign_with_seed_decode_inner( mem, alloc_mem, ctx );
    5563           0 :   return self;
    5564           0 : }
    5565           0 : void fd_system_program_instruction_assign_with_seed_new(fd_system_program_instruction_assign_with_seed_t * self) {
    5566           0 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_assign_with_seed_t) );
    5567           0 :   fd_pubkey_new( &self->base );
    5568           0 :   fd_pubkey_new( &self->owner );
    5569           0 : }
    5570           0 : ulong fd_system_program_instruction_assign_with_seed_size( fd_system_program_instruction_assign_with_seed_t const * self ) {
    5571           0 :   ulong size = 0;
    5572           0 :   size += fd_pubkey_size( &self->base );
    5573           0 :   do {
    5574           0 :     size += sizeof(ulong);
    5575           0 :     size += self->seed_len;
    5576           0 :   } while(0);
    5577           0 :   size += fd_pubkey_size( &self->owner );
    5578           0 :   return size;
    5579           0 : }
    5580             : 
    5581           0 : int fd_system_program_instruction_transfer_with_seed_encode( fd_system_program_instruction_transfer_with_seed_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5582           0 :   int err;
    5583           0 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
    5584           0 :   if( FD_UNLIKELY( err ) ) return err;
    5585           0 :   err = fd_bincode_uint64_encode( self->from_seed_len, ctx );
    5586           0 :   if( FD_UNLIKELY(err) ) return err;
    5587           0 :   if( self->from_seed_len ) {
    5588           0 :     err = fd_bincode_bytes_encode( self->from_seed, self->from_seed_len, ctx );
    5589           0 :     if( FD_UNLIKELY( err ) ) return err;
    5590           0 :   }
    5591           0 :   err = fd_pubkey_encode( &self->from_owner, ctx );
    5592           0 :   if( FD_UNLIKELY( err ) ) return err;
    5593           0 :   return FD_BINCODE_SUCCESS;
    5594           0 : }
    5595           0 : static int fd_system_program_instruction_transfer_with_seed_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5596           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5597           0 :   int err = 0;
    5598           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    5599           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5600           0 :   ulong from_seed_len;
    5601           0 :   err = fd_bincode_uint64_decode( &from_seed_len, ctx );
    5602           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5603           0 :   *total_sz += from_seed_len;
    5604           0 :   if( from_seed_len ) {
    5605           0 :     err = fd_bincode_bytes_decode_footprint( from_seed_len, ctx );
    5606           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5607           0 :     err = !fd_utf8_verify( (char const *) ctx->data - from_seed_len, from_seed_len );
    5608           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5609           0 :   }
    5610           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5611           0 :   if( FD_UNLIKELY( err ) ) return err;
    5612           0 :   return 0;
    5613           0 : }
    5614           0 : int fd_system_program_instruction_transfer_with_seed_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5615           0 :   *total_sz += sizeof(fd_system_program_instruction_transfer_with_seed_t);
    5616           0 :   void const * start_data = ctx->data;
    5617           0 :   int err = fd_system_program_instruction_transfer_with_seed_decode_footprint_inner( ctx, total_sz );
    5618           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5619           0 :   ctx->data = start_data;
    5620           0 :   return err;
    5621           0 : }
    5622           0 : static void fd_system_program_instruction_transfer_with_seed_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5623           0 :   fd_system_program_instruction_transfer_with_seed_t * self = (fd_system_program_instruction_transfer_with_seed_t *)struct_mem;
    5624           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
    5625           0 :   fd_bincode_uint64_decode_unsafe( &self->from_seed_len, ctx );
    5626           0 :   if( self->from_seed_len ) {
    5627           0 :     self->from_seed = *alloc_mem;
    5628           0 :     fd_bincode_bytes_decode_unsafe( self->from_seed, self->from_seed_len, ctx );
    5629           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->from_seed_len;
    5630           0 :   } else
    5631           0 :     self->from_seed = NULL;
    5632           0 :   fd_pubkey_decode_inner( &self->from_owner, alloc_mem, ctx );
    5633           0 : }
    5634           0 : void * fd_system_program_instruction_transfer_with_seed_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5635           0 :   fd_system_program_instruction_transfer_with_seed_t * self = (fd_system_program_instruction_transfer_with_seed_t *)mem;
    5636           0 :   fd_system_program_instruction_transfer_with_seed_new( self );
    5637           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_transfer_with_seed_t);
    5638           0 :   void * * alloc_mem = &alloc_region;
    5639           0 :   fd_system_program_instruction_transfer_with_seed_decode_inner( mem, alloc_mem, ctx );
    5640           0 :   return self;
    5641           0 : }
    5642           0 : void fd_system_program_instruction_transfer_with_seed_new(fd_system_program_instruction_transfer_with_seed_t * self) {
    5643           0 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_transfer_with_seed_t) );
    5644           0 :   fd_pubkey_new( &self->from_owner );
    5645           0 : }
    5646           0 : ulong fd_system_program_instruction_transfer_with_seed_size( fd_system_program_instruction_transfer_with_seed_t const * self ) {
    5647           0 :   ulong size = 0;
    5648           0 :   size += sizeof(ulong);
    5649           0 :   do {
    5650           0 :     size += sizeof(ulong);
    5651           0 :     size += self->from_seed_len;
    5652           0 :   } while(0);
    5653           0 :   size += fd_pubkey_size( &self->from_owner );
    5654           0 :   return size;
    5655           0 : }
    5656             : 
    5657           0 : FD_FN_PURE uchar fd_system_program_instruction_is_create_account(fd_system_program_instruction_t const * self) {
    5658           0 :   return self->discriminant == 0;
    5659           0 : }
    5660           0 : FD_FN_PURE uchar fd_system_program_instruction_is_assign(fd_system_program_instruction_t const * self) {
    5661           0 :   return self->discriminant == 1;
    5662           0 : }
    5663           0 : FD_FN_PURE uchar fd_system_program_instruction_is_transfer(fd_system_program_instruction_t const * self) {
    5664           0 :   return self->discriminant == 2;
    5665           0 : }
    5666           0 : FD_FN_PURE uchar fd_system_program_instruction_is_create_account_with_seed(fd_system_program_instruction_t const * self) {
    5667           0 :   return self->discriminant == 3;
    5668           0 : }
    5669           0 : FD_FN_PURE uchar fd_system_program_instruction_is_advance_nonce_account(fd_system_program_instruction_t const * self) {
    5670           0 :   return self->discriminant == 4;
    5671           0 : }
    5672           0 : FD_FN_PURE uchar fd_system_program_instruction_is_withdraw_nonce_account(fd_system_program_instruction_t const * self) {
    5673           0 :   return self->discriminant == 5;
    5674           0 : }
    5675           0 : FD_FN_PURE uchar fd_system_program_instruction_is_initialize_nonce_account(fd_system_program_instruction_t const * self) {
    5676           0 :   return self->discriminant == 6;
    5677           0 : }
    5678           0 : FD_FN_PURE uchar fd_system_program_instruction_is_authorize_nonce_account(fd_system_program_instruction_t const * self) {
    5679           0 :   return self->discriminant == 7;
    5680           0 : }
    5681           0 : FD_FN_PURE uchar fd_system_program_instruction_is_allocate(fd_system_program_instruction_t const * self) {
    5682           0 :   return self->discriminant == 8;
    5683           0 : }
    5684           0 : FD_FN_PURE uchar fd_system_program_instruction_is_allocate_with_seed(fd_system_program_instruction_t const * self) {
    5685           0 :   return self->discriminant == 9;
    5686           0 : }
    5687           0 : FD_FN_PURE uchar fd_system_program_instruction_is_assign_with_seed(fd_system_program_instruction_t const * self) {
    5688           0 :   return self->discriminant == 10;
    5689           0 : }
    5690           0 : FD_FN_PURE uchar fd_system_program_instruction_is_transfer_with_seed(fd_system_program_instruction_t const * self) {
    5691           0 :   return self->discriminant == 11;
    5692           0 : }
    5693           0 : FD_FN_PURE uchar fd_system_program_instruction_is_upgrade_nonce_account(fd_system_program_instruction_t const * self) {
    5694           0 :   return self->discriminant == 12;
    5695           0 : }
    5696           0 : FD_FN_PURE uchar fd_system_program_instruction_is_create_account_allow_prefund(fd_system_program_instruction_t const * self) {
    5697           0 :   return self->discriminant == 13;
    5698           0 : }
    5699             : void fd_system_program_instruction_inner_new( fd_system_program_instruction_inner_t * self, uint discriminant );
    5700         150 : int fd_system_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5701         150 :   int err;
    5702         150 :   switch (discriminant) {
    5703           0 :   case 0: {
    5704           0 :     err = fd_system_program_instruction_create_account_decode_footprint_inner( ctx, total_sz );
    5705           0 :     if( FD_UNLIKELY( err ) ) return err;
    5706           0 :     return FD_BINCODE_SUCCESS;
    5707           0 :   }
    5708           0 :   case 1: {
    5709           0 :     err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5710           0 :     if( FD_UNLIKELY( err ) ) return err;
    5711           0 :     return FD_BINCODE_SUCCESS;
    5712           0 :   }
    5713          24 :   case 2: {
    5714          24 :     err = fd_bincode_uint64_decode_footprint( ctx );
    5715          24 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5716          24 :     return FD_BINCODE_SUCCESS;
    5717          24 :   }
    5718           0 :   case 3: {
    5719           0 :     err = fd_system_program_instruction_create_account_with_seed_decode_footprint_inner( ctx, total_sz );
    5720           0 :     if( FD_UNLIKELY( err ) ) return err;
    5721           0 :     return FD_BINCODE_SUCCESS;
    5722           0 :   }
    5723           0 :   case 4: {
    5724           0 :     return FD_BINCODE_SUCCESS;
    5725           0 :   }
    5726           0 :   case 5: {
    5727           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    5728           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5729           0 :     return FD_BINCODE_SUCCESS;
    5730           0 :   }
    5731           0 :   case 6: {
    5732           0 :     err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5733           0 :     if( FD_UNLIKELY( err ) ) return err;
    5734           0 :     return FD_BINCODE_SUCCESS;
    5735           0 :   }
    5736           0 :   case 7: {
    5737           0 :     err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5738           0 :     if( FD_UNLIKELY( err ) ) return err;
    5739           0 :     return FD_BINCODE_SUCCESS;
    5740           0 :   }
    5741          48 :   case 8: {
    5742          48 :     err = fd_bincode_uint64_decode_footprint( ctx );
    5743          48 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5744          48 :     return FD_BINCODE_SUCCESS;
    5745          48 :   }
    5746           0 :   case 9: {
    5747           0 :     err = fd_system_program_instruction_allocate_with_seed_decode_footprint_inner( ctx, total_sz );
    5748           0 :     if( FD_UNLIKELY( err ) ) return err;
    5749           0 :     return FD_BINCODE_SUCCESS;
    5750           0 :   }
    5751           0 :   case 10: {
    5752           0 :     err = fd_system_program_instruction_assign_with_seed_decode_footprint_inner( ctx, total_sz );
    5753           0 :     if( FD_UNLIKELY( err ) ) return err;
    5754           0 :     return FD_BINCODE_SUCCESS;
    5755           0 :   }
    5756           0 :   case 11: {
    5757           0 :     err = fd_system_program_instruction_transfer_with_seed_decode_footprint_inner( ctx, total_sz );
    5758           0 :     if( FD_UNLIKELY( err ) ) return err;
    5759           0 :     return FD_BINCODE_SUCCESS;
    5760           0 :   }
    5761           0 :   case 12: {
    5762           0 :     return FD_BINCODE_SUCCESS;
    5763           0 :   }
    5764          78 :   case 13: {
    5765          78 :     err = fd_system_program_instruction_create_account_decode_footprint_inner( ctx, total_sz );
    5766          78 :     if( FD_UNLIKELY( err ) ) return err;
    5767          78 :     return FD_BINCODE_SUCCESS;
    5768          78 :   }
    5769           0 :   default: return FD_BINCODE_ERR_ENCODING;
    5770         150 :   }
    5771         150 : }
    5772         150 : static int fd_system_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5773         150 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5774         150 :   uint discriminant = 0;
    5775         150 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    5776         150 :   if( FD_UNLIKELY( err ) ) return err;
    5777         150 :   return fd_system_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    5778         150 : }
    5779         150 : int fd_system_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5780         150 :   *total_sz += sizeof(fd_system_program_instruction_t);
    5781         150 :   void const * start_data = ctx->data;
    5782         150 :   int err =  fd_system_program_instruction_decode_footprint_inner( ctx, total_sz );
    5783         150 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5784         150 :   ctx->data = start_data;
    5785         150 :   return err;
    5786         150 : }
    5787         150 : static void fd_system_program_instruction_inner_decode_inner( fd_system_program_instruction_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    5788         150 :   switch (discriminant) {
    5789           0 :   case 0: {
    5790           0 :     fd_system_program_instruction_create_account_decode_inner( &self->create_account, alloc_mem, ctx );
    5791           0 :     break;
    5792           0 :   }
    5793           0 :   case 1: {
    5794           0 :     fd_pubkey_decode_inner( &self->assign, alloc_mem, ctx );
    5795           0 :     break;
    5796           0 :   }
    5797          24 :   case 2: {
    5798          24 :     fd_bincode_uint64_decode_unsafe( &self->transfer, ctx );
    5799          24 :     break;
    5800           0 :   }
    5801           0 :   case 3: {
    5802           0 :     fd_system_program_instruction_create_account_with_seed_decode_inner( &self->create_account_with_seed, alloc_mem, ctx );
    5803           0 :     break;
    5804           0 :   }
    5805           0 :   case 4: {
    5806           0 :     break;
    5807           0 :   }
    5808           0 :   case 5: {
    5809           0 :     fd_bincode_uint64_decode_unsafe( &self->withdraw_nonce_account, ctx );
    5810           0 :     break;
    5811           0 :   }
    5812           0 :   case 6: {
    5813           0 :     fd_pubkey_decode_inner( &self->initialize_nonce_account, alloc_mem, ctx );
    5814           0 :     break;
    5815           0 :   }
    5816           0 :   case 7: {
    5817           0 :     fd_pubkey_decode_inner( &self->authorize_nonce_account, alloc_mem, ctx );
    5818           0 :     break;
    5819           0 :   }
    5820          48 :   case 8: {
    5821          48 :     fd_bincode_uint64_decode_unsafe( &self->allocate, ctx );
    5822          48 :     break;
    5823           0 :   }
    5824           0 :   case 9: {
    5825           0 :     fd_system_program_instruction_allocate_with_seed_decode_inner( &self->allocate_with_seed, alloc_mem, ctx );
    5826           0 :     break;
    5827           0 :   }
    5828           0 :   case 10: {
    5829           0 :     fd_system_program_instruction_assign_with_seed_decode_inner( &self->assign_with_seed, alloc_mem, ctx );
    5830           0 :     break;
    5831           0 :   }
    5832           0 :   case 11: {
    5833           0 :     fd_system_program_instruction_transfer_with_seed_decode_inner( &self->transfer_with_seed, alloc_mem, ctx );
    5834           0 :     break;
    5835           0 :   }
    5836           0 :   case 12: {
    5837           0 :     break;
    5838           0 :   }
    5839          78 :   case 13: {
    5840          78 :     fd_system_program_instruction_create_account_decode_inner( &self->create_account_allow_prefund, alloc_mem, ctx );
    5841          78 :     break;
    5842           0 :   }
    5843         150 :   }
    5844         150 : }
    5845         150 : static void fd_system_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5846         150 :   fd_system_program_instruction_t * self = (fd_system_program_instruction_t *)struct_mem;
    5847         150 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    5848         150 :   fd_system_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    5849         150 : }
    5850         150 : void * fd_system_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5851         150 :   fd_system_program_instruction_t * self = (fd_system_program_instruction_t *)mem;
    5852         150 :   fd_system_program_instruction_new( self );
    5853         150 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_t);
    5854         150 :   void * * alloc_mem = &alloc_region;
    5855         150 :   fd_system_program_instruction_decode_inner( mem, alloc_mem, ctx );
    5856         150 :   return self;
    5857         150 : }
    5858         150 : void fd_system_program_instruction_inner_new( fd_system_program_instruction_inner_t * self, uint discriminant ) {
    5859         150 :   switch( discriminant ) {
    5860           0 :   case 0: {
    5861           0 :     fd_system_program_instruction_create_account_new( &self->create_account );
    5862           0 :     break;
    5863           0 :   }
    5864           0 :   case 1: {
    5865           0 :     fd_pubkey_new( &self->assign );
    5866           0 :     break;
    5867           0 :   }
    5868           0 :   case 2: {
    5869           0 :     break;
    5870           0 :   }
    5871           0 :   case 3: {
    5872           0 :     fd_system_program_instruction_create_account_with_seed_new( &self->create_account_with_seed );
    5873           0 :     break;
    5874           0 :   }
    5875           0 :   case 4: {
    5876           0 :     break;
    5877           0 :   }
    5878           0 :   case 5: {
    5879           0 :     break;
    5880           0 :   }
    5881           0 :   case 6: {
    5882           0 :     fd_pubkey_new( &self->initialize_nonce_account );
    5883           0 :     break;
    5884           0 :   }
    5885           0 :   case 7: {
    5886           0 :     fd_pubkey_new( &self->authorize_nonce_account );
    5887           0 :     break;
    5888           0 :   }
    5889           0 :   case 8: {
    5890           0 :     break;
    5891           0 :   }
    5892           0 :   case 9: {
    5893           0 :     fd_system_program_instruction_allocate_with_seed_new( &self->allocate_with_seed );
    5894           0 :     break;
    5895           0 :   }
    5896           0 :   case 10: {
    5897           0 :     fd_system_program_instruction_assign_with_seed_new( &self->assign_with_seed );
    5898           0 :     break;
    5899           0 :   }
    5900           0 :   case 11: {
    5901           0 :     fd_system_program_instruction_transfer_with_seed_new( &self->transfer_with_seed );
    5902           0 :     break;
    5903           0 :   }
    5904           0 :   case 12: {
    5905           0 :     break;
    5906           0 :   }
    5907           0 :   case 13: {
    5908           0 :     fd_system_program_instruction_create_account_new( &self->create_account_allow_prefund );
    5909           0 :     break;
    5910           0 :   }
    5911         150 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    5912         150 :   }
    5913         150 : }
    5914         150 : void fd_system_program_instruction_new_disc( fd_system_program_instruction_t * self, uint discriminant ) {
    5915         150 :   self->discriminant = discriminant;
    5916         150 :   fd_system_program_instruction_inner_new( &self->inner, self->discriminant );
    5917         150 : }
    5918         150 : void fd_system_program_instruction_new( fd_system_program_instruction_t * self ) {
    5919         150 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_t) );
    5920         150 :   fd_system_program_instruction_new_disc( self, UINT_MAX );
    5921         150 : }
    5922             : 
    5923           0 : ulong fd_system_program_instruction_size( fd_system_program_instruction_t const * self ) {
    5924           0 :   ulong size = 0;
    5925           0 :   size += sizeof(uint);
    5926           0 :   switch (self->discriminant) {
    5927           0 :   case 0: {
    5928           0 :     size += fd_system_program_instruction_create_account_size( &self->inner.create_account );
    5929           0 :     break;
    5930           0 :   }
    5931           0 :   case 1: {
    5932           0 :     size += fd_pubkey_size( &self->inner.assign );
    5933           0 :     break;
    5934           0 :   }
    5935           0 :   case 2: {
    5936           0 :     size += sizeof(ulong);
    5937           0 :     break;
    5938           0 :   }
    5939           0 :   case 3: {
    5940           0 :     size += fd_system_program_instruction_create_account_with_seed_size( &self->inner.create_account_with_seed );
    5941           0 :     break;
    5942           0 :   }
    5943           0 :   case 5: {
    5944           0 :     size += sizeof(ulong);
    5945           0 :     break;
    5946           0 :   }
    5947           0 :   case 6: {
    5948           0 :     size += fd_pubkey_size( &self->inner.initialize_nonce_account );
    5949           0 :     break;
    5950           0 :   }
    5951           0 :   case 7: {
    5952           0 :     size += fd_pubkey_size( &self->inner.authorize_nonce_account );
    5953           0 :     break;
    5954           0 :   }
    5955           0 :   case 8: {
    5956           0 :     size += sizeof(ulong);
    5957           0 :     break;
    5958           0 :   }
    5959           0 :   case 9: {
    5960           0 :     size += fd_system_program_instruction_allocate_with_seed_size( &self->inner.allocate_with_seed );
    5961           0 :     break;
    5962           0 :   }
    5963           0 :   case 10: {
    5964           0 :     size += fd_system_program_instruction_assign_with_seed_size( &self->inner.assign_with_seed );
    5965           0 :     break;
    5966           0 :   }
    5967           0 :   case 11: {
    5968           0 :     size += fd_system_program_instruction_transfer_with_seed_size( &self->inner.transfer_with_seed );
    5969           0 :     break;
    5970           0 :   }
    5971           0 :   case 13: {
    5972           0 :     size += fd_system_program_instruction_create_account_size( &self->inner.create_account_allow_prefund );
    5973           0 :     break;
    5974           0 :   }
    5975           0 :   }
    5976           0 :   return size;
    5977           0 : }
    5978             : 
    5979           0 : int fd_system_program_instruction_inner_encode( fd_system_program_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    5980           0 :   int err;
    5981           0 :   switch (discriminant) {
    5982           0 :   case 0: {
    5983           0 :     err = fd_system_program_instruction_create_account_encode( &self->create_account, ctx );
    5984           0 :     if( FD_UNLIKELY( err ) ) return err;
    5985           0 :     break;
    5986           0 :   }
    5987           0 :   case 1: {
    5988           0 :     err = fd_pubkey_encode( &self->assign, ctx );
    5989           0 :     if( FD_UNLIKELY( err ) ) return err;
    5990           0 :     break;
    5991           0 :   }
    5992           0 :   case 2: {
    5993           0 :     err = fd_bincode_uint64_encode( self->transfer, ctx );
    5994           0 :     if( FD_UNLIKELY( err ) ) return err;
    5995           0 :     break;
    5996           0 :   }
    5997           0 :   case 3: {
    5998           0 :     err = fd_system_program_instruction_create_account_with_seed_encode( &self->create_account_with_seed, ctx );
    5999           0 :     if( FD_UNLIKELY( err ) ) return err;
    6000           0 :     break;
    6001           0 :   }
    6002           0 :   case 5: {
    6003           0 :     err = fd_bincode_uint64_encode( self->withdraw_nonce_account, ctx );
    6004           0 :     if( FD_UNLIKELY( err ) ) return err;
    6005           0 :     break;
    6006           0 :   }
    6007           0 :   case 6: {
    6008           0 :     err = fd_pubkey_encode( &self->initialize_nonce_account, ctx );
    6009           0 :     if( FD_UNLIKELY( err ) ) return err;
    6010           0 :     break;
    6011           0 :   }
    6012           0 :   case 7: {
    6013           0 :     err = fd_pubkey_encode( &self->authorize_nonce_account, ctx );
    6014           0 :     if( FD_UNLIKELY( err ) ) return err;
    6015           0 :     break;
    6016           0 :   }
    6017           0 :   case 8: {
    6018           0 :     err = fd_bincode_uint64_encode( self->allocate, ctx );
    6019           0 :     if( FD_UNLIKELY( err ) ) return err;
    6020           0 :     break;
    6021           0 :   }
    6022           0 :   case 9: {
    6023           0 :     err = fd_system_program_instruction_allocate_with_seed_encode( &self->allocate_with_seed, ctx );
    6024           0 :     if( FD_UNLIKELY( err ) ) return err;
    6025           0 :     break;
    6026           0 :   }
    6027           0 :   case 10: {
    6028           0 :     err = fd_system_program_instruction_assign_with_seed_encode( &self->assign_with_seed, ctx );
    6029           0 :     if( FD_UNLIKELY( err ) ) return err;
    6030           0 :     break;
    6031           0 :   }
    6032           0 :   case 11: {
    6033           0 :     err = fd_system_program_instruction_transfer_with_seed_encode( &self->transfer_with_seed, ctx );
    6034           0 :     if( FD_UNLIKELY( err ) ) return err;
    6035           0 :     break;
    6036           0 :   }
    6037           0 :   case 13: {
    6038           0 :     err = fd_system_program_instruction_create_account_encode( &self->create_account_allow_prefund, ctx );
    6039           0 :     if( FD_UNLIKELY( err ) ) return err;
    6040           0 :     break;
    6041           0 :   }
    6042           0 :   }
    6043           0 :   return FD_BINCODE_SUCCESS;
    6044           0 : }
    6045           0 : int fd_system_program_instruction_encode( fd_system_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6046           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    6047           0 :   if( FD_UNLIKELY( err ) ) return err;
    6048           0 :   return fd_system_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    6049           0 : }
    6050             : 
    6051           0 : int fd_nonce_data_encode( fd_nonce_data_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6052           0 :   int err;
    6053           0 :   err = fd_pubkey_encode( &self->authority, ctx );
    6054           0 :   if( FD_UNLIKELY( err ) ) return err;
    6055           0 :   err = fd_hash_encode( &self->durable_nonce, ctx );
    6056           0 :   if( FD_UNLIKELY( err ) ) return err;
    6057           0 :   err = fd_fee_calculator_encode( &self->fee_calculator, ctx );
    6058           0 :   if( FD_UNLIKELY( err ) ) return err;
    6059           0 :   return FD_BINCODE_SUCCESS;
    6060           0 : }
    6061           0 : static inline int fd_nonce_data_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6062           0 :   if( (ulong)ctx->data + 72UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6063           0 :   ctx->data = (void *)( (ulong)ctx->data + 72UL );
    6064           0 :   return 0;
    6065           0 : }
    6066           0 : static void fd_nonce_data_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6067           0 :   fd_nonce_data_t * self = (fd_nonce_data_t *)struct_mem;
    6068           0 :   fd_pubkey_decode_inner( &self->authority, alloc_mem, ctx );
    6069           0 :   fd_hash_decode_inner( &self->durable_nonce, alloc_mem, ctx );
    6070           0 :   fd_fee_calculator_decode_inner( &self->fee_calculator, alloc_mem, ctx );
    6071           0 : }
    6072           0 : void * fd_nonce_data_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6073           0 :   fd_nonce_data_t * self = (fd_nonce_data_t *)mem;
    6074           0 :   fd_nonce_data_new( self );
    6075           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_nonce_data_t);
    6076           0 :   void * * alloc_mem = &alloc_region;
    6077           0 :   fd_nonce_data_decode_inner( mem, alloc_mem, ctx );
    6078           0 :   return self;
    6079           0 : }
    6080           0 : FD_FN_PURE uchar fd_nonce_state_is_uninitialized(fd_nonce_state_t const * self) {
    6081           0 :   return self->discriminant == 0;
    6082           0 : }
    6083           0 : FD_FN_PURE uchar fd_nonce_state_is_initialized(fd_nonce_state_t const * self) {
    6084           0 :   return self->discriminant == 1;
    6085           0 : }
    6086             : void fd_nonce_state_inner_new( fd_nonce_state_inner_t * self, uint discriminant );
    6087           0 : int fd_nonce_state_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6088           0 :   int err;
    6089           0 :   switch (discriminant) {
    6090           0 :   case 0: {
    6091           0 :     return FD_BINCODE_SUCCESS;
    6092           0 :   }
    6093           0 :   case 1: {
    6094           0 :     err = fd_nonce_data_decode_footprint_inner( ctx, total_sz );
    6095           0 :     if( FD_UNLIKELY( err ) ) return err;
    6096           0 :     return FD_BINCODE_SUCCESS;
    6097           0 :   }
    6098           0 :   default: return FD_BINCODE_ERR_ENCODING;
    6099           0 :   }
    6100           0 : }
    6101           0 : static int fd_nonce_state_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6102           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6103           0 :   uint discriminant = 0;
    6104           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    6105           0 :   if( FD_UNLIKELY( err ) ) return err;
    6106           0 :   return fd_nonce_state_inner_decode_footprint( discriminant, ctx, total_sz );
    6107           0 : }
    6108           0 : int fd_nonce_state_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6109           0 :   *total_sz += sizeof(fd_nonce_state_t);
    6110           0 :   void const * start_data = ctx->data;
    6111           0 :   int err =  fd_nonce_state_decode_footprint_inner( ctx, total_sz );
    6112           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6113           0 :   ctx->data = start_data;
    6114           0 :   return err;
    6115           0 : }
    6116           0 : static void fd_nonce_state_inner_decode_inner( fd_nonce_state_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    6117           0 :   switch (discriminant) {
    6118           0 :   case 0: {
    6119           0 :     break;
    6120           0 :   }
    6121           0 :   case 1: {
    6122           0 :     fd_nonce_data_decode_inner( &self->initialized, alloc_mem, ctx );
    6123           0 :     break;
    6124           0 :   }
    6125           0 :   }
    6126           0 : }
    6127           0 : static void fd_nonce_state_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6128           0 :   fd_nonce_state_t * self = (fd_nonce_state_t *)struct_mem;
    6129           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    6130           0 :   fd_nonce_state_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    6131           0 : }
    6132           0 : void * fd_nonce_state_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6133           0 :   fd_nonce_state_t * self = (fd_nonce_state_t *)mem;
    6134           0 :   fd_nonce_state_new( self );
    6135           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_nonce_state_t);
    6136           0 :   void * * alloc_mem = &alloc_region;
    6137           0 :   fd_nonce_state_decode_inner( mem, alloc_mem, ctx );
    6138           0 :   return self;
    6139           0 : }
    6140           0 : void fd_nonce_state_inner_new( fd_nonce_state_inner_t * self, uint discriminant ) {
    6141           0 :   switch( discriminant ) {
    6142           0 :   case 0: {
    6143           0 :     break;
    6144           0 :   }
    6145           0 :   case 1: {
    6146           0 :     fd_nonce_data_new( &self->initialized );
    6147           0 :     break;
    6148           0 :   }
    6149           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    6150           0 :   }
    6151           0 : }
    6152           0 : void fd_nonce_state_new_disc( fd_nonce_state_t * self, uint discriminant ) {
    6153           0 :   self->discriminant = discriminant;
    6154           0 :   fd_nonce_state_inner_new( &self->inner, self->discriminant );
    6155           0 : }
    6156           0 : void fd_nonce_state_new( fd_nonce_state_t * self ) {
    6157           0 :   fd_memset( self, 0, sizeof(fd_nonce_state_t) );
    6158           0 :   fd_nonce_state_new_disc( self, UINT_MAX );
    6159           0 : }
    6160             : 
    6161           0 : ulong fd_nonce_state_size( fd_nonce_state_t const * self ) {
    6162           0 :   ulong size = 0;
    6163           0 :   size += sizeof(uint);
    6164           0 :   switch (self->discriminant) {
    6165           0 :   case 1: {
    6166           0 :     size += fd_nonce_data_size( &self->inner.initialized );
    6167           0 :     break;
    6168           0 :   }
    6169           0 :   }
    6170           0 :   return size;
    6171           0 : }
    6172             : 
    6173           0 : int fd_nonce_state_inner_encode( fd_nonce_state_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    6174           0 :   int err;
    6175           0 :   switch (discriminant) {
    6176           0 :   case 1: {
    6177           0 :     err = fd_nonce_data_encode( &self->initialized, ctx );
    6178           0 :     if( FD_UNLIKELY( err ) ) return err;
    6179           0 :     break;
    6180           0 :   }
    6181           0 :   }
    6182           0 :   return FD_BINCODE_SUCCESS;
    6183           0 : }
    6184           0 : int fd_nonce_state_encode( fd_nonce_state_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6185           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    6186           0 :   if( FD_UNLIKELY( err ) ) return err;
    6187           0 :   return fd_nonce_state_inner_encode( &self->inner, self->discriminant, ctx );
    6188           0 : }
    6189             : 
    6190           0 : FD_FN_PURE uchar fd_nonce_state_versions_is_legacy(fd_nonce_state_versions_t const * self) {
    6191           0 :   return self->discriminant == 0;
    6192           0 : }
    6193           0 : FD_FN_PURE uchar fd_nonce_state_versions_is_current(fd_nonce_state_versions_t const * self) {
    6194           0 :   return self->discriminant == 1;
    6195           0 : }
    6196             : void fd_nonce_state_versions_inner_new( fd_nonce_state_versions_inner_t * self, uint discriminant );
    6197           0 : int fd_nonce_state_versions_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6198           0 :   int err;
    6199           0 :   switch (discriminant) {
    6200           0 :   case 0: {
    6201           0 :     err = fd_nonce_state_decode_footprint_inner( ctx, total_sz );
    6202           0 :     if( FD_UNLIKELY( err ) ) return err;
    6203           0 :     return FD_BINCODE_SUCCESS;
    6204           0 :   }
    6205           0 :   case 1: {
    6206           0 :     err = fd_nonce_state_decode_footprint_inner( ctx, total_sz );
    6207           0 :     if( FD_UNLIKELY( err ) ) return err;
    6208           0 :     return FD_BINCODE_SUCCESS;
    6209           0 :   }
    6210           0 :   default: return FD_BINCODE_ERR_ENCODING;
    6211           0 :   }
    6212           0 : }
    6213           0 : static int fd_nonce_state_versions_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6214           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6215           0 :   uint discriminant = 0;
    6216           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    6217           0 :   if( FD_UNLIKELY( err ) ) return err;
    6218           0 :   return fd_nonce_state_versions_inner_decode_footprint( discriminant, ctx, total_sz );
    6219           0 : }
    6220           0 : int fd_nonce_state_versions_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6221           0 :   *total_sz += sizeof(fd_nonce_state_versions_t);
    6222           0 :   void const * start_data = ctx->data;
    6223           0 :   int err =  fd_nonce_state_versions_decode_footprint_inner( ctx, total_sz );
    6224           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6225           0 :   ctx->data = start_data;
    6226           0 :   return err;
    6227           0 : }
    6228           0 : static void fd_nonce_state_versions_inner_decode_inner( fd_nonce_state_versions_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    6229           0 :   switch (discriminant) {
    6230           0 :   case 0: {
    6231           0 :     fd_nonce_state_decode_inner( &self->legacy, alloc_mem, ctx );
    6232           0 :     break;
    6233           0 :   }
    6234           0 :   case 1: {
    6235           0 :     fd_nonce_state_decode_inner( &self->current, alloc_mem, ctx );
    6236           0 :     break;
    6237           0 :   }
    6238           0 :   }
    6239           0 : }
    6240           0 : static void fd_nonce_state_versions_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6241           0 :   fd_nonce_state_versions_t * self = (fd_nonce_state_versions_t *)struct_mem;
    6242           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    6243           0 :   fd_nonce_state_versions_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    6244           0 : }
    6245           0 : void * fd_nonce_state_versions_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6246           0 :   fd_nonce_state_versions_t * self = (fd_nonce_state_versions_t *)mem;
    6247           0 :   fd_nonce_state_versions_new( self );
    6248           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_nonce_state_versions_t);
    6249           0 :   void * * alloc_mem = &alloc_region;
    6250           0 :   fd_nonce_state_versions_decode_inner( mem, alloc_mem, ctx );
    6251           0 :   return self;
    6252           0 : }
    6253           0 : void fd_nonce_state_versions_inner_new( fd_nonce_state_versions_inner_t * self, uint discriminant ) {
    6254           0 :   switch( discriminant ) {
    6255           0 :   case 0: {
    6256           0 :     fd_nonce_state_new( &self->legacy );
    6257           0 :     break;
    6258           0 :   }
    6259           0 :   case 1: {
    6260           0 :     fd_nonce_state_new( &self->current );
    6261           0 :     break;
    6262           0 :   }
    6263           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    6264           0 :   }
    6265           0 : }
    6266           0 : void fd_nonce_state_versions_new_disc( fd_nonce_state_versions_t * self, uint discriminant ) {
    6267           0 :   self->discriminant = discriminant;
    6268           0 :   fd_nonce_state_versions_inner_new( &self->inner, self->discriminant );
    6269           0 : }
    6270           0 : void fd_nonce_state_versions_new( fd_nonce_state_versions_t * self ) {
    6271           0 :   fd_memset( self, 0, sizeof(fd_nonce_state_versions_t) );
    6272           0 :   fd_nonce_state_versions_new_disc( self, UINT_MAX );
    6273           0 : }
    6274             : 
    6275           0 : ulong fd_nonce_state_versions_size( fd_nonce_state_versions_t const * self ) {
    6276           0 :   ulong size = 0;
    6277           0 :   size += sizeof(uint);
    6278           0 :   switch (self->discriminant) {
    6279           0 :   case 0: {
    6280           0 :     size += fd_nonce_state_size( &self->inner.legacy );
    6281           0 :     break;
    6282           0 :   }
    6283           0 :   case 1: {
    6284           0 :     size += fd_nonce_state_size( &self->inner.current );
    6285           0 :     break;
    6286           0 :   }
    6287           0 :   }
    6288           0 :   return size;
    6289           0 : }
    6290             : 
    6291           0 : int fd_nonce_state_versions_inner_encode( fd_nonce_state_versions_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    6292           0 :   int err;
    6293           0 :   switch (discriminant) {
    6294           0 :   case 0: {
    6295           0 :     err = fd_nonce_state_encode( &self->legacy, ctx );
    6296           0 :     if( FD_UNLIKELY( err ) ) return err;
    6297           0 :     break;
    6298           0 :   }
    6299           0 :   case 1: {
    6300           0 :     err = fd_nonce_state_encode( &self->current, ctx );
    6301           0 :     if( FD_UNLIKELY( err ) ) return err;
    6302           0 :     break;
    6303           0 :   }
    6304           0 :   }
    6305           0 :   return FD_BINCODE_SUCCESS;
    6306           0 : }
    6307           0 : int fd_nonce_state_versions_encode( fd_nonce_state_versions_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6308           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    6309           0 :   if( FD_UNLIKELY( err ) ) return err;
    6310           0 :   return fd_nonce_state_versions_inner_encode( &self->inner, self->discriminant, ctx );
    6311           0 : }
    6312             : 
    6313           0 : int fd_compute_budget_program_instruction_request_units_deprecated_encode( fd_compute_budget_program_instruction_request_units_deprecated_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6314           0 :   int err;
    6315           0 :   err = fd_bincode_uint32_encode( self->units, ctx );
    6316           0 :   if( FD_UNLIKELY( err ) ) return err;
    6317           0 :   err = fd_bincode_uint32_encode( self->additional_fee, ctx );
    6318           0 :   if( FD_UNLIKELY( err ) ) return err;
    6319           0 :   return FD_BINCODE_SUCCESS;
    6320           0 : }
    6321           0 : static inline int fd_compute_budget_program_instruction_request_units_deprecated_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6322           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6323           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
    6324           0 :   return 0;
    6325           0 : }
    6326           0 : static void fd_compute_budget_program_instruction_request_units_deprecated_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6327           0 :   fd_compute_budget_program_instruction_request_units_deprecated_t * self = (fd_compute_budget_program_instruction_request_units_deprecated_t *)struct_mem;
    6328           0 :   fd_bincode_uint32_decode_unsafe( &self->units, ctx );
    6329           0 :   fd_bincode_uint32_decode_unsafe( &self->additional_fee, ctx );
    6330           0 : }
    6331           0 : void * fd_compute_budget_program_instruction_request_units_deprecated_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6332           0 :   fd_compute_budget_program_instruction_request_units_deprecated_t * self = (fd_compute_budget_program_instruction_request_units_deprecated_t *)mem;
    6333           0 :   fd_compute_budget_program_instruction_request_units_deprecated_new( self );
    6334           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_compute_budget_program_instruction_request_units_deprecated_t);
    6335           0 :   void * * alloc_mem = &alloc_region;
    6336           0 :   fd_compute_budget_program_instruction_request_units_deprecated_decode_inner( mem, alloc_mem, ctx );
    6337           0 :   return self;
    6338           0 : }
    6339           0 : FD_FN_PURE uchar fd_compute_budget_program_instruction_is_request_units_deprecated(fd_compute_budget_program_instruction_t const * self) {
    6340           0 :   return self->discriminant == 0;
    6341           0 : }
    6342           0 : FD_FN_PURE uchar fd_compute_budget_program_instruction_is_request_heap_frame(fd_compute_budget_program_instruction_t const * self) {
    6343           0 :   return self->discriminant == 1;
    6344           0 : }
    6345           0 : FD_FN_PURE uchar fd_compute_budget_program_instruction_is_set_compute_unit_limit(fd_compute_budget_program_instruction_t const * self) {
    6346           0 :   return self->discriminant == 2;
    6347           0 : }
    6348           0 : FD_FN_PURE uchar fd_compute_budget_program_instruction_is_set_compute_unit_price(fd_compute_budget_program_instruction_t const * self) {
    6349           0 :   return self->discriminant == 3;
    6350           0 : }
    6351           0 : FD_FN_PURE uchar fd_compute_budget_program_instruction_is_set_loaded_accounts_data_size_limit(fd_compute_budget_program_instruction_t const * self) {
    6352           0 :   return self->discriminant == 4;
    6353           0 : }
    6354             : void fd_compute_budget_program_instruction_inner_new( fd_compute_budget_program_instruction_inner_t * self, uint discriminant );
    6355          15 : int fd_compute_budget_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6356          15 :   int err;
    6357          15 :   switch (discriminant) {
    6358           0 :   case 0: {
    6359           0 :     err = fd_compute_budget_program_instruction_request_units_deprecated_decode_footprint_inner( ctx, total_sz );
    6360           0 :     if( FD_UNLIKELY( err ) ) return err;
    6361           0 :     return FD_BINCODE_SUCCESS;
    6362           0 :   }
    6363           0 :   case 1: {
    6364           0 :     err = fd_bincode_uint32_decode_footprint( ctx );
    6365           0 :   if( FD_UNLIKELY( err ) ) return err;
    6366           0 :     return FD_BINCODE_SUCCESS;
    6367           0 :   }
    6368          15 :   case 2: {
    6369          15 :     err = fd_bincode_uint32_decode_footprint( ctx );
    6370          15 :   if( FD_UNLIKELY( err ) ) return err;
    6371          15 :     return FD_BINCODE_SUCCESS;
    6372          15 :   }
    6373           0 :   case 3: {
    6374           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    6375           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6376           0 :     return FD_BINCODE_SUCCESS;
    6377           0 :   }
    6378           0 :   case 4: {
    6379           0 :     err = fd_bincode_uint32_decode_footprint( ctx );
    6380           0 :   if( FD_UNLIKELY( err ) ) return err;
    6381           0 :     return FD_BINCODE_SUCCESS;
    6382           0 :   }
    6383           0 :   default: return FD_BINCODE_ERR_ENCODING;
    6384          15 :   }
    6385          15 : }
    6386          15 : static int fd_compute_budget_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6387          15 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6388          15 :   ushort discriminant = 0;
    6389          15 :   int err = fd_bincode_compact_u16_decode( &discriminant, ctx );
    6390          15 :   if( FD_UNLIKELY( err ) ) return err;
    6391          15 :   return fd_compute_budget_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    6392          15 : }
    6393          15 : int fd_compute_budget_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6394          15 :   *total_sz += sizeof(fd_compute_budget_program_instruction_t);
    6395          15 :   void const * start_data = ctx->data;
    6396          15 :   int err =  fd_compute_budget_program_instruction_decode_footprint_inner( ctx, total_sz );
    6397          15 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6398          15 :   ctx->data = start_data;
    6399          15 :   return err;
    6400          15 : }
    6401          15 : static void fd_compute_budget_program_instruction_inner_decode_inner( fd_compute_budget_program_instruction_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    6402          15 :   switch (discriminant) {
    6403           0 :   case 0: {
    6404           0 :     fd_compute_budget_program_instruction_request_units_deprecated_decode_inner( &self->request_units_deprecated, alloc_mem, ctx );
    6405           0 :     break;
    6406           0 :   }
    6407           0 :   case 1: {
    6408           0 :     fd_bincode_uint32_decode_unsafe( &self->request_heap_frame, ctx );
    6409           0 :     break;
    6410           0 :   }
    6411          15 :   case 2: {
    6412          15 :     fd_bincode_uint32_decode_unsafe( &self->set_compute_unit_limit, ctx );
    6413          15 :     break;
    6414           0 :   }
    6415           0 :   case 3: {
    6416           0 :     fd_bincode_uint64_decode_unsafe( &self->set_compute_unit_price, ctx );
    6417           0 :     break;
    6418           0 :   }
    6419           0 :   case 4: {
    6420           0 :     fd_bincode_uint32_decode_unsafe( &self->set_loaded_accounts_data_size_limit, ctx );
    6421           0 :     break;
    6422           0 :   }
    6423          15 :   }
    6424          15 : }
    6425          15 : static void fd_compute_budget_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6426          15 :   fd_compute_budget_program_instruction_t * self = (fd_compute_budget_program_instruction_t *)struct_mem;
    6427          15 :   ushort tmp = 0;
    6428          15 :   fd_bincode_compact_u16_decode_unsafe( &tmp, ctx );
    6429          15 :   self->discriminant = tmp;
    6430          15 :   fd_compute_budget_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    6431          15 : }
    6432          15 : void * fd_compute_budget_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6433          15 :   fd_compute_budget_program_instruction_t * self = (fd_compute_budget_program_instruction_t *)mem;
    6434          15 :   fd_compute_budget_program_instruction_new( self );
    6435          15 :   void * alloc_region = (uchar *)mem + sizeof(fd_compute_budget_program_instruction_t);
    6436          15 :   void * * alloc_mem = &alloc_region;
    6437          15 :   fd_compute_budget_program_instruction_decode_inner( mem, alloc_mem, ctx );
    6438          15 :   return self;
    6439          15 : }
    6440          15 : void fd_compute_budget_program_instruction_inner_new( fd_compute_budget_program_instruction_inner_t * self, uint discriminant ) {
    6441          15 :   switch( discriminant ) {
    6442           0 :   case 0: {
    6443           0 :     fd_compute_budget_program_instruction_request_units_deprecated_new( &self->request_units_deprecated );
    6444           0 :     break;
    6445           0 :   }
    6446           0 :   case 1: {
    6447           0 :     break;
    6448           0 :   }
    6449           0 :   case 2: {
    6450           0 :     break;
    6451           0 :   }
    6452           0 :   case 3: {
    6453           0 :     break;
    6454           0 :   }
    6455           0 :   case 4: {
    6456           0 :     break;
    6457           0 :   }
    6458          15 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    6459          15 :   }
    6460          15 : }
    6461          15 : void fd_compute_budget_program_instruction_new_disc( fd_compute_budget_program_instruction_t * self, uint discriminant ) {
    6462          15 :   self->discriminant = discriminant;
    6463          15 :   fd_compute_budget_program_instruction_inner_new( &self->inner, self->discriminant );
    6464          15 : }
    6465          15 : void fd_compute_budget_program_instruction_new( fd_compute_budget_program_instruction_t * self ) {
    6466          15 :   fd_memset( self, 0, sizeof(fd_compute_budget_program_instruction_t) );
    6467          15 :   fd_compute_budget_program_instruction_new_disc( self, UINT_MAX );
    6468          15 : }
    6469             : 
    6470           0 : ulong fd_compute_budget_program_instruction_size( fd_compute_budget_program_instruction_t const * self ) {
    6471           0 :   ulong size = 0;
    6472           0 :   size += sizeof(uint);
    6473           0 :   switch (self->discriminant) {
    6474           0 :   case 0: {
    6475           0 :     size += fd_compute_budget_program_instruction_request_units_deprecated_size( &self->inner.request_units_deprecated );
    6476           0 :     break;
    6477           0 :   }
    6478           0 :   case 1: {
    6479           0 :     size += sizeof(uint);
    6480           0 :     break;
    6481           0 :   }
    6482           0 :   case 2: {
    6483           0 :     size += sizeof(uint);
    6484           0 :     break;
    6485           0 :   }
    6486           0 :   case 3: {
    6487           0 :     size += sizeof(ulong);
    6488           0 :     break;
    6489           0 :   }
    6490           0 :   case 4: {
    6491           0 :     size += sizeof(uint);
    6492           0 :     break;
    6493           0 :   }
    6494           0 :   }
    6495           0 :   return size;
    6496           0 : }
    6497             : 
    6498           0 : int fd_compute_budget_program_instruction_inner_encode( fd_compute_budget_program_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    6499           0 :   int err;
    6500           0 :   switch (discriminant) {
    6501           0 :   case 0: {
    6502           0 :     err = fd_compute_budget_program_instruction_request_units_deprecated_encode( &self->request_units_deprecated, ctx );
    6503           0 :     if( FD_UNLIKELY( err ) ) return err;
    6504           0 :     break;
    6505           0 :   }
    6506           0 :   case 1: {
    6507           0 :     err = fd_bincode_uint32_encode( self->request_heap_frame, ctx );
    6508           0 :   if( FD_UNLIKELY( err ) ) return err;
    6509           0 :     break;
    6510           0 :   }
    6511           0 :   case 2: {
    6512           0 :     err = fd_bincode_uint32_encode( self->set_compute_unit_limit, ctx );
    6513           0 :   if( FD_UNLIKELY( err ) ) return err;
    6514           0 :     break;
    6515           0 :   }
    6516           0 :   case 3: {
    6517           0 :     err = fd_bincode_uint64_encode( self->set_compute_unit_price, ctx );
    6518           0 :     if( FD_UNLIKELY( err ) ) return err;
    6519           0 :     break;
    6520           0 :   }
    6521           0 :   case 4: {
    6522           0 :     err = fd_bincode_uint32_encode( self->set_loaded_accounts_data_size_limit, ctx );
    6523           0 :   if( FD_UNLIKELY( err ) ) return err;
    6524           0 :     break;
    6525           0 :   }
    6526           0 :   }
    6527           0 :   return FD_BINCODE_SUCCESS;
    6528           0 : }
    6529           0 : int fd_compute_budget_program_instruction_encode( fd_compute_budget_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6530           0 :   ushort discriminant = (ushort) self->discriminant;
    6531           0 :   int err = fd_bincode_compact_u16_encode( &discriminant, ctx );
    6532           0 :   if( FD_UNLIKELY( err ) ) return err;
    6533           0 :   return fd_compute_budget_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    6534           0 : }
    6535             : 
    6536           0 : int fd_bpf_loader_program_instruction_write_encode( fd_bpf_loader_program_instruction_write_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6537           0 :   int err;
    6538           0 :   err = fd_bincode_uint32_encode( self->offset, ctx );
    6539           0 :   if( FD_UNLIKELY( err ) ) return err;
    6540           0 :   err = fd_bincode_uint64_encode( self->bytes_len, ctx );
    6541           0 :   if( FD_UNLIKELY(err) ) return err;
    6542           0 :   if( self->bytes_len ) {
    6543           0 :     err = fd_bincode_bytes_encode( self->bytes, self->bytes_len, ctx );
    6544           0 :     if( FD_UNLIKELY( err ) ) return err;
    6545           0 :   }
    6546           0 :   return FD_BINCODE_SUCCESS;
    6547           0 : }
    6548           0 : static int fd_bpf_loader_program_instruction_write_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6549           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6550           0 :   int err = 0;
    6551           0 :   err = fd_bincode_uint32_decode_footprint( ctx );
    6552           0 :   if( FD_UNLIKELY( err ) ) return err;
    6553           0 :   ulong bytes_len;
    6554           0 :   err = fd_bincode_uint64_decode( &bytes_len, ctx );
    6555           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6556           0 :   if( bytes_len ) {
    6557           0 :     *total_sz += 8UL + bytes_len;
    6558           0 :     err = fd_bincode_bytes_decode_footprint( bytes_len, ctx );
    6559           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6560           0 :   }
    6561           0 :   return 0;
    6562           0 : }
    6563           0 : int fd_bpf_loader_program_instruction_write_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6564           0 :   *total_sz += sizeof(fd_bpf_loader_program_instruction_write_t);
    6565           0 :   void const * start_data = ctx->data;
    6566           0 :   int err = fd_bpf_loader_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    6567           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6568           0 :   ctx->data = start_data;
    6569           0 :   return err;
    6570           0 : }
    6571           0 : static void fd_bpf_loader_program_instruction_write_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6572           0 :   fd_bpf_loader_program_instruction_write_t * self = (fd_bpf_loader_program_instruction_write_t *)struct_mem;
    6573           0 :   fd_bincode_uint32_decode_unsafe( &self->offset, ctx );
    6574           0 :   fd_bincode_uint64_decode_unsafe( &self->bytes_len, ctx );
    6575           0 :   if( self->bytes_len ) {
    6576           0 :     self->bytes = *alloc_mem;
    6577           0 :     fd_bincode_bytes_decode_unsafe( self->bytes, self->bytes_len, ctx );
    6578           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->bytes_len;
    6579           0 :   } else
    6580           0 :     self->bytes = NULL;
    6581           0 : }
    6582           0 : void * fd_bpf_loader_program_instruction_write_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6583           0 :   fd_bpf_loader_program_instruction_write_t * self = (fd_bpf_loader_program_instruction_write_t *)mem;
    6584           0 :   fd_bpf_loader_program_instruction_write_new( self );
    6585           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_loader_program_instruction_write_t);
    6586           0 :   void * * alloc_mem = &alloc_region;
    6587           0 :   fd_bpf_loader_program_instruction_write_decode_inner( mem, alloc_mem, ctx );
    6588           0 :   return self;
    6589           0 : }
    6590           0 : void fd_bpf_loader_program_instruction_write_new(fd_bpf_loader_program_instruction_write_t * self) {
    6591           0 :   fd_memset( self, 0, sizeof(fd_bpf_loader_program_instruction_write_t) );
    6592           0 : }
    6593           0 : ulong fd_bpf_loader_program_instruction_write_size( fd_bpf_loader_program_instruction_write_t const * self ) {
    6594           0 :   ulong size = 0;
    6595           0 :   size += sizeof(uint);
    6596           0 :   do {
    6597           0 :     size += sizeof(ulong);
    6598           0 :     size += self->bytes_len;
    6599           0 :   } while(0);
    6600           0 :   return size;
    6601           0 : }
    6602             : 
    6603           0 : FD_FN_PURE uchar fd_bpf_loader_program_instruction_is_write(fd_bpf_loader_program_instruction_t const * self) {
    6604           0 :   return self->discriminant == 0;
    6605           0 : }
    6606           0 : FD_FN_PURE uchar fd_bpf_loader_program_instruction_is_finalize(fd_bpf_loader_program_instruction_t const * self) {
    6607           0 :   return self->discriminant == 1;
    6608           0 : }
    6609             : void fd_bpf_loader_program_instruction_inner_new( fd_bpf_loader_program_instruction_inner_t * self, uint discriminant );
    6610           0 : int fd_bpf_loader_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6611           0 :   int err;
    6612           0 :   switch (discriminant) {
    6613           0 :   case 0: {
    6614           0 :     err = fd_bpf_loader_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    6615           0 :     if( FD_UNLIKELY( err ) ) return err;
    6616           0 :     return FD_BINCODE_SUCCESS;
    6617           0 :   }
    6618           0 :   case 1: {
    6619           0 :     return FD_BINCODE_SUCCESS;
    6620           0 :   }
    6621           0 :   default: return FD_BINCODE_ERR_ENCODING;
    6622           0 :   }
    6623           0 : }
    6624           0 : static int fd_bpf_loader_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6625           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6626           0 :   uint discriminant = 0;
    6627           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    6628           0 :   if( FD_UNLIKELY( err ) ) return err;
    6629           0 :   return fd_bpf_loader_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    6630           0 : }
    6631           0 : int fd_bpf_loader_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6632           0 :   *total_sz += sizeof(fd_bpf_loader_program_instruction_t);
    6633           0 :   void const * start_data = ctx->data;
    6634           0 :   int err =  fd_bpf_loader_program_instruction_decode_footprint_inner( ctx, total_sz );
    6635           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6636           0 :   ctx->data = start_data;
    6637           0 :   return err;
    6638           0 : }
    6639           0 : static void fd_bpf_loader_program_instruction_inner_decode_inner( fd_bpf_loader_program_instruction_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    6640           0 :   switch (discriminant) {
    6641           0 :   case 0: {
    6642           0 :     fd_bpf_loader_program_instruction_write_decode_inner( &self->write, alloc_mem, ctx );
    6643           0 :     break;
    6644           0 :   }
    6645           0 :   case 1: {
    6646           0 :     break;
    6647           0 :   }
    6648           0 :   }
    6649           0 : }
    6650           0 : static void fd_bpf_loader_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6651           0 :   fd_bpf_loader_program_instruction_t * self = (fd_bpf_loader_program_instruction_t *)struct_mem;
    6652           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    6653           0 :   fd_bpf_loader_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    6654           0 : }
    6655           0 : void * fd_bpf_loader_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6656           0 :   fd_bpf_loader_program_instruction_t * self = (fd_bpf_loader_program_instruction_t *)mem;
    6657           0 :   fd_bpf_loader_program_instruction_new( self );
    6658           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_loader_program_instruction_t);
    6659           0 :   void * * alloc_mem = &alloc_region;
    6660           0 :   fd_bpf_loader_program_instruction_decode_inner( mem, alloc_mem, ctx );
    6661           0 :   return self;
    6662           0 : }
    6663           0 : void fd_bpf_loader_program_instruction_inner_new( fd_bpf_loader_program_instruction_inner_t * self, uint discriminant ) {
    6664           0 :   switch( discriminant ) {
    6665           0 :   case 0: {
    6666           0 :     fd_bpf_loader_program_instruction_write_new( &self->write );
    6667           0 :     break;
    6668           0 :   }
    6669           0 :   case 1: {
    6670           0 :     break;
    6671           0 :   }
    6672           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    6673           0 :   }
    6674           0 : }
    6675           0 : void fd_bpf_loader_program_instruction_new_disc( fd_bpf_loader_program_instruction_t * self, uint discriminant ) {
    6676           0 :   self->discriminant = discriminant;
    6677           0 :   fd_bpf_loader_program_instruction_inner_new( &self->inner, self->discriminant );
    6678           0 : }
    6679           0 : void fd_bpf_loader_program_instruction_new( fd_bpf_loader_program_instruction_t * self ) {
    6680           0 :   fd_memset( self, 0, sizeof(fd_bpf_loader_program_instruction_t) );
    6681           0 :   fd_bpf_loader_program_instruction_new_disc( self, UINT_MAX );
    6682           0 : }
    6683             : 
    6684           0 : ulong fd_bpf_loader_program_instruction_size( fd_bpf_loader_program_instruction_t const * self ) {
    6685           0 :   ulong size = 0;
    6686           0 :   size += sizeof(uint);
    6687           0 :   switch (self->discriminant) {
    6688           0 :   case 0: {
    6689           0 :     size += fd_bpf_loader_program_instruction_write_size( &self->inner.write );
    6690           0 :     break;
    6691           0 :   }
    6692           0 :   }
    6693           0 :   return size;
    6694           0 : }
    6695             : 
    6696           0 : int fd_bpf_loader_program_instruction_inner_encode( fd_bpf_loader_program_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    6697           0 :   int err;
    6698           0 :   switch (discriminant) {
    6699           0 :   case 0: {
    6700           0 :     err = fd_bpf_loader_program_instruction_write_encode( &self->write, ctx );
    6701           0 :     if( FD_UNLIKELY( err ) ) return err;
    6702           0 :     break;
    6703           0 :   }
    6704           0 :   }
    6705           0 :   return FD_BINCODE_SUCCESS;
    6706           0 : }
    6707           0 : int fd_bpf_loader_program_instruction_encode( fd_bpf_loader_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6708           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    6709           0 :   if( FD_UNLIKELY( err ) ) return err;
    6710           0 :   return fd_bpf_loader_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    6711           0 : }
    6712             : 
    6713           0 : int fd_loader_v4_program_instruction_write_encode( fd_loader_v4_program_instruction_write_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6714           0 :   int err;
    6715           0 :   err = fd_bincode_uint32_encode( self->offset, ctx );
    6716           0 :   if( FD_UNLIKELY( err ) ) return err;
    6717           0 :   err = fd_bincode_uint64_encode( self->bytes_len, ctx );
    6718           0 :   if( FD_UNLIKELY(err) ) return err;
    6719           0 :   if( self->bytes_len ) {
    6720           0 :     err = fd_bincode_bytes_encode( self->bytes, self->bytes_len, ctx );
    6721           0 :     if( FD_UNLIKELY( err ) ) return err;
    6722           0 :   }
    6723           0 :   return FD_BINCODE_SUCCESS;
    6724           0 : }
    6725           0 : static int fd_loader_v4_program_instruction_write_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6726           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6727           0 :   int err = 0;
    6728           0 :   err = fd_bincode_uint32_decode_footprint( ctx );
    6729           0 :   if( FD_UNLIKELY( err ) ) return err;
    6730           0 :   ulong bytes_len;
    6731           0 :   err = fd_bincode_uint64_decode( &bytes_len, ctx );
    6732           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6733           0 :   if( bytes_len ) {
    6734           0 :     *total_sz += 8UL + bytes_len;
    6735           0 :     err = fd_bincode_bytes_decode_footprint( bytes_len, ctx );
    6736           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6737           0 :   }
    6738           0 :   return 0;
    6739           0 : }
    6740           0 : int fd_loader_v4_program_instruction_write_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6741           0 :   *total_sz += sizeof(fd_loader_v4_program_instruction_write_t);
    6742           0 :   void const * start_data = ctx->data;
    6743           0 :   int err = fd_loader_v4_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    6744           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6745           0 :   ctx->data = start_data;
    6746           0 :   return err;
    6747           0 : }
    6748           0 : static void fd_loader_v4_program_instruction_write_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6749           0 :   fd_loader_v4_program_instruction_write_t * self = (fd_loader_v4_program_instruction_write_t *)struct_mem;
    6750           0 :   fd_bincode_uint32_decode_unsafe( &self->offset, ctx );
    6751           0 :   fd_bincode_uint64_decode_unsafe( &self->bytes_len, ctx );
    6752           0 :   if( self->bytes_len ) {
    6753           0 :     self->bytes = *alloc_mem;
    6754           0 :     fd_bincode_bytes_decode_unsafe( self->bytes, self->bytes_len, ctx );
    6755           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->bytes_len;
    6756           0 :   } else
    6757           0 :     self->bytes = NULL;
    6758           0 : }
    6759           0 : void * fd_loader_v4_program_instruction_write_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6760           0 :   fd_loader_v4_program_instruction_write_t * self = (fd_loader_v4_program_instruction_write_t *)mem;
    6761           0 :   fd_loader_v4_program_instruction_write_new( self );
    6762           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_program_instruction_write_t);
    6763           0 :   void * * alloc_mem = &alloc_region;
    6764           0 :   fd_loader_v4_program_instruction_write_decode_inner( mem, alloc_mem, ctx );
    6765           0 :   return self;
    6766           0 : }
    6767           0 : void fd_loader_v4_program_instruction_write_new(fd_loader_v4_program_instruction_write_t * self) {
    6768           0 :   fd_memset( self, 0, sizeof(fd_loader_v4_program_instruction_write_t) );
    6769           0 : }
    6770           0 : ulong fd_loader_v4_program_instruction_write_size( fd_loader_v4_program_instruction_write_t const * self ) {
    6771           0 :   ulong size = 0;
    6772           0 :   size += sizeof(uint);
    6773           0 :   do {
    6774           0 :     size += sizeof(ulong);
    6775           0 :     size += self->bytes_len;
    6776           0 :   } while(0);
    6777           0 :   return size;
    6778           0 : }
    6779             : 
    6780           0 : int fd_loader_v4_program_instruction_copy_encode( fd_loader_v4_program_instruction_copy_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6781           0 :   int err;
    6782           0 :   err = fd_bincode_uint32_encode( self->destination_offset, ctx );
    6783           0 :   if( FD_UNLIKELY( err ) ) return err;
    6784           0 :   err = fd_bincode_uint32_encode( self->source_offset, ctx );
    6785           0 :   if( FD_UNLIKELY( err ) ) return err;
    6786           0 :   err = fd_bincode_uint32_encode( self->length, ctx );
    6787           0 :   if( FD_UNLIKELY( err ) ) return err;
    6788           0 :   return FD_BINCODE_SUCCESS;
    6789           0 : }
    6790           0 : static inline int fd_loader_v4_program_instruction_copy_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6791           0 :   if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6792           0 :   ctx->data = (void *)( (ulong)ctx->data + 12UL );
    6793           0 :   return 0;
    6794           0 : }
    6795           0 : static void fd_loader_v4_program_instruction_copy_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6796           0 :   fd_loader_v4_program_instruction_copy_t * self = (fd_loader_v4_program_instruction_copy_t *)struct_mem;
    6797           0 :   fd_bincode_uint32_decode_unsafe( &self->destination_offset, ctx );
    6798           0 :   fd_bincode_uint32_decode_unsafe( &self->source_offset, ctx );
    6799           0 :   fd_bincode_uint32_decode_unsafe( &self->length, ctx );
    6800           0 : }
    6801           0 : void * fd_loader_v4_program_instruction_copy_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6802           0 :   fd_loader_v4_program_instruction_copy_t * self = (fd_loader_v4_program_instruction_copy_t *)mem;
    6803           0 :   fd_loader_v4_program_instruction_copy_new( self );
    6804           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_program_instruction_copy_t);
    6805           0 :   void * * alloc_mem = &alloc_region;
    6806           0 :   fd_loader_v4_program_instruction_copy_decode_inner( mem, alloc_mem, ctx );
    6807           0 :   return self;
    6808           0 : }
    6809           0 : int fd_loader_v4_program_instruction_set_program_length_encode( fd_loader_v4_program_instruction_set_program_length_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6810           0 :   int err;
    6811           0 :   err = fd_bincode_uint32_encode( self->new_size, ctx );
    6812           0 :   if( FD_UNLIKELY( err ) ) return err;
    6813           0 :   return FD_BINCODE_SUCCESS;
    6814           0 : }
    6815           6 : static inline int fd_loader_v4_program_instruction_set_program_length_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6816           6 :   if( (ulong)ctx->data + 4UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6817           6 :   ctx->data = (void *)( (ulong)ctx->data + 4UL );
    6818           6 :   return 0;
    6819           6 : }
    6820           6 : static void fd_loader_v4_program_instruction_set_program_length_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6821           6 :   fd_loader_v4_program_instruction_set_program_length_t * self = (fd_loader_v4_program_instruction_set_program_length_t *)struct_mem;
    6822           6 :   fd_bincode_uint32_decode_unsafe( &self->new_size, ctx );
    6823           6 : }
    6824           0 : void * fd_loader_v4_program_instruction_set_program_length_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6825           0 :   fd_loader_v4_program_instruction_set_program_length_t * self = (fd_loader_v4_program_instruction_set_program_length_t *)mem;
    6826           0 :   fd_loader_v4_program_instruction_set_program_length_new( self );
    6827           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_program_instruction_set_program_length_t);
    6828           0 :   void * * alloc_mem = &alloc_region;
    6829           0 :   fd_loader_v4_program_instruction_set_program_length_decode_inner( mem, alloc_mem, ctx );
    6830           0 :   return self;
    6831           0 : }
    6832           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_write(fd_loader_v4_program_instruction_t const * self) {
    6833           0 :   return self->discriminant == 0;
    6834           0 : }
    6835           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_copy(fd_loader_v4_program_instruction_t const * self) {
    6836           0 :   return self->discriminant == 1;
    6837           0 : }
    6838           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_set_program_length(fd_loader_v4_program_instruction_t const * self) {
    6839           0 :   return self->discriminant == 2;
    6840           0 : }
    6841           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_deploy(fd_loader_v4_program_instruction_t const * self) {
    6842           0 :   return self->discriminant == 3;
    6843           0 : }
    6844           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_retract(fd_loader_v4_program_instruction_t const * self) {
    6845           0 :   return self->discriminant == 4;
    6846           0 : }
    6847           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_transfer_authority(fd_loader_v4_program_instruction_t const * self) {
    6848           0 :   return self->discriminant == 5;
    6849           0 : }
    6850           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_finalize(fd_loader_v4_program_instruction_t const * self) {
    6851           0 :   return self->discriminant == 6;
    6852           0 : }
    6853             : void fd_loader_v4_program_instruction_inner_new( fd_loader_v4_program_instruction_inner_t * self, uint discriminant );
    6854           6 : int fd_loader_v4_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6855           6 :   int err;
    6856           6 :   switch (discriminant) {
    6857           0 :   case 0: {
    6858           0 :     err = fd_loader_v4_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    6859           0 :     if( FD_UNLIKELY( err ) ) return err;
    6860           0 :     return FD_BINCODE_SUCCESS;
    6861           0 :   }
    6862           0 :   case 1: {
    6863           0 :     err = fd_loader_v4_program_instruction_copy_decode_footprint_inner( ctx, total_sz );
    6864           0 :     if( FD_UNLIKELY( err ) ) return err;
    6865           0 :     return FD_BINCODE_SUCCESS;
    6866           0 :   }
    6867           6 :   case 2: {
    6868           6 :     err = fd_loader_v4_program_instruction_set_program_length_decode_footprint_inner( ctx, total_sz );
    6869           6 :     if( FD_UNLIKELY( err ) ) return err;
    6870           6 :     return FD_BINCODE_SUCCESS;
    6871           6 :   }
    6872           0 :   case 3: {
    6873           0 :     return FD_BINCODE_SUCCESS;
    6874           6 :   }
    6875           0 :   case 4: {
    6876           0 :     return FD_BINCODE_SUCCESS;
    6877           6 :   }
    6878           0 :   case 5: {
    6879           0 :     return FD_BINCODE_SUCCESS;
    6880           6 :   }
    6881           0 :   case 6: {
    6882           0 :     return FD_BINCODE_SUCCESS;
    6883           6 :   }
    6884           0 :   default: return FD_BINCODE_ERR_ENCODING;
    6885           6 :   }
    6886           6 : }
    6887           6 : static int fd_loader_v4_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6888           6 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6889           6 :   uint discriminant = 0;
    6890           6 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    6891           6 :   if( FD_UNLIKELY( err ) ) return err;
    6892           6 :   return fd_loader_v4_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    6893           6 : }
    6894           6 : int fd_loader_v4_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6895           6 :   *total_sz += sizeof(fd_loader_v4_program_instruction_t);
    6896           6 :   void const * start_data = ctx->data;
    6897           6 :   int err =  fd_loader_v4_program_instruction_decode_footprint_inner( ctx, total_sz );
    6898           6 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6899           6 :   ctx->data = start_data;
    6900           6 :   return err;
    6901           6 : }
    6902           6 : static void fd_loader_v4_program_instruction_inner_decode_inner( fd_loader_v4_program_instruction_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    6903           6 :   switch (discriminant) {
    6904           0 :   case 0: {
    6905           0 :     fd_loader_v4_program_instruction_write_decode_inner( &self->write, alloc_mem, ctx );
    6906           0 :     break;
    6907           0 :   }
    6908           0 :   case 1: {
    6909           0 :     fd_loader_v4_program_instruction_copy_decode_inner( &self->copy, alloc_mem, ctx );
    6910           0 :     break;
    6911           0 :   }
    6912           6 :   case 2: {
    6913           6 :     fd_loader_v4_program_instruction_set_program_length_decode_inner( &self->set_program_length, alloc_mem, ctx );
    6914           6 :     break;
    6915           0 :   }
    6916           0 :   case 3: {
    6917           0 :     break;
    6918           0 :   }
    6919           0 :   case 4: {
    6920           0 :     break;
    6921           0 :   }
    6922           0 :   case 5: {
    6923           0 :     break;
    6924           0 :   }
    6925           0 :   case 6: {
    6926           0 :     break;
    6927           0 :   }
    6928           6 :   }
    6929           6 : }
    6930           6 : static void fd_loader_v4_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6931           6 :   fd_loader_v4_program_instruction_t * self = (fd_loader_v4_program_instruction_t *)struct_mem;
    6932           6 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    6933           6 :   fd_loader_v4_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    6934           6 : }
    6935           6 : void * fd_loader_v4_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6936           6 :   fd_loader_v4_program_instruction_t * self = (fd_loader_v4_program_instruction_t *)mem;
    6937           6 :   fd_loader_v4_program_instruction_new( self );
    6938           6 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_program_instruction_t);
    6939           6 :   void * * alloc_mem = &alloc_region;
    6940           6 :   fd_loader_v4_program_instruction_decode_inner( mem, alloc_mem, ctx );
    6941           6 :   return self;
    6942           6 : }
    6943           6 : void fd_loader_v4_program_instruction_inner_new( fd_loader_v4_program_instruction_inner_t * self, uint discriminant ) {
    6944           6 :   switch( discriminant ) {
    6945           0 :   case 0: {
    6946           0 :     fd_loader_v4_program_instruction_write_new( &self->write );
    6947           0 :     break;
    6948           0 :   }
    6949           0 :   case 1: {
    6950           0 :     fd_loader_v4_program_instruction_copy_new( &self->copy );
    6951           0 :     break;
    6952           0 :   }
    6953           0 :   case 2: {
    6954           0 :     fd_loader_v4_program_instruction_set_program_length_new( &self->set_program_length );
    6955           0 :     break;
    6956           0 :   }
    6957           0 :   case 3: {
    6958           0 :     break;
    6959           0 :   }
    6960           0 :   case 4: {
    6961           0 :     break;
    6962           0 :   }
    6963           0 :   case 5: {
    6964           0 :     break;
    6965           0 :   }
    6966           0 :   case 6: {
    6967           0 :     break;
    6968           0 :   }
    6969           6 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    6970           6 :   }
    6971           6 : }
    6972           6 : void fd_loader_v4_program_instruction_new_disc( fd_loader_v4_program_instruction_t * self, uint discriminant ) {
    6973           6 :   self->discriminant = discriminant;
    6974           6 :   fd_loader_v4_program_instruction_inner_new( &self->inner, self->discriminant );
    6975           6 : }
    6976           6 : void fd_loader_v4_program_instruction_new( fd_loader_v4_program_instruction_t * self ) {
    6977           6 :   fd_memset( self, 0, sizeof(fd_loader_v4_program_instruction_t) );
    6978           6 :   fd_loader_v4_program_instruction_new_disc( self, UINT_MAX );
    6979           6 : }
    6980             : 
    6981           0 : ulong fd_loader_v4_program_instruction_size( fd_loader_v4_program_instruction_t const * self ) {
    6982           0 :   ulong size = 0;
    6983           0 :   size += sizeof(uint);
    6984           0 :   switch (self->discriminant) {
    6985           0 :   case 0: {
    6986           0 :     size += fd_loader_v4_program_instruction_write_size( &self->inner.write );
    6987           0 :     break;
    6988           0 :   }
    6989           0 :   case 1: {
    6990           0 :     size += fd_loader_v4_program_instruction_copy_size( &self->inner.copy );
    6991           0 :     break;
    6992           0 :   }
    6993           0 :   case 2: {
    6994           0 :     size += fd_loader_v4_program_instruction_set_program_length_size( &self->inner.set_program_length );
    6995           0 :     break;
    6996           0 :   }
    6997           0 :   }
    6998           0 :   return size;
    6999           0 : }
    7000             : 
    7001           0 : int fd_loader_v4_program_instruction_inner_encode( fd_loader_v4_program_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    7002           0 :   int err;
    7003           0 :   switch (discriminant) {
    7004           0 :   case 0: {
    7005           0 :     err = fd_loader_v4_program_instruction_write_encode( &self->write, ctx );
    7006           0 :     if( FD_UNLIKELY( err ) ) return err;
    7007           0 :     break;
    7008           0 :   }
    7009           0 :   case 1: {
    7010           0 :     err = fd_loader_v4_program_instruction_copy_encode( &self->copy, ctx );
    7011           0 :     if( FD_UNLIKELY( err ) ) return err;
    7012           0 :     break;
    7013           0 :   }
    7014           0 :   case 2: {
    7015           0 :     err = fd_loader_v4_program_instruction_set_program_length_encode( &self->set_program_length, ctx );
    7016           0 :     if( FD_UNLIKELY( err ) ) return err;
    7017           0 :     break;
    7018           0 :   }
    7019           0 :   }
    7020           0 :   return FD_BINCODE_SUCCESS;
    7021           0 : }
    7022           0 : int fd_loader_v4_program_instruction_encode( fd_loader_v4_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7023           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    7024           0 :   if( FD_UNLIKELY( err ) ) return err;
    7025           0 :   return fd_loader_v4_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    7026           0 : }
    7027             : 
    7028           0 : int fd_bpf_upgradeable_loader_program_instruction_write_encode( fd_bpf_upgradeable_loader_program_instruction_write_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7029           0 :   int err;
    7030           0 :   err = fd_bincode_uint32_encode( self->offset, ctx );
    7031           0 :   if( FD_UNLIKELY( err ) ) return err;
    7032           0 :   err = fd_bincode_uint64_encode( self->bytes_len, ctx );
    7033           0 :   if( FD_UNLIKELY(err) ) return err;
    7034           0 :   if( self->bytes_len ) {
    7035           0 :     err = fd_bincode_bytes_encode( self->bytes, self->bytes_len, ctx );
    7036           0 :     if( FD_UNLIKELY( err ) ) return err;
    7037           0 :   }
    7038           0 :   return FD_BINCODE_SUCCESS;
    7039           0 : }
    7040           0 : static int fd_bpf_upgradeable_loader_program_instruction_write_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7041           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7042           0 :   int err = 0;
    7043           0 :   err = fd_bincode_uint32_decode_footprint( ctx );
    7044           0 :   if( FD_UNLIKELY( err ) ) return err;
    7045           0 :   ulong bytes_len;
    7046           0 :   err = fd_bincode_uint64_decode( &bytes_len, ctx );
    7047           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7048           0 :   if( bytes_len ) {
    7049           0 :     *total_sz += 8UL + bytes_len;
    7050           0 :     err = fd_bincode_bytes_decode_footprint( bytes_len, ctx );
    7051           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7052           0 :   }
    7053           0 :   return 0;
    7054           0 : }
    7055           0 : int fd_bpf_upgradeable_loader_program_instruction_write_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7056           0 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_program_instruction_write_t);
    7057           0 :   void const * start_data = ctx->data;
    7058           0 :   int err = fd_bpf_upgradeable_loader_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    7059           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7060           0 :   ctx->data = start_data;
    7061           0 :   return err;
    7062           0 : }
    7063           0 : static void fd_bpf_upgradeable_loader_program_instruction_write_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7064           0 :   fd_bpf_upgradeable_loader_program_instruction_write_t * self = (fd_bpf_upgradeable_loader_program_instruction_write_t *)struct_mem;
    7065           0 :   fd_bincode_uint32_decode_unsafe( &self->offset, ctx );
    7066           0 :   fd_bincode_uint64_decode_unsafe( &self->bytes_len, ctx );
    7067           0 :   if( self->bytes_len ) {
    7068           0 :     self->bytes = *alloc_mem;
    7069           0 :     fd_bincode_bytes_decode_unsafe( self->bytes, self->bytes_len, ctx );
    7070           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->bytes_len;
    7071           0 :   } else
    7072           0 :     self->bytes = NULL;
    7073           0 : }
    7074           0 : void * fd_bpf_upgradeable_loader_program_instruction_write_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7075           0 :   fd_bpf_upgradeable_loader_program_instruction_write_t * self = (fd_bpf_upgradeable_loader_program_instruction_write_t *)mem;
    7076           0 :   fd_bpf_upgradeable_loader_program_instruction_write_new( self );
    7077           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_write_t);
    7078           0 :   void * * alloc_mem = &alloc_region;
    7079           0 :   fd_bpf_upgradeable_loader_program_instruction_write_decode_inner( mem, alloc_mem, ctx );
    7080           0 :   return self;
    7081           0 : }
    7082           0 : void fd_bpf_upgradeable_loader_program_instruction_write_new(fd_bpf_upgradeable_loader_program_instruction_write_t * self) {
    7083           0 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_program_instruction_write_t) );
    7084           0 : }
    7085           0 : ulong fd_bpf_upgradeable_loader_program_instruction_write_size( fd_bpf_upgradeable_loader_program_instruction_write_t const * self ) {
    7086           0 :   ulong size = 0;
    7087           0 :   size += sizeof(uint);
    7088           0 :   do {
    7089           0 :     size += sizeof(ulong);
    7090           0 :     size += self->bytes_len;
    7091           0 :   } while(0);
    7092           0 :   return size;
    7093           0 : }
    7094             : 
    7095           0 : int fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_encode( fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7096           0 :   int err;
    7097           0 :   err = fd_bincode_uint64_encode( self->max_data_len, ctx );
    7098           0 :   if( FD_UNLIKELY( err ) ) return err;
    7099           0 :   return FD_BINCODE_SUCCESS;
    7100           0 : }
    7101           0 : static inline int fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7102           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7103           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
    7104           0 :   return 0;
    7105           0 : }
    7106           0 : static void fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7107           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 *)struct_mem;
    7108           0 :   fd_bincode_uint64_decode_unsafe( &self->max_data_len, ctx );
    7109           0 : }
    7110           0 : void * fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7111           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;
    7112           0 :   fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_new( self );
    7113           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_t);
    7114           0 :   void * * alloc_mem = &alloc_region;
    7115           0 :   fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode_inner( mem, alloc_mem, ctx );
    7116           0 :   return self;
    7117           0 : }
    7118           0 : int fd_bpf_upgradeable_loader_program_instruction_extend_program_encode( fd_bpf_upgradeable_loader_program_instruction_extend_program_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7119           0 :   int err;
    7120           0 :   err = fd_bincode_uint32_encode( self->additional_bytes, ctx );
    7121           0 :   if( FD_UNLIKELY( err ) ) return err;
    7122           0 :   return FD_BINCODE_SUCCESS;
    7123           0 : }
    7124           0 : static inline int fd_bpf_upgradeable_loader_program_instruction_extend_program_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7125           0 :   if( (ulong)ctx->data + 4UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7126           0 :   ctx->data = (void *)( (ulong)ctx->data + 4UL );
    7127           0 :   return 0;
    7128           0 : }
    7129           0 : static void fd_bpf_upgradeable_loader_program_instruction_extend_program_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7130           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_t * self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_t *)struct_mem;
    7131           0 :   fd_bincode_uint32_decode_unsafe( &self->additional_bytes, ctx );
    7132           0 : }
    7133           0 : void * fd_bpf_upgradeable_loader_program_instruction_extend_program_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7134           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_t * self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_t *)mem;
    7135           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_new( self );
    7136           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_extend_program_t);
    7137           0 :   void * * alloc_mem = &alloc_region;
    7138           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_decode_inner( mem, alloc_mem, ctx );
    7139           0 :   return self;
    7140           0 : }
    7141           0 : int fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_encode( fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7142           0 :   int err;
    7143           0 :   err = fd_bincode_uint32_encode( self->additional_bytes, ctx );
    7144           0 :   if( FD_UNLIKELY( err ) ) return err;
    7145           0 :   return FD_BINCODE_SUCCESS;
    7146           0 : }
    7147           0 : static inline int fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7148           0 :   if( (ulong)ctx->data + 4UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7149           0 :   ctx->data = (void *)( (ulong)ctx->data + 4UL );
    7150           0 :   return 0;
    7151           0 : }
    7152           0 : static void fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7153           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t * self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t *)struct_mem;
    7154           0 :   fd_bincode_uint32_decode_unsafe( &self->additional_bytes, ctx );
    7155           0 : }
    7156           0 : void * fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7157           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t * self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t *)mem;
    7158           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_new( self );
    7159           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t);
    7160           0 :   void * * alloc_mem = &alloc_region;
    7161           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode_inner( mem, alloc_mem, ctx );
    7162           0 :   return self;
    7163           0 : }
    7164           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_initialize_buffer(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7165           0 :   return self->discriminant == 0;
    7166           0 : }
    7167           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_write(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7168           0 :   return self->discriminant == 1;
    7169           0 : }
    7170           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_deploy_with_max_data_len(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7171           0 :   return self->discriminant == 2;
    7172           0 : }
    7173           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_upgrade(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7174           0 :   return self->discriminant == 3;
    7175           0 : }
    7176           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_set_authority(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7177           0 :   return self->discriminant == 4;
    7178           0 : }
    7179           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_close(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7180           0 :   return self->discriminant == 5;
    7181           0 : }
    7182           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_extend_program(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7183           0 :   return self->discriminant == 6;
    7184           0 : }
    7185           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_set_authority_checked(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7186           0 :   return self->discriminant == 7;
    7187           0 : }
    7188           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_migrate(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7189           0 :   return self->discriminant == 8;
    7190           0 : }
    7191           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_extend_program_checked(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    7192           0 :   return self->discriminant == 9;
    7193           0 : }
    7194             : void fd_bpf_upgradeable_loader_program_instruction_inner_new( fd_bpf_upgradeable_loader_program_instruction_inner_t * self, uint discriminant );
    7195           0 : int fd_bpf_upgradeable_loader_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7196           0 :   int err;
    7197           0 :   switch (discriminant) {
    7198           0 :   case 0: {
    7199           0 :     return FD_BINCODE_SUCCESS;
    7200           0 :   }
    7201           0 :   case 1: {
    7202           0 :     err = fd_bpf_upgradeable_loader_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    7203           0 :     if( FD_UNLIKELY( err ) ) return err;
    7204           0 :     return FD_BINCODE_SUCCESS;
    7205           0 :   }
    7206           0 :   case 2: {
    7207           0 :     err = fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode_footprint_inner( ctx, total_sz );
    7208           0 :     if( FD_UNLIKELY( err ) ) return err;
    7209           0 :     return FD_BINCODE_SUCCESS;
    7210           0 :   }
    7211           0 :   case 3: {
    7212           0 :     return FD_BINCODE_SUCCESS;
    7213           0 :   }
    7214           0 :   case 4: {
    7215           0 :     return FD_BINCODE_SUCCESS;
    7216           0 :   }
    7217           0 :   case 5: {
    7218           0 :     return FD_BINCODE_SUCCESS;
    7219           0 :   }
    7220           0 :   case 6: {
    7221           0 :     err = fd_bpf_upgradeable_loader_program_instruction_extend_program_decode_footprint_inner( ctx, total_sz );
    7222           0 :     if( FD_UNLIKELY( err ) ) return err;
    7223           0 :     return FD_BINCODE_SUCCESS;
    7224           0 :   }
    7225           0 :   case 7: {
    7226           0 :     return FD_BINCODE_SUCCESS;
    7227           0 :   }
    7228           0 :   case 8: {
    7229           0 :     return FD_BINCODE_SUCCESS;
    7230           0 :   }
    7231           0 :   case 9: {
    7232           0 :     err = fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode_footprint_inner( ctx, total_sz );
    7233           0 :     if( FD_UNLIKELY( err ) ) return err;
    7234           0 :     return FD_BINCODE_SUCCESS;
    7235           0 :   }
    7236           0 :   default: return FD_BINCODE_ERR_ENCODING;
    7237           0 :   }
    7238           0 : }
    7239           0 : static int fd_bpf_upgradeable_loader_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7240           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7241           0 :   uint discriminant = 0;
    7242           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    7243           0 :   if( FD_UNLIKELY( err ) ) return err;
    7244           0 :   return fd_bpf_upgradeable_loader_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    7245           0 : }
    7246           0 : int fd_bpf_upgradeable_loader_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7247           0 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_program_instruction_t);
    7248           0 :   void const * start_data = ctx->data;
    7249           0 :   int err =  fd_bpf_upgradeable_loader_program_instruction_decode_footprint_inner( ctx, total_sz );
    7250           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7251           0 :   ctx->data = start_data;
    7252           0 :   return err;
    7253           0 : }
    7254           0 : static void fd_bpf_upgradeable_loader_program_instruction_inner_decode_inner( fd_bpf_upgradeable_loader_program_instruction_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    7255           0 :   switch (discriminant) {
    7256           0 :   case 0: {
    7257           0 :     break;
    7258           0 :   }
    7259           0 :   case 1: {
    7260           0 :     fd_bpf_upgradeable_loader_program_instruction_write_decode_inner( &self->write, alloc_mem, ctx );
    7261           0 :     break;
    7262           0 :   }
    7263           0 :   case 2: {
    7264           0 :     fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode_inner( &self->deploy_with_max_data_len, alloc_mem, ctx );
    7265           0 :     break;
    7266           0 :   }
    7267           0 :   case 3: {
    7268           0 :     break;
    7269           0 :   }
    7270           0 :   case 4: {
    7271           0 :     break;
    7272           0 :   }
    7273           0 :   case 5: {
    7274           0 :     break;
    7275           0 :   }
    7276           0 :   case 6: {
    7277           0 :     fd_bpf_upgradeable_loader_program_instruction_extend_program_decode_inner( &self->extend_program, alloc_mem, ctx );
    7278           0 :     break;
    7279           0 :   }
    7280           0 :   case 7: {
    7281           0 :     break;
    7282           0 :   }
    7283           0 :   case 8: {
    7284           0 :     break;
    7285           0 :   }
    7286           0 :   case 9: {
    7287           0 :     fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode_inner( &self->extend_program_checked, alloc_mem, ctx );
    7288           0 :     break;
    7289           0 :   }
    7290           0 :   }
    7291           0 : }
    7292           0 : static void fd_bpf_upgradeable_loader_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7293           0 :   fd_bpf_upgradeable_loader_program_instruction_t * self = (fd_bpf_upgradeable_loader_program_instruction_t *)struct_mem;
    7294           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    7295           0 :   fd_bpf_upgradeable_loader_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    7296           0 : }
    7297           0 : void * fd_bpf_upgradeable_loader_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7298           0 :   fd_bpf_upgradeable_loader_program_instruction_t * self = (fd_bpf_upgradeable_loader_program_instruction_t *)mem;
    7299           0 :   fd_bpf_upgradeable_loader_program_instruction_new( self );
    7300           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_t);
    7301           0 :   void * * alloc_mem = &alloc_region;
    7302           0 :   fd_bpf_upgradeable_loader_program_instruction_decode_inner( mem, alloc_mem, ctx );
    7303           0 :   return self;
    7304           0 : }
    7305           0 : void fd_bpf_upgradeable_loader_program_instruction_inner_new( fd_bpf_upgradeable_loader_program_instruction_inner_t * self, uint discriminant ) {
    7306           0 :   switch( discriminant ) {
    7307           0 :   case 0: {
    7308           0 :     break;
    7309           0 :   }
    7310           0 :   case 1: {
    7311           0 :     fd_bpf_upgradeable_loader_program_instruction_write_new( &self->write );
    7312           0 :     break;
    7313           0 :   }
    7314           0 :   case 2: {
    7315           0 :     fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_new( &self->deploy_with_max_data_len );
    7316           0 :     break;
    7317           0 :   }
    7318           0 :   case 3: {
    7319           0 :     break;
    7320           0 :   }
    7321           0 :   case 4: {
    7322           0 :     break;
    7323           0 :   }
    7324           0 :   case 5: {
    7325           0 :     break;
    7326           0 :   }
    7327           0 :   case 6: {
    7328           0 :     fd_bpf_upgradeable_loader_program_instruction_extend_program_new( &self->extend_program );
    7329           0 :     break;
    7330           0 :   }
    7331           0 :   case 7: {
    7332           0 :     break;
    7333           0 :   }
    7334           0 :   case 8: {
    7335           0 :     break;
    7336           0 :   }
    7337           0 :   case 9: {
    7338           0 :     fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_new( &self->extend_program_checked );
    7339           0 :     break;
    7340           0 :   }
    7341           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    7342           0 :   }
    7343           0 : }
    7344           0 : void fd_bpf_upgradeable_loader_program_instruction_new_disc( fd_bpf_upgradeable_loader_program_instruction_t * self, uint discriminant ) {
    7345           0 :   self->discriminant = discriminant;
    7346           0 :   fd_bpf_upgradeable_loader_program_instruction_inner_new( &self->inner, self->discriminant );
    7347           0 : }
    7348           0 : void fd_bpf_upgradeable_loader_program_instruction_new( fd_bpf_upgradeable_loader_program_instruction_t * self ) {
    7349           0 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_program_instruction_t) );
    7350           0 :   fd_bpf_upgradeable_loader_program_instruction_new_disc( self, UINT_MAX );
    7351           0 : }
    7352             : 
    7353           0 : ulong fd_bpf_upgradeable_loader_program_instruction_size( fd_bpf_upgradeable_loader_program_instruction_t const * self ) {
    7354           0 :   ulong size = 0;
    7355           0 :   size += sizeof(uint);
    7356           0 :   switch (self->discriminant) {
    7357           0 :   case 1: {
    7358           0 :     size += fd_bpf_upgradeable_loader_program_instruction_write_size( &self->inner.write );
    7359           0 :     break;
    7360           0 :   }
    7361           0 :   case 2: {
    7362           0 :     size += fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_size( &self->inner.deploy_with_max_data_len );
    7363           0 :     break;
    7364           0 :   }
    7365           0 :   case 6: {
    7366           0 :     size += fd_bpf_upgradeable_loader_program_instruction_extend_program_size( &self->inner.extend_program );
    7367           0 :     break;
    7368           0 :   }
    7369           0 :   case 9: {
    7370           0 :     size += fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_size( &self->inner.extend_program_checked );
    7371           0 :     break;
    7372           0 :   }
    7373           0 :   }
    7374           0 :   return size;
    7375           0 : }
    7376             : 
    7377           0 : int fd_bpf_upgradeable_loader_program_instruction_inner_encode( fd_bpf_upgradeable_loader_program_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    7378           0 :   int err;
    7379           0 :   switch (discriminant) {
    7380           0 :   case 1: {
    7381           0 :     err = fd_bpf_upgradeable_loader_program_instruction_write_encode( &self->write, ctx );
    7382           0 :     if( FD_UNLIKELY( err ) ) return err;
    7383           0 :     break;
    7384           0 :   }
    7385           0 :   case 2: {
    7386           0 :     err = fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_encode( &self->deploy_with_max_data_len, ctx );
    7387           0 :     if( FD_UNLIKELY( err ) ) return err;
    7388           0 :     break;
    7389           0 :   }
    7390           0 :   case 6: {
    7391           0 :     err = fd_bpf_upgradeable_loader_program_instruction_extend_program_encode( &self->extend_program, ctx );
    7392           0 :     if( FD_UNLIKELY( err ) ) return err;
    7393           0 :     break;
    7394           0 :   }
    7395           0 :   case 9: {
    7396           0 :     err = fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_encode( &self->extend_program_checked, ctx );
    7397           0 :     if( FD_UNLIKELY( err ) ) return err;
    7398           0 :     break;
    7399           0 :   }
    7400           0 :   }
    7401           0 :   return FD_BINCODE_SUCCESS;
    7402           0 : }
    7403           0 : int fd_bpf_upgradeable_loader_program_instruction_encode( fd_bpf_upgradeable_loader_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7404           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    7405           0 :   if( FD_UNLIKELY( err ) ) return err;
    7406           0 :   return fd_bpf_upgradeable_loader_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    7407           0 : }
    7408             : 
    7409           3 : int fd_bpf_upgradeable_loader_state_buffer_encode( fd_bpf_upgradeable_loader_state_buffer_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7410           3 :   int err;
    7411           3 :   err = fd_bincode_bool_encode( self->has_authority_address, ctx );
    7412           3 :   if( FD_UNLIKELY( err ) ) return err;
    7413           3 :   if( self->has_authority_address ) {
    7414           0 :     err = fd_pubkey_encode( &self->authority_address, ctx );
    7415           0 :     if( FD_UNLIKELY( err ) ) return err;
    7416           0 :   }
    7417           3 :   return FD_BINCODE_SUCCESS;
    7418           3 : }
    7419           3 : static int fd_bpf_upgradeable_loader_state_buffer_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7420           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7421           3 :   int err = 0;
    7422           3 :   {
    7423           3 :     uchar o;
    7424           3 :     err = fd_bincode_bool_decode( &o, ctx );
    7425           3 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7426           3 :     if( o ) {
    7427           0 :       err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    7428           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7429           0 :     }
    7430           3 :   }
    7431           3 :   return 0;
    7432           3 : }
    7433           0 : int fd_bpf_upgradeable_loader_state_buffer_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7434           0 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_state_buffer_t);
    7435           0 :   void const * start_data = ctx->data;
    7436           0 :   int err = fd_bpf_upgradeable_loader_state_buffer_decode_footprint_inner( ctx, total_sz );
    7437           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7438           0 :   ctx->data = start_data;
    7439           0 :   return err;
    7440           0 : }
    7441           3 : static void fd_bpf_upgradeable_loader_state_buffer_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7442           3 :   fd_bpf_upgradeable_loader_state_buffer_t * self = (fd_bpf_upgradeable_loader_state_buffer_t *)struct_mem;
    7443           3 :   {
    7444           3 :     uchar o;
    7445           3 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    7446           3 :     self->has_authority_address = !!o;
    7447           3 :     if( o ) {
    7448           0 :       fd_pubkey_new( &self->authority_address );
    7449           0 :       fd_pubkey_decode_inner( &self->authority_address, alloc_mem, ctx );
    7450           0 :     }
    7451           3 :   }
    7452           3 : }
    7453           0 : void * fd_bpf_upgradeable_loader_state_buffer_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7454           0 :   fd_bpf_upgradeable_loader_state_buffer_t * self = (fd_bpf_upgradeable_loader_state_buffer_t *)mem;
    7455           0 :   fd_bpf_upgradeable_loader_state_buffer_new( self );
    7456           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_state_buffer_t);
    7457           0 :   void * * alloc_mem = &alloc_region;
    7458           0 :   fd_bpf_upgradeable_loader_state_buffer_decode_inner( mem, alloc_mem, ctx );
    7459           0 :   return self;
    7460           0 : }
    7461           0 : void fd_bpf_upgradeable_loader_state_buffer_new(fd_bpf_upgradeable_loader_state_buffer_t * self) {
    7462           0 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_state_buffer_t) );
    7463           0 : }
    7464           0 : ulong fd_bpf_upgradeable_loader_state_buffer_size( fd_bpf_upgradeable_loader_state_buffer_t const * self ) {
    7465           0 :   ulong size = 0;
    7466           0 :   size += sizeof(char);
    7467           0 :   if( self->has_authority_address ) {
    7468           0 :     size += fd_pubkey_size( &self->authority_address );
    7469           0 :   }
    7470           0 :   return size;
    7471           0 : }
    7472             : 
    7473           3 : int fd_bpf_upgradeable_loader_state_program_encode( fd_bpf_upgradeable_loader_state_program_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7474           3 :   int err;
    7475           3 :   err = fd_pubkey_encode( &self->programdata_address, ctx );
    7476           3 :   if( FD_UNLIKELY( err ) ) return err;
    7477           3 :   return FD_BINCODE_SUCCESS;
    7478           3 : }
    7479          12 : static inline int fd_bpf_upgradeable_loader_state_program_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7480          12 :   if( (ulong)ctx->data + 32UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7481          12 :   ctx->data = (void *)( (ulong)ctx->data + 32UL );
    7482          12 :   return 0;
    7483          12 : }
    7484          12 : static void fd_bpf_upgradeable_loader_state_program_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7485          12 :   fd_bpf_upgradeable_loader_state_program_t * self = (fd_bpf_upgradeable_loader_state_program_t *)struct_mem;
    7486          12 :   fd_pubkey_decode_inner( &self->programdata_address, alloc_mem, ctx );
    7487          12 : }
    7488           0 : void * fd_bpf_upgradeable_loader_state_program_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7489           0 :   fd_bpf_upgradeable_loader_state_program_t * self = (fd_bpf_upgradeable_loader_state_program_t *)mem;
    7490           0 :   fd_bpf_upgradeable_loader_state_program_new( self );
    7491           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_state_program_t);
    7492           0 :   void * * alloc_mem = &alloc_region;
    7493           0 :   fd_bpf_upgradeable_loader_state_program_decode_inner( mem, alloc_mem, ctx );
    7494           0 :   return self;
    7495           0 : }
    7496          12 : int fd_bpf_upgradeable_loader_state_program_data_encode( fd_bpf_upgradeable_loader_state_program_data_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7497          12 :   int err;
    7498          12 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    7499          12 :   if( FD_UNLIKELY( err ) ) return err;
    7500          12 :   err = fd_bincode_bool_encode( self->has_upgrade_authority_address, ctx );
    7501          12 :   if( FD_UNLIKELY( err ) ) return err;
    7502          12 :   if( self->has_upgrade_authority_address ) {
    7503           6 :     err = fd_pubkey_encode( &self->upgrade_authority_address, ctx );
    7504           6 :     if( FD_UNLIKELY( err ) ) return err;
    7505           6 :   }
    7506          12 :   return FD_BINCODE_SUCCESS;
    7507          12 : }
    7508          18 : static int fd_bpf_upgradeable_loader_state_program_data_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7509          18 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7510          18 :   int err = 0;
    7511          18 :   err = fd_bincode_uint64_decode_footprint( ctx );
    7512          18 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7513          18 :   {
    7514          18 :     uchar o;
    7515          18 :     err = fd_bincode_bool_decode( &o, ctx );
    7516          18 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7517          18 :     if( o ) {
    7518           9 :       err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    7519           9 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7520           9 :     }
    7521          18 :   }
    7522          18 :   return 0;
    7523          18 : }
    7524           0 : int fd_bpf_upgradeable_loader_state_program_data_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7525           0 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_state_program_data_t);
    7526           0 :   void const * start_data = ctx->data;
    7527           0 :   int err = fd_bpf_upgradeable_loader_state_program_data_decode_footprint_inner( ctx, total_sz );
    7528           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7529           0 :   ctx->data = start_data;
    7530           0 :   return err;
    7531           0 : }
    7532          18 : static void fd_bpf_upgradeable_loader_state_program_data_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7533          18 :   fd_bpf_upgradeable_loader_state_program_data_t * self = (fd_bpf_upgradeable_loader_state_program_data_t *)struct_mem;
    7534          18 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    7535          18 :   {
    7536          18 :     uchar o;
    7537          18 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    7538          18 :     self->has_upgrade_authority_address = !!o;
    7539          18 :     if( o ) {
    7540           9 :       fd_pubkey_new( &self->upgrade_authority_address );
    7541           9 :       fd_pubkey_decode_inner( &self->upgrade_authority_address, alloc_mem, ctx );
    7542           9 :     }
    7543          18 :   }
    7544          18 : }
    7545           0 : void * fd_bpf_upgradeable_loader_state_program_data_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7546           0 :   fd_bpf_upgradeable_loader_state_program_data_t * self = (fd_bpf_upgradeable_loader_state_program_data_t *)mem;
    7547           0 :   fd_bpf_upgradeable_loader_state_program_data_new( self );
    7548           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_state_program_data_t);
    7549           0 :   void * * alloc_mem = &alloc_region;
    7550           0 :   fd_bpf_upgradeable_loader_state_program_data_decode_inner( mem, alloc_mem, ctx );
    7551           0 :   return self;
    7552           0 : }
    7553           0 : void fd_bpf_upgradeable_loader_state_program_data_new(fd_bpf_upgradeable_loader_state_program_data_t * self) {
    7554           0 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_state_program_data_t) );
    7555           0 : }
    7556           0 : ulong fd_bpf_upgradeable_loader_state_program_data_size( fd_bpf_upgradeable_loader_state_program_data_t const * self ) {
    7557           0 :   ulong size = 0;
    7558           0 :   size += sizeof(ulong);
    7559           0 :   size += sizeof(char);
    7560           0 :   if( self->has_upgrade_authority_address ) {
    7561           0 :     size += fd_pubkey_size( &self->upgrade_authority_address );
    7562           0 :   }
    7563           0 :   return size;
    7564           0 : }
    7565             : 
    7566           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_state_is_uninitialized(fd_bpf_upgradeable_loader_state_t const * self) {
    7567           0 :   return self->discriminant == 0;
    7568           0 : }
    7569           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_state_is_buffer(fd_bpf_upgradeable_loader_state_t const * self) {
    7570           0 :   return self->discriminant == 1;
    7571           0 : }
    7572          18 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_state_is_program(fd_bpf_upgradeable_loader_state_t const * self) {
    7573          18 :   return self->discriminant == 2;
    7574          18 : }
    7575           3 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_state_is_program_data(fd_bpf_upgradeable_loader_state_t const * self) {
    7576           3 :   return self->discriminant == 3;
    7577           3 : }
    7578             : void fd_bpf_upgradeable_loader_state_inner_new( fd_bpf_upgradeable_loader_state_inner_t * self, uint discriminant );
    7579          39 : int fd_bpf_upgradeable_loader_state_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7580          39 :   int err;
    7581          39 :   switch (discriminant) {
    7582           3 :   case 0: {
    7583           3 :     return FD_BINCODE_SUCCESS;
    7584           0 :   }
    7585           3 :   case 1: {
    7586           3 :     err = fd_bpf_upgradeable_loader_state_buffer_decode_footprint_inner( ctx, total_sz );
    7587           3 :     if( FD_UNLIKELY( err ) ) return err;
    7588           3 :     return FD_BINCODE_SUCCESS;
    7589           3 :   }
    7590          12 :   case 2: {
    7591          12 :     err = fd_bpf_upgradeable_loader_state_program_decode_footprint_inner( ctx, total_sz );
    7592          12 :     if( FD_UNLIKELY( err ) ) return err;
    7593          12 :     return FD_BINCODE_SUCCESS;
    7594          12 :   }
    7595          18 :   case 3: {
    7596          18 :     err = fd_bpf_upgradeable_loader_state_program_data_decode_footprint_inner( ctx, total_sz );
    7597          18 :     if( FD_UNLIKELY( err ) ) return err;
    7598          18 :     return FD_BINCODE_SUCCESS;
    7599          18 :   }
    7600           3 :   default: return FD_BINCODE_ERR_ENCODING;
    7601          39 :   }
    7602          39 : }
    7603          39 : static int fd_bpf_upgradeable_loader_state_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7604          39 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7605          39 :   uint discriminant = 0;
    7606          39 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    7607          39 :   if( FD_UNLIKELY( err ) ) return err;
    7608          39 :   return fd_bpf_upgradeable_loader_state_inner_decode_footprint( discriminant, ctx, total_sz );
    7609          39 : }
    7610          39 : int fd_bpf_upgradeable_loader_state_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7611          39 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_state_t);
    7612          39 :   void const * start_data = ctx->data;
    7613          39 :   int err =  fd_bpf_upgradeable_loader_state_decode_footprint_inner( ctx, total_sz );
    7614          39 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7615          39 :   ctx->data = start_data;
    7616          39 :   return err;
    7617          39 : }
    7618          33 : static void fd_bpf_upgradeable_loader_state_inner_decode_inner( fd_bpf_upgradeable_loader_state_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    7619          33 :   switch (discriminant) {
    7620           0 :   case 0: {
    7621           0 :     break;
    7622           0 :   }
    7623           3 :   case 1: {
    7624           3 :     fd_bpf_upgradeable_loader_state_buffer_decode_inner( &self->buffer, alloc_mem, ctx );
    7625           3 :     break;
    7626           0 :   }
    7627          12 :   case 2: {
    7628          12 :     fd_bpf_upgradeable_loader_state_program_decode_inner( &self->program, alloc_mem, ctx );
    7629          12 :     break;
    7630           0 :   }
    7631          18 :   case 3: {
    7632          18 :     fd_bpf_upgradeable_loader_state_program_data_decode_inner( &self->program_data, alloc_mem, ctx );
    7633          18 :     break;
    7634           0 :   }
    7635          33 :   }
    7636          33 : }
    7637          33 : static void fd_bpf_upgradeable_loader_state_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7638          33 :   fd_bpf_upgradeable_loader_state_t * self = (fd_bpf_upgradeable_loader_state_t *)struct_mem;
    7639          33 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    7640          33 :   fd_bpf_upgradeable_loader_state_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    7641          33 : }
    7642          33 : void * fd_bpf_upgradeable_loader_state_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7643          33 :   fd_bpf_upgradeable_loader_state_t * self = (fd_bpf_upgradeable_loader_state_t *)mem;
    7644          33 :   fd_bpf_upgradeable_loader_state_new( self );
    7645          33 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_state_t);
    7646          33 :   void * * alloc_mem = &alloc_region;
    7647          33 :   fd_bpf_upgradeable_loader_state_decode_inner( mem, alloc_mem, ctx );
    7648          33 :   return self;
    7649          33 : }
    7650          33 : void fd_bpf_upgradeable_loader_state_inner_new( fd_bpf_upgradeable_loader_state_inner_t * self, uint discriminant ) {
    7651          33 :   switch( discriminant ) {
    7652           0 :   case 0: {
    7653           0 :     break;
    7654           0 :   }
    7655           0 :   case 1: {
    7656           0 :     fd_bpf_upgradeable_loader_state_buffer_new( &self->buffer );
    7657           0 :     break;
    7658           0 :   }
    7659           0 :   case 2: {
    7660           0 :     fd_bpf_upgradeable_loader_state_program_new( &self->program );
    7661           0 :     break;
    7662           0 :   }
    7663           0 :   case 3: {
    7664           0 :     fd_bpf_upgradeable_loader_state_program_data_new( &self->program_data );
    7665           0 :     break;
    7666           0 :   }
    7667          33 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    7668          33 :   }
    7669          33 : }
    7670          33 : void fd_bpf_upgradeable_loader_state_new_disc( fd_bpf_upgradeable_loader_state_t * self, uint discriminant ) {
    7671          33 :   self->discriminant = discriminant;
    7672          33 :   fd_bpf_upgradeable_loader_state_inner_new( &self->inner, self->discriminant );
    7673          33 : }
    7674          33 : void fd_bpf_upgradeable_loader_state_new( fd_bpf_upgradeable_loader_state_t * self ) {
    7675          33 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_state_t) );
    7676          33 :   fd_bpf_upgradeable_loader_state_new_disc( self, UINT_MAX );
    7677          33 : }
    7678             : 
    7679           0 : ulong fd_bpf_upgradeable_loader_state_size( fd_bpf_upgradeable_loader_state_t const * self ) {
    7680           0 :   ulong size = 0;
    7681           0 :   size += sizeof(uint);
    7682           0 :   switch (self->discriminant) {
    7683           0 :   case 1: {
    7684           0 :     size += fd_bpf_upgradeable_loader_state_buffer_size( &self->inner.buffer );
    7685           0 :     break;
    7686           0 :   }
    7687           0 :   case 2: {
    7688           0 :     size += fd_bpf_upgradeable_loader_state_program_size( &self->inner.program );
    7689           0 :     break;
    7690           0 :   }
    7691           0 :   case 3: {
    7692           0 :     size += fd_bpf_upgradeable_loader_state_program_data_size( &self->inner.program_data );
    7693           0 :     break;
    7694           0 :   }
    7695           0 :   }
    7696           0 :   return size;
    7697           0 : }
    7698             : 
    7699          18 : int fd_bpf_upgradeable_loader_state_inner_encode( fd_bpf_upgradeable_loader_state_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    7700          18 :   int err;
    7701          18 :   switch (discriminant) {
    7702           3 :   case 1: {
    7703           3 :     err = fd_bpf_upgradeable_loader_state_buffer_encode( &self->buffer, ctx );
    7704           3 :     if( FD_UNLIKELY( err ) ) return err;
    7705           3 :     break;
    7706           3 :   }
    7707           3 :   case 2: {
    7708           3 :     err = fd_bpf_upgradeable_loader_state_program_encode( &self->program, ctx );
    7709           3 :     if( FD_UNLIKELY( err ) ) return err;
    7710           3 :     break;
    7711           3 :   }
    7712          12 :   case 3: {
    7713          12 :     err = fd_bpf_upgradeable_loader_state_program_data_encode( &self->program_data, ctx );
    7714          12 :     if( FD_UNLIKELY( err ) ) return err;
    7715          12 :     break;
    7716          12 :   }
    7717          18 :   }
    7718          18 :   return FD_BINCODE_SUCCESS;
    7719          18 : }
    7720          18 : int fd_bpf_upgradeable_loader_state_encode( fd_bpf_upgradeable_loader_state_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7721          18 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    7722          18 :   if( FD_UNLIKELY( err ) ) return err;
    7723          18 :   return fd_bpf_upgradeable_loader_state_inner_encode( &self->inner, self->discriminant, ctx );
    7724          18 : }
    7725             : 
    7726           0 : int fd_loader_v4_state_encode( fd_loader_v4_state_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7727           0 :   int err;
    7728           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    7729           0 :   if( FD_UNLIKELY( err ) ) return err;
    7730           0 :   err = fd_pubkey_encode( &self->authority_address_or_next_version, ctx );
    7731           0 :   if( FD_UNLIKELY( err ) ) return err;
    7732           0 :   err = fd_bincode_uint64_encode( self->status, ctx );
    7733           0 :   if( FD_UNLIKELY( err ) ) return err;
    7734           0 :   return FD_BINCODE_SUCCESS;
    7735           0 : }
    7736           0 : static inline int fd_loader_v4_state_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7737           0 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7738           0 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
    7739           0 :   return 0;
    7740           0 : }
    7741           0 : static void fd_loader_v4_state_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7742           0 :   fd_loader_v4_state_t * self = (fd_loader_v4_state_t *)struct_mem;
    7743           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    7744           0 :   fd_pubkey_decode_inner( &self->authority_address_or_next_version, alloc_mem, ctx );
    7745           0 :   fd_bincode_uint64_decode_unsafe( &self->status, ctx );
    7746           0 : }
    7747           0 : void * fd_loader_v4_state_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7748           0 :   fd_loader_v4_state_t * self = (fd_loader_v4_state_t *)mem;
    7749           0 :   fd_loader_v4_state_new( self );
    7750           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_state_t);
    7751           0 :   void * * alloc_mem = &alloc_region;
    7752           0 :   fd_loader_v4_state_decode_inner( mem, alloc_mem, ctx );
    7753           0 :   return self;
    7754           0 : }
    7755           0 : int fd_frozen_hash_status_encode( fd_frozen_hash_status_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7756           0 :   int err;
    7757           0 :   err = fd_hash_encode( &self->frozen_hash, ctx );
    7758           0 :   if( FD_UNLIKELY( err ) ) return err;
    7759           0 :   err = fd_bincode_bool_encode( (uchar)(self->is_duplicate_confirmed), ctx );
    7760           0 :   if( FD_UNLIKELY( err ) ) return err;
    7761           0 :   return FD_BINCODE_SUCCESS;
    7762           0 : }
    7763           0 : static int fd_frozen_hash_status_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7764           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7765           0 :   int err = 0;
    7766           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    7767           0 :   if( FD_UNLIKELY( err ) ) return err;
    7768           0 :   err = fd_bincode_bool_decode_footprint( ctx );
    7769           0 :   if( FD_UNLIKELY( err ) ) return err;
    7770           0 :   return 0;
    7771           0 : }
    7772           0 : int fd_frozen_hash_status_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7773           0 :   *total_sz += sizeof(fd_frozen_hash_status_t);
    7774           0 :   void const * start_data = ctx->data;
    7775           0 :   int err = fd_frozen_hash_status_decode_footprint_inner( ctx, total_sz );
    7776           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7777           0 :   ctx->data = start_data;
    7778           0 :   return err;
    7779           0 : }
    7780           0 : static void fd_frozen_hash_status_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7781           0 :   fd_frozen_hash_status_t * self = (fd_frozen_hash_status_t *)struct_mem;
    7782           0 :   fd_hash_decode_inner( &self->frozen_hash, alloc_mem, ctx );
    7783           0 :   fd_bincode_bool_decode_unsafe( &self->is_duplicate_confirmed, ctx );
    7784           0 : }
    7785           0 : void * fd_frozen_hash_status_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7786           0 :   fd_frozen_hash_status_t * self = (fd_frozen_hash_status_t *)mem;
    7787           0 :   fd_frozen_hash_status_new( self );
    7788           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_frozen_hash_status_t);
    7789           0 :   void * * alloc_mem = &alloc_region;
    7790           0 :   fd_frozen_hash_status_decode_inner( mem, alloc_mem, ctx );
    7791           0 :   return self;
    7792           0 : }
    7793           0 : void fd_frozen_hash_status_new(fd_frozen_hash_status_t * self) {
    7794           0 :   fd_memset( self, 0, sizeof(fd_frozen_hash_status_t) );
    7795           0 :   fd_hash_new( &self->frozen_hash );
    7796           0 : }
    7797           0 : FD_FN_PURE uchar fd_frozen_hash_versioned_is_current(fd_frozen_hash_versioned_t const * self) {
    7798           0 :   return self->discriminant == 0;
    7799           0 : }
    7800             : void fd_frozen_hash_versioned_inner_new( fd_frozen_hash_versioned_inner_t * self, uint discriminant );
    7801           0 : int fd_frozen_hash_versioned_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7802           0 :   int err;
    7803           0 :   switch (discriminant) {
    7804           0 :   case 0: {
    7805           0 :     err = fd_frozen_hash_status_decode_footprint_inner( ctx, total_sz );
    7806           0 :     if( FD_UNLIKELY( err ) ) return err;
    7807           0 :     return FD_BINCODE_SUCCESS;
    7808           0 :   }
    7809           0 :   default: return FD_BINCODE_ERR_ENCODING;
    7810           0 :   }
    7811           0 : }
    7812           0 : static int fd_frozen_hash_versioned_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7813           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7814           0 :   uint discriminant = 0;
    7815           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    7816           0 :   if( FD_UNLIKELY( err ) ) return err;
    7817           0 :   return fd_frozen_hash_versioned_inner_decode_footprint( discriminant, ctx, total_sz );
    7818           0 : }
    7819           0 : int fd_frozen_hash_versioned_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7820           0 :   *total_sz += sizeof(fd_frozen_hash_versioned_t);
    7821           0 :   void const * start_data = ctx->data;
    7822           0 :   int err =  fd_frozen_hash_versioned_decode_footprint_inner( ctx, total_sz );
    7823           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7824           0 :   ctx->data = start_data;
    7825           0 :   return err;
    7826           0 : }
    7827           0 : static void fd_frozen_hash_versioned_inner_decode_inner( fd_frozen_hash_versioned_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    7828           0 :   switch (discriminant) {
    7829           0 :   case 0: {
    7830           0 :     fd_frozen_hash_status_decode_inner( &self->current, alloc_mem, ctx );
    7831           0 :     break;
    7832           0 :   }
    7833           0 :   }
    7834           0 : }
    7835           0 : static void fd_frozen_hash_versioned_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7836           0 :   fd_frozen_hash_versioned_t * self = (fd_frozen_hash_versioned_t *)struct_mem;
    7837           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    7838           0 :   fd_frozen_hash_versioned_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    7839           0 : }
    7840           0 : void * fd_frozen_hash_versioned_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7841           0 :   fd_frozen_hash_versioned_t * self = (fd_frozen_hash_versioned_t *)mem;
    7842           0 :   fd_frozen_hash_versioned_new( self );
    7843           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_frozen_hash_versioned_t);
    7844           0 :   void * * alloc_mem = &alloc_region;
    7845           0 :   fd_frozen_hash_versioned_decode_inner( mem, alloc_mem, ctx );
    7846           0 :   return self;
    7847           0 : }
    7848           0 : void fd_frozen_hash_versioned_inner_new( fd_frozen_hash_versioned_inner_t * self, uint discriminant ) {
    7849           0 :   switch( discriminant ) {
    7850           0 :   case 0: {
    7851           0 :     fd_frozen_hash_status_new( &self->current );
    7852           0 :     break;
    7853           0 :   }
    7854           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    7855           0 :   }
    7856           0 : }
    7857           0 : void fd_frozen_hash_versioned_new_disc( fd_frozen_hash_versioned_t * self, uint discriminant ) {
    7858           0 :   self->discriminant = discriminant;
    7859           0 :   fd_frozen_hash_versioned_inner_new( &self->inner, self->discriminant );
    7860           0 : }
    7861           0 : void fd_frozen_hash_versioned_new( fd_frozen_hash_versioned_t * self ) {
    7862           0 :   fd_memset( self, 0, sizeof(fd_frozen_hash_versioned_t) );
    7863           0 :   fd_frozen_hash_versioned_new_disc( self, UINT_MAX );
    7864           0 : }
    7865             : 
    7866           0 : ulong fd_frozen_hash_versioned_size( fd_frozen_hash_versioned_t const * self ) {
    7867           0 :   ulong size = 0;
    7868           0 :   size += sizeof(uint);
    7869           0 :   switch (self->discriminant) {
    7870           0 :   case 0: {
    7871           0 :     size += fd_frozen_hash_status_size( &self->inner.current );
    7872           0 :     break;
    7873           0 :   }
    7874           0 :   }
    7875           0 :   return size;
    7876           0 : }
    7877             : 
    7878           0 : int fd_frozen_hash_versioned_inner_encode( fd_frozen_hash_versioned_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    7879           0 :   int err;
    7880           0 :   switch (discriminant) {
    7881           0 :   case 0: {
    7882           0 :     err = fd_frozen_hash_status_encode( &self->current, ctx );
    7883           0 :     if( FD_UNLIKELY( err ) ) return err;
    7884           0 :     break;
    7885           0 :   }
    7886           0 :   }
    7887           0 :   return FD_BINCODE_SUCCESS;
    7888           0 : }
    7889           0 : int fd_frozen_hash_versioned_encode( fd_frozen_hash_versioned_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7890           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    7891           0 :   if( FD_UNLIKELY( err ) ) return err;
    7892           0 :   return fd_frozen_hash_versioned_inner_encode( &self->inner, self->discriminant, ctx );
    7893           0 : }
    7894             : 
    7895           6 : int fd_lookup_table_meta_encode( fd_lookup_table_meta_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7896           6 :   int err;
    7897           6 :   err = fd_bincode_uint64_encode( self->deactivation_slot, ctx );
    7898           6 :   if( FD_UNLIKELY( err ) ) return err;
    7899           6 :   err = fd_bincode_uint64_encode( self->last_extended_slot, ctx );
    7900           6 :   if( FD_UNLIKELY( err ) ) return err;
    7901           6 :   err = fd_bincode_uint8_encode( (uchar)(self->last_extended_slot_start_index), ctx );
    7902           6 :   if( FD_UNLIKELY( err ) ) return err;
    7903           6 :   err = fd_bincode_bool_encode( self->has_authority, ctx );
    7904           6 :   if( FD_UNLIKELY( err ) ) return err;
    7905           6 :   if( self->has_authority ) {
    7906           0 :     err = fd_pubkey_encode( &self->authority, ctx );
    7907           0 :     if( FD_UNLIKELY( err ) ) return err;
    7908           0 :   }
    7909           6 :   err = fd_bincode_uint16_encode( self->_padding, ctx );
    7910           6 :   if( FD_UNLIKELY( err ) ) return err;
    7911           6 :   return FD_BINCODE_SUCCESS;
    7912           6 : }
    7913           3 : static int fd_lookup_table_meta_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7914           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7915           3 :   int err = 0;
    7916           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
    7917           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7918           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
    7919           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7920           3 :   err = fd_bincode_uint8_decode_footprint( ctx );
    7921           3 :   if( FD_UNLIKELY( err ) ) return err;
    7922           3 :   {
    7923           3 :     uchar o;
    7924           3 :     err = fd_bincode_bool_decode( &o, ctx );
    7925           3 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7926           3 :     if( o ) {
    7927           0 :       err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    7928           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7929           0 :     }
    7930           3 :   }
    7931           3 :   err = fd_bincode_uint16_decode_footprint( ctx );
    7932           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7933           3 :   return 0;
    7934           3 : }
    7935           0 : int fd_lookup_table_meta_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7936           0 :   *total_sz += sizeof(fd_lookup_table_meta_t);
    7937           0 :   void const * start_data = ctx->data;
    7938           0 :   int err = fd_lookup_table_meta_decode_footprint_inner( ctx, total_sz );
    7939           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7940           0 :   ctx->data = start_data;
    7941           0 :   return err;
    7942           0 : }
    7943           3 : static void fd_lookup_table_meta_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7944           3 :   fd_lookup_table_meta_t * self = (fd_lookup_table_meta_t *)struct_mem;
    7945           3 :   fd_bincode_uint64_decode_unsafe( &self->deactivation_slot, ctx );
    7946           3 :   fd_bincode_uint64_decode_unsafe( &self->last_extended_slot, ctx );
    7947           3 :   fd_bincode_uint8_decode_unsafe( &self->last_extended_slot_start_index, ctx );
    7948           3 :   {
    7949           3 :     uchar o;
    7950           3 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    7951           3 :     self->has_authority = !!o;
    7952           3 :     if( o ) {
    7953           0 :       fd_pubkey_new( &self->authority );
    7954           0 :       fd_pubkey_decode_inner( &self->authority, alloc_mem, ctx );
    7955           0 :     }
    7956           3 :   }
    7957           3 :   fd_bincode_uint16_decode_unsafe( &self->_padding, ctx );
    7958           3 : }
    7959           0 : void * fd_lookup_table_meta_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7960           0 :   fd_lookup_table_meta_t * self = (fd_lookup_table_meta_t *)mem;
    7961           0 :   fd_lookup_table_meta_new( self );
    7962           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_lookup_table_meta_t);
    7963           0 :   void * * alloc_mem = &alloc_region;
    7964           0 :   fd_lookup_table_meta_decode_inner( mem, alloc_mem, ctx );
    7965           0 :   return self;
    7966           0 : }
    7967           0 : void fd_lookup_table_meta_new(fd_lookup_table_meta_t * self) {
    7968           0 :   fd_memset( self, 0, sizeof(fd_lookup_table_meta_t) );
    7969           0 : }
    7970           0 : ulong fd_lookup_table_meta_size( fd_lookup_table_meta_t const * self ) {
    7971           0 :   ulong size = 0;
    7972           0 :   size += sizeof(ulong);
    7973           0 :   size += sizeof(ulong);
    7974           0 :   size += sizeof(char);
    7975           0 :   size += sizeof(char);
    7976           0 :   if( self->has_authority ) {
    7977           0 :     size += fd_pubkey_size( &self->authority );
    7978           0 :   }
    7979           0 :   size += sizeof(ushort);
    7980           0 :   return size;
    7981           0 : }
    7982             : 
    7983           6 : int fd_address_lookup_table_encode( fd_address_lookup_table_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7984           6 :   int err;
    7985           6 :   err = fd_lookup_table_meta_encode( &self->meta, ctx );
    7986           6 :   if( FD_UNLIKELY( err ) ) return err;
    7987           6 :   return FD_BINCODE_SUCCESS;
    7988           6 : }
    7989           3 : static int fd_address_lookup_table_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7990           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7991           3 :   int err = 0;
    7992           3 :   err = fd_lookup_table_meta_decode_footprint_inner( ctx, total_sz );
    7993           3 :   if( FD_UNLIKELY( err ) ) return err;
    7994           3 :   return 0;
    7995           3 : }
    7996           0 : int fd_address_lookup_table_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7997           0 :   *total_sz += sizeof(fd_address_lookup_table_t);
    7998           0 :   void const * start_data = ctx->data;
    7999           0 :   int err = fd_address_lookup_table_decode_footprint_inner( ctx, total_sz );
    8000           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8001           0 :   ctx->data = start_data;
    8002           0 :   return err;
    8003           0 : }
    8004           3 : static void fd_address_lookup_table_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8005           3 :   fd_address_lookup_table_t * self = (fd_address_lookup_table_t *)struct_mem;
    8006           3 :   fd_lookup_table_meta_decode_inner( &self->meta, alloc_mem, ctx );
    8007           3 : }
    8008           0 : void * fd_address_lookup_table_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8009           0 :   fd_address_lookup_table_t * self = (fd_address_lookup_table_t *)mem;
    8010           0 :   fd_address_lookup_table_new( self );
    8011           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_address_lookup_table_t);
    8012           0 :   void * * alloc_mem = &alloc_region;
    8013           0 :   fd_address_lookup_table_decode_inner( mem, alloc_mem, ctx );
    8014           0 :   return self;
    8015           0 : }
    8016           0 : void fd_address_lookup_table_new(fd_address_lookup_table_t * self) {
    8017           0 :   fd_memset( self, 0, sizeof(fd_address_lookup_table_t) );
    8018           0 :   fd_lookup_table_meta_new( &self->meta );
    8019           0 : }
    8020           0 : ulong fd_address_lookup_table_size( fd_address_lookup_table_t const * self ) {
    8021           0 :   ulong size = 0;
    8022           0 :   size += fd_lookup_table_meta_size( &self->meta );
    8023           0 :   return size;
    8024           0 : }
    8025             : 
    8026           0 : FD_FN_PURE uchar fd_address_lookup_table_state_is_uninitialized(fd_address_lookup_table_state_t const * self) {
    8027           0 :   return self->discriminant == 0;
    8028           0 : }
    8029           0 : FD_FN_PURE uchar fd_address_lookup_table_state_is_lookup_table(fd_address_lookup_table_state_t const * self) {
    8030           0 :   return self->discriminant == 1;
    8031           0 : }
    8032             : void fd_address_lookup_table_state_inner_new( fd_address_lookup_table_state_inner_t * self, uint discriminant );
    8033           3 : int fd_address_lookup_table_state_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8034           3 :   int err;
    8035           3 :   switch (discriminant) {
    8036           0 :   case 0: {
    8037           0 :     return FD_BINCODE_SUCCESS;
    8038           0 :   }
    8039           3 :   case 1: {
    8040           3 :     err = fd_address_lookup_table_decode_footprint_inner( ctx, total_sz );
    8041           3 :     if( FD_UNLIKELY( err ) ) return err;
    8042           3 :     return FD_BINCODE_SUCCESS;
    8043           3 :   }
    8044           0 :   default: return FD_BINCODE_ERR_ENCODING;
    8045           3 :   }
    8046           3 : }
    8047           3 : static int fd_address_lookup_table_state_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8048           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8049           3 :   uint discriminant = 0;
    8050           3 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    8051           3 :   if( FD_UNLIKELY( err ) ) return err;
    8052           3 :   return fd_address_lookup_table_state_inner_decode_footprint( discriminant, ctx, total_sz );
    8053           3 : }
    8054           3 : int fd_address_lookup_table_state_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8055           3 :   *total_sz += sizeof(fd_address_lookup_table_state_t);
    8056           3 :   void const * start_data = ctx->data;
    8057           3 :   int err =  fd_address_lookup_table_state_decode_footprint_inner( ctx, total_sz );
    8058           3 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8059           3 :   ctx->data = start_data;
    8060           3 :   return err;
    8061           3 : }
    8062           3 : static void fd_address_lookup_table_state_inner_decode_inner( fd_address_lookup_table_state_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    8063           3 :   switch (discriminant) {
    8064           0 :   case 0: {
    8065           0 :     break;
    8066           0 :   }
    8067           3 :   case 1: {
    8068           3 :     fd_address_lookup_table_decode_inner( &self->lookup_table, alloc_mem, ctx );
    8069           3 :     break;
    8070           0 :   }
    8071           3 :   }
    8072           3 : }
    8073           3 : static void fd_address_lookup_table_state_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8074           3 :   fd_address_lookup_table_state_t * self = (fd_address_lookup_table_state_t *)struct_mem;
    8075           3 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    8076           3 :   fd_address_lookup_table_state_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    8077           3 : }
    8078           3 : void * fd_address_lookup_table_state_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8079           3 :   fd_address_lookup_table_state_t * self = (fd_address_lookup_table_state_t *)mem;
    8080           3 :   fd_address_lookup_table_state_new( self );
    8081           3 :   void * alloc_region = (uchar *)mem + sizeof(fd_address_lookup_table_state_t);
    8082           3 :   void * * alloc_mem = &alloc_region;
    8083           3 :   fd_address_lookup_table_state_decode_inner( mem, alloc_mem, ctx );
    8084           3 :   return self;
    8085           3 : }
    8086           3 : void fd_address_lookup_table_state_inner_new( fd_address_lookup_table_state_inner_t * self, uint discriminant ) {
    8087           3 :   switch( discriminant ) {
    8088           0 :   case 0: {
    8089           0 :     break;
    8090           0 :   }
    8091           0 :   case 1: {
    8092           0 :     fd_address_lookup_table_new( &self->lookup_table );
    8093           0 :     break;
    8094           0 :   }
    8095           3 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    8096           3 :   }
    8097           3 : }
    8098           3 : void fd_address_lookup_table_state_new_disc( fd_address_lookup_table_state_t * self, uint discriminant ) {
    8099           3 :   self->discriminant = discriminant;
    8100           3 :   fd_address_lookup_table_state_inner_new( &self->inner, self->discriminant );
    8101           3 : }
    8102           3 : void fd_address_lookup_table_state_new( fd_address_lookup_table_state_t * self ) {
    8103           3 :   fd_memset( self, 0, sizeof(fd_address_lookup_table_state_t) );
    8104           3 :   fd_address_lookup_table_state_new_disc( self, UINT_MAX );
    8105           3 : }
    8106             : 
    8107           0 : ulong fd_address_lookup_table_state_size( fd_address_lookup_table_state_t const * self ) {
    8108           0 :   ulong size = 0;
    8109           0 :   size += sizeof(uint);
    8110           0 :   switch (self->discriminant) {
    8111           0 :   case 1: {
    8112           0 :     size += fd_address_lookup_table_size( &self->inner.lookup_table );
    8113           0 :     break;
    8114           0 :   }
    8115           0 :   }
    8116           0 :   return size;
    8117           0 : }
    8118             : 
    8119           6 : int fd_address_lookup_table_state_inner_encode( fd_address_lookup_table_state_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    8120           6 :   int err;
    8121           6 :   switch (discriminant) {
    8122           6 :   case 1: {
    8123           6 :     err = fd_address_lookup_table_encode( &self->lookup_table, ctx );
    8124           6 :     if( FD_UNLIKELY( err ) ) return err;
    8125           6 :     break;
    8126           6 :   }
    8127           6 :   }
    8128           6 :   return FD_BINCODE_SUCCESS;
    8129           6 : }
    8130           6 : int fd_address_lookup_table_state_encode( fd_address_lookup_table_state_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    8131           6 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    8132           6 :   if( FD_UNLIKELY( err ) ) return err;
    8133           6 :   return fd_address_lookup_table_state_inner_encode( &self->inner, self->discriminant, ctx );
    8134           6 : }
    8135             : 
    8136             : #include "fd_types_custom.c"

Generated by: LCOV version 1.14