LCOV - code coverage report
Current view: top level - flamenco/types - fd_types.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 718 9374 7.7 %
Date: 2025-12-21 05:09:38 Functions: 74 876 8.4 %

          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_feature_encode( fd_feature_t const * self, fd_bincode_encode_ctx_t * ctx ) {
      12           0 :   int err;
      13           0 :   err = fd_bincode_bool_encode( self->has_activated_at, ctx );
      14           0 :   if( FD_UNLIKELY( err ) ) return err;
      15           0 :   if( self->has_activated_at ) {
      16           0 :     err = fd_bincode_uint64_encode( self->activated_at, ctx );
      17           0 :     if( FD_UNLIKELY( err ) ) return err;
      18           0 :   }
      19           0 :   return FD_BINCODE_SUCCESS;
      20           0 : }
      21           0 : static int fd_feature_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
      22           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
      23           0 :   int err = 0;
      24           0 :   {
      25           0 :     uchar o;
      26           0 :     err = fd_bincode_bool_decode( &o, ctx );
      27           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
      28           0 :     if( o ) {
      29           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
      30           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
      31           0 :     }
      32           0 :   }
      33           0 :   return 0;
      34           0 : }
      35           0 : int fd_feature_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
      36           0 :   *total_sz += sizeof(fd_feature_t);
      37           0 :   void const * start_data = ctx->data;
      38           0 :   int err = fd_feature_decode_footprint_inner( ctx, total_sz );
      39           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
      40           0 :   ctx->data = start_data;
      41           0 :   return err;
      42           0 : }
      43           0 : static void fd_feature_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
      44           0 :   fd_feature_t * self = (fd_feature_t *)struct_mem;
      45           0 :   {
      46           0 :     uchar o;
      47           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
      48           0 :     self->has_activated_at = !!o;
      49           0 :     if( o ) {
      50           0 :       fd_bincode_uint64_decode_unsafe( &self->activated_at, ctx );
      51           0 :     }
      52           0 :   }
      53           0 : }
      54           0 : void * fd_feature_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
      55           0 :   fd_feature_t * self = (fd_feature_t *)mem;
      56           0 :   fd_feature_new( self );
      57           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_feature_t);
      58           0 :   void * * alloc_mem = &alloc_region;
      59           0 :   fd_feature_decode_inner( mem, alloc_mem, ctx );
      60           0 :   return self;
      61           0 : }
      62           0 : void fd_feature_new(fd_feature_t * self) {
      63           0 :   fd_memset( self, 0, sizeof(fd_feature_t) );
      64           0 : }
      65           0 : ulong fd_feature_size( fd_feature_t const * self ) {
      66           0 :   ulong size = 0;
      67           0 :   size += sizeof(char);
      68           0 :   if( self->has_activated_at ) {
      69           0 :     size += sizeof(ulong);
      70           0 :   }
      71           0 :   return size;
      72           0 : }
      73             : 
      74           0 : int fd_fee_calculator_encode( fd_fee_calculator_t const * self, fd_bincode_encode_ctx_t * ctx ) {
      75           0 :   int err;
      76           0 :   err = fd_bincode_uint64_encode( self->lamports_per_signature, ctx );
      77           0 :   if( FD_UNLIKELY( err ) ) return err;
      78           0 :   return FD_BINCODE_SUCCESS;
      79           0 : }
      80           0 : static inline int fd_fee_calculator_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
      81           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
      82           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
      83           0 :   return 0;
      84           0 : }
      85       33975 : static void fd_fee_calculator_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
      86       33975 :   fd_fee_calculator_t * self = (fd_fee_calculator_t *)struct_mem;
      87       33975 :   fd_bincode_uint64_decode_unsafe( &self->lamports_per_signature, ctx );
      88       33975 : }
      89           0 : void * fd_fee_calculator_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
      90           0 :   fd_fee_calculator_t * self = (fd_fee_calculator_t *)mem;
      91           0 :   fd_fee_calculator_new( self );
      92           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_fee_calculator_t);
      93           0 :   void * * alloc_mem = &alloc_region;
      94           0 :   fd_fee_calculator_decode_inner( mem, alloc_mem, ctx );
      95           0 :   return self;
      96           0 : }
      97           9 : int fd_fee_rate_governor_encode( fd_fee_rate_governor_t const * self, fd_bincode_encode_ctx_t * ctx ) {
      98           9 :   int err;
      99           9 :   err = fd_bincode_uint64_encode( self->target_lamports_per_signature, ctx );
     100           9 :   if( FD_UNLIKELY( err ) ) return err;
     101           9 :   err = fd_bincode_uint64_encode( self->target_signatures_per_slot, ctx );
     102           9 :   if( FD_UNLIKELY( err ) ) return err;
     103           9 :   err = fd_bincode_uint64_encode( self->min_lamports_per_signature, ctx );
     104           9 :   if( FD_UNLIKELY( err ) ) return err;
     105           9 :   err = fd_bincode_uint64_encode( self->max_lamports_per_signature, ctx );
     106           9 :   if( FD_UNLIKELY( err ) ) return err;
     107           9 :   err = fd_bincode_uint8_encode( (uchar)(self->burn_percent), ctx );
     108           9 :   if( FD_UNLIKELY( err ) ) return err;
     109           9 :   return FD_BINCODE_SUCCESS;
     110           9 : }
     111           0 : static inline int fd_fee_rate_governor_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     112           0 :   if( (ulong)ctx->data + 33UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     113           0 :   ctx->data = (void *)( (ulong)ctx->data + 33UL );
     114           0 :   return 0;
     115           0 : }
     116           0 : static void fd_fee_rate_governor_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     117           0 :   fd_fee_rate_governor_t * self = (fd_fee_rate_governor_t *)struct_mem;
     118           0 :   fd_bincode_uint64_decode_unsafe( &self->target_lamports_per_signature, ctx );
     119           0 :   fd_bincode_uint64_decode_unsafe( &self->target_signatures_per_slot, ctx );
     120           0 :   fd_bincode_uint64_decode_unsafe( &self->min_lamports_per_signature, ctx );
     121           0 :   fd_bincode_uint64_decode_unsafe( &self->max_lamports_per_signature, ctx );
     122           0 :   fd_bincode_uint8_decode_unsafe( &self->burn_percent, ctx );
     123           0 : }
     124           0 : void * fd_fee_rate_governor_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     125           0 :   fd_fee_rate_governor_t * self = (fd_fee_rate_governor_t *)mem;
     126           0 :   fd_fee_rate_governor_new( self );
     127           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_fee_rate_governor_t);
     128           0 :   void * * alloc_mem = &alloc_region;
     129           0 :   fd_fee_rate_governor_decode_inner( mem, alloc_mem, ctx );
     130           0 :   return self;
     131           0 : }
     132           0 : int fd_slot_pair_encode( fd_slot_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     133           0 :   int err;
     134           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
     135           0 :   if( FD_UNLIKELY( err ) ) return err;
     136           0 :   err = fd_bincode_uint64_encode( self->val, ctx );
     137           0 :   if( FD_UNLIKELY( err ) ) return err;
     138           0 :   return FD_BINCODE_SUCCESS;
     139           0 : }
     140           0 : static inline int fd_slot_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     141           0 :   if( (ulong)ctx->data + 16UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     142           0 :   ctx->data = (void *)( (ulong)ctx->data + 16UL );
     143           0 :   return 0;
     144           0 : }
     145           0 : static void fd_slot_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     146           0 :   fd_slot_pair_t * self = (fd_slot_pair_t *)struct_mem;
     147           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
     148           0 :   fd_bincode_uint64_decode_unsafe( &self->val, ctx );
     149           0 : }
     150           0 : void * fd_slot_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     151           0 :   fd_slot_pair_t * self = (fd_slot_pair_t *)mem;
     152           0 :   fd_slot_pair_new( self );
     153           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_pair_t);
     154           0 :   void * * alloc_mem = &alloc_region;
     155           0 :   fd_slot_pair_decode_inner( mem, alloc_mem, ctx );
     156           0 :   return self;
     157           0 : }
     158           0 : int fd_hard_forks_encode( fd_hard_forks_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     159           0 :   int err;
     160           0 :   err = fd_bincode_uint64_encode( self->hard_forks_len, ctx );
     161           0 :   if( FD_UNLIKELY(err) ) return err;
     162           0 :   if( self->hard_forks_len ) {
     163           0 :     for( ulong i=0; i < self->hard_forks_len; i++ ) {
     164           0 :       err = fd_slot_pair_encode( self->hard_forks + i, ctx );
     165           0 :       if( FD_UNLIKELY( err ) ) return err;
     166           0 :     }
     167           0 :   }
     168           0 :   return FD_BINCODE_SUCCESS;
     169           0 : }
     170           0 : int fd_hard_forks_encode_global( fd_hard_forks_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     171           0 :   int err;
     172           0 :   err = fd_bincode_uint64_encode( self->hard_forks_len, ctx );
     173           0 :   if( FD_UNLIKELY( err ) ) return err;
     174           0 :   if( self->hard_forks_len ) {
     175           0 :     uchar * hard_forks_laddr = (uchar*)self + self->hard_forks_offset;
     176           0 :     fd_slot_pair_t * hard_forks = (fd_slot_pair_t *)hard_forks_laddr;
     177           0 :     for( ulong i=0; i < self->hard_forks_len; i++ ) {
     178           0 :       err = fd_slot_pair_encode( &hard_forks[i], ctx );
     179           0 :       if( FD_UNLIKELY( err ) ) return err;
     180           0 :     }
     181           0 :   }
     182           0 :   return FD_BINCODE_SUCCESS;
     183           0 : }
     184           0 : static int fd_hard_forks_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     185           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     186           0 :   int err = 0;
     187           0 :   ulong hard_forks_len;
     188           0 :   err = fd_bincode_uint64_decode( &hard_forks_len, ctx );
     189           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     190           0 :   if( hard_forks_len ) {
     191           0 :     *total_sz += FD_SLOT_PAIR_ALIGN + sizeof(fd_slot_pair_t)*hard_forks_len;
     192           0 :     for( ulong i=0; i < hard_forks_len; i++ ) {
     193           0 :       err = fd_slot_pair_decode_footprint_inner( ctx, total_sz );
     194           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     195           0 :     }
     196           0 :   }
     197           0 :   return 0;
     198           0 : }
     199           0 : int fd_hard_forks_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     200           0 :   *total_sz += sizeof(fd_hard_forks_t);
     201           0 :   void const * start_data = ctx->data;
     202           0 :   int err = fd_hard_forks_decode_footprint_inner( ctx, total_sz );
     203           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     204           0 :   ctx->data = start_data;
     205           0 :   return err;
     206           0 : }
     207           0 : static void fd_hard_forks_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     208           0 :   fd_hard_forks_t * self = (fd_hard_forks_t *)struct_mem;
     209           0 :   fd_bincode_uint64_decode_unsafe( &self->hard_forks_len, ctx );
     210           0 :   if( self->hard_forks_len ) {
     211           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_SLOT_PAIR_ALIGN );
     212           0 :     self->hard_forks = *alloc_mem;
     213           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_slot_pair_t)*self->hard_forks_len;
     214           0 :     for( ulong i=0; i < self->hard_forks_len; i++ ) {
     215           0 :       fd_slot_pair_new( self->hard_forks + i );
     216           0 :       fd_slot_pair_decode_inner( self->hard_forks + i, alloc_mem, ctx );
     217           0 :     }
     218           0 :   } else
     219           0 :     self->hard_forks = NULL;
     220           0 : }
     221           0 : void * fd_hard_forks_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     222           0 :   fd_hard_forks_t * self = (fd_hard_forks_t *)mem;
     223           0 :   fd_hard_forks_new( self );
     224           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_hard_forks_t);
     225           0 :   void * * alloc_mem = &alloc_region;
     226           0 :   fd_hard_forks_decode_inner( mem, alloc_mem, ctx );
     227           0 :   return self;
     228           0 : }
     229           0 : static void fd_hard_forks_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     230           0 :   fd_hard_forks_global_t * self = (fd_hard_forks_global_t *)struct_mem;
     231           0 :   fd_bincode_uint64_decode_unsafe( &self->hard_forks_len, ctx );
     232           0 :   if( self->hard_forks_len ) {
     233           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_SLOT_PAIR_ALIGN );
     234           0 :     self->hard_forks_offset = (ulong)*alloc_mem - (ulong)struct_mem;
     235           0 :     uchar * cur_mem = (uchar *)(*alloc_mem);
     236           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_slot_pair_t)*self->hard_forks_len;
     237           0 :     for( ulong i=0; i < self->hard_forks_len; i++ ) {
     238           0 :       fd_slot_pair_new( (fd_slot_pair_t *)fd_type_pun(cur_mem + sizeof(fd_slot_pair_t) * i) );
     239           0 :       fd_slot_pair_decode_inner( cur_mem + sizeof(fd_slot_pair_t) * i, alloc_mem, ctx );
     240           0 :     }
     241           0 :   } else {
     242           0 :     self->hard_forks_offset = 0UL;
     243           0 :   }
     244           0 : }
     245           0 : void * fd_hard_forks_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     246           0 :   fd_hard_forks_global_t * self = (fd_hard_forks_global_t *)mem;
     247           0 :   fd_hard_forks_new( (fd_hard_forks_t *)self );
     248           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_hard_forks_global_t);
     249           0 :   void * * alloc_mem = &alloc_region;
     250           0 :   fd_hard_forks_decode_inner_global( mem, alloc_mem, ctx );
     251           0 :   return self;
     252           0 : }
     253           0 : void fd_hard_forks_new(fd_hard_forks_t * self) {
     254           0 :   fd_memset( self, 0, sizeof(fd_hard_forks_t) );
     255           0 : }
     256           0 : ulong fd_hard_forks_size( fd_hard_forks_t const * self ) {
     257           0 :   ulong size = 0;
     258           0 :   do {
     259           0 :     size += sizeof(ulong);
     260           0 :     for( ulong i=0; i < self->hard_forks_len; i++ )
     261           0 :       size += fd_slot_pair_size( self->hard_forks + i );
     262           0 :   } while(0);
     263           0 :   return size;
     264           0 : }
     265             : 
     266           0 : ulong fd_hard_forks_size_global( fd_hard_forks_global_t const * self ) {
     267           0 :   ulong size = 0;
     268           0 :   do {
     269           0 :     size += sizeof(ulong);
     270           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;
     271           0 :     for( ulong i=0; i < self->hard_forks_len; i++ )
     272           0 :       size += fd_slot_pair_size( hard_forks + i );
     273           0 :   } while(0);
     274           0 :   return size;
     275           0 : }
     276             : 
     277           9 : int fd_inflation_encode( fd_inflation_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     278           9 :   int err;
     279           9 :   err = fd_bincode_double_encode( self->initial, ctx );
     280           9 :   if( FD_UNLIKELY( err ) ) return err;
     281           9 :   err = fd_bincode_double_encode( self->terminal, ctx );
     282           9 :   if( FD_UNLIKELY( err ) ) return err;
     283           9 :   err = fd_bincode_double_encode( self->taper, ctx );
     284           9 :   if( FD_UNLIKELY( err ) ) return err;
     285           9 :   err = fd_bincode_double_encode( self->foundation, ctx );
     286           9 :   if( FD_UNLIKELY( err ) ) return err;
     287           9 :   err = fd_bincode_double_encode( self->foundation_term, ctx );
     288           9 :   if( FD_UNLIKELY( err ) ) return err;
     289           9 :   err = fd_bincode_double_encode( self->unused, ctx );
     290           9 :   if( FD_UNLIKELY( err ) ) return err;
     291           9 :   return FD_BINCODE_SUCCESS;
     292           9 : }
     293           0 : static inline int fd_inflation_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     294           0 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     295           0 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
     296           0 :   return 0;
     297           0 : }
     298           0 : static void fd_inflation_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     299           0 :   fd_inflation_t * self = (fd_inflation_t *)struct_mem;
     300           0 :   fd_bincode_double_decode_unsafe( &self->initial, ctx );
     301           0 :   fd_bincode_double_decode_unsafe( &self->terminal, ctx );
     302           0 :   fd_bincode_double_decode_unsafe( &self->taper, ctx );
     303           0 :   fd_bincode_double_decode_unsafe( &self->foundation, ctx );
     304           0 :   fd_bincode_double_decode_unsafe( &self->foundation_term, ctx );
     305           0 :   fd_bincode_double_decode_unsafe( &self->unused, ctx );
     306           0 : }
     307           0 : void * fd_inflation_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     308           0 :   fd_inflation_t * self = (fd_inflation_t *)mem;
     309           0 :   fd_inflation_new( self );
     310           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_inflation_t);
     311           0 :   void * * alloc_mem = &alloc_region;
     312           0 :   fd_inflation_decode_inner( mem, alloc_mem, ctx );
     313           0 :   return self;
     314           0 : }
     315           9 : int fd_rent_encode( fd_rent_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     316           9 :   int err;
     317           9 :   err = fd_bincode_uint64_encode( self->lamports_per_uint8_year, ctx );
     318           9 :   if( FD_UNLIKELY( err ) ) return err;
     319           9 :   err = fd_bincode_double_encode( self->exemption_threshold, ctx );
     320           9 :   if( FD_UNLIKELY( err ) ) return err;
     321           9 :   err = fd_bincode_uint8_encode( (uchar)(self->burn_percent), ctx );
     322           9 :   if( FD_UNLIKELY( err ) ) return err;
     323           9 :   return FD_BINCODE_SUCCESS;
     324           9 : }
     325           0 : static inline int fd_rent_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     326           0 :   if( (ulong)ctx->data + 17UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     327           0 :   ctx->data = (void *)( (ulong)ctx->data + 17UL );
     328           0 :   return 0;
     329           0 : }
     330           0 : static void fd_rent_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     331           0 :   fd_rent_t * self = (fd_rent_t *)struct_mem;
     332           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports_per_uint8_year, ctx );
     333           0 :   fd_bincode_double_decode_unsafe( &self->exemption_threshold, ctx );
     334           0 :   fd_bincode_uint8_decode_unsafe( &self->burn_percent, ctx );
     335           0 : }
     336           0 : void * fd_rent_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     337           0 :   fd_rent_t * self = (fd_rent_t *)mem;
     338           0 :   fd_rent_new( self );
     339           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_rent_t);
     340           0 :   void * * alloc_mem = &alloc_region;
     341           0 :   fd_rent_decode_inner( mem, alloc_mem, ctx );
     342           0 :   return self;
     343           0 : }
     344           9 : int fd_epoch_schedule_encode( fd_epoch_schedule_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     345           9 :   int err;
     346           9 :   err = fd_bincode_uint64_encode( self->slots_per_epoch, ctx );
     347           9 :   if( FD_UNLIKELY( err ) ) return err;
     348           9 :   err = fd_bincode_uint64_encode( self->leader_schedule_slot_offset, ctx );
     349           9 :   if( FD_UNLIKELY( err ) ) return err;
     350           9 :   err = fd_bincode_bool_encode( (uchar)(self->warmup), ctx );
     351           9 :   if( FD_UNLIKELY( err ) ) return err;
     352           9 :   err = fd_bincode_uint64_encode( self->first_normal_epoch, ctx );
     353           9 :   if( FD_UNLIKELY( err ) ) return err;
     354           9 :   err = fd_bincode_uint64_encode( self->first_normal_slot, ctx );
     355           9 :   if( FD_UNLIKELY( err ) ) return err;
     356           9 :   return FD_BINCODE_SUCCESS;
     357           9 : }
     358           3 : static int fd_epoch_schedule_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     359           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     360           3 :   int err = 0;
     361           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
     362           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     363           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
     364           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     365           3 :   err = fd_bincode_bool_decode_footprint( ctx );
     366           3 :   if( FD_UNLIKELY( err ) ) return err;
     367           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
     368           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     369           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
     370           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     371           3 :   return 0;
     372           3 : }
     373           3 : int fd_epoch_schedule_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     374           3 :   *total_sz += sizeof(fd_epoch_schedule_t);
     375           3 :   void const * start_data = ctx->data;
     376           3 :   int err = fd_epoch_schedule_decode_footprint_inner( ctx, total_sz );
     377           3 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     378           3 :   ctx->data = start_data;
     379           3 :   return err;
     380           3 : }
     381           0 : static void fd_epoch_schedule_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     382           0 :   fd_epoch_schedule_t * self = (fd_epoch_schedule_t *)struct_mem;
     383           0 :   fd_bincode_uint64_decode_unsafe( &self->slots_per_epoch, ctx );
     384           0 :   fd_bincode_uint64_decode_unsafe( &self->leader_schedule_slot_offset, ctx );
     385           0 :   fd_bincode_bool_decode_unsafe( &self->warmup, ctx );
     386           0 :   fd_bincode_uint64_decode_unsafe( &self->first_normal_epoch, ctx );
     387           0 :   fd_bincode_uint64_decode_unsafe( &self->first_normal_slot, ctx );
     388           0 : }
     389           0 : void * fd_epoch_schedule_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     390           0 :   fd_epoch_schedule_t * self = (fd_epoch_schedule_t *)mem;
     391           0 :   fd_epoch_schedule_new( self );
     392           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_epoch_schedule_t);
     393           0 :   void * * alloc_mem = &alloc_region;
     394           0 :   fd_epoch_schedule_decode_inner( mem, alloc_mem, ctx );
     395           0 :   return self;
     396           0 : }
     397          12 : void fd_epoch_schedule_new(fd_epoch_schedule_t * self) {
     398          12 :   fd_memset( self, 0, sizeof(fd_epoch_schedule_t) );
     399          12 : }
     400           9 : int fd_stake_history_entry_encode( fd_stake_history_entry_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     401           9 :   int err;
     402           9 :   err = fd_bincode_uint64_encode( self->effective, ctx );
     403           9 :   if( FD_UNLIKELY( err ) ) return err;
     404           9 :   err = fd_bincode_uint64_encode( self->activating, ctx );
     405           9 :   if( FD_UNLIKELY( err ) ) return err;
     406           9 :   err = fd_bincode_uint64_encode( self->deactivating, ctx );
     407           9 :   if( FD_UNLIKELY( err ) ) return err;
     408           9 :   return FD_BINCODE_SUCCESS;
     409           9 : }
     410           0 : static inline int fd_stake_history_entry_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     411           0 :   if( (ulong)ctx->data + 24UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     412           0 :   ctx->data = (void *)( (ulong)ctx->data + 24UL );
     413           0 :   return 0;
     414           0 : }
     415          12 : static void fd_stake_history_entry_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     416          12 :   fd_stake_history_entry_t * self = (fd_stake_history_entry_t *)struct_mem;
     417          12 :   fd_bincode_uint64_decode_unsafe( &self->effective, ctx );
     418          12 :   fd_bincode_uint64_decode_unsafe( &self->activating, ctx );
     419          12 :   fd_bincode_uint64_decode_unsafe( &self->deactivating, ctx );
     420          12 : }
     421           0 : void * fd_stake_history_entry_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     422           0 :   fd_stake_history_entry_t * self = (fd_stake_history_entry_t *)mem;
     423           0 :   fd_stake_history_entry_new( self );
     424           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_history_entry_t);
     425           0 :   void * * alloc_mem = &alloc_region;
     426           0 :   fd_stake_history_entry_decode_inner( mem, alloc_mem, ctx );
     427           0 :   return self;
     428           0 : }
     429           9 : int fd_epoch_stake_history_entry_pair_encode( fd_epoch_stake_history_entry_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     430           9 :   int err;
     431           9 :   err = fd_bincode_uint64_encode( self->epoch, ctx );
     432           9 :   if( FD_UNLIKELY( err ) ) return err;
     433           9 :   err = fd_stake_history_entry_encode( &self->entry, ctx );
     434           9 :   if( FD_UNLIKELY( err ) ) return err;
     435           9 :   return FD_BINCODE_SUCCESS;
     436           9 : }
     437        1548 : static inline int fd_epoch_stake_history_entry_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     438        1548 :   if( (ulong)ctx->data + 32UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     439        1548 :   ctx->data = (void *)( (ulong)ctx->data + 32UL );
     440        1548 :   return 0;
     441        1548 : }
     442          12 : static void fd_epoch_stake_history_entry_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     443          12 :   fd_epoch_stake_history_entry_pair_t * self = (fd_epoch_stake_history_entry_pair_t *)struct_mem;
     444          12 :   fd_bincode_uint64_decode_unsafe( &self->epoch, ctx );
     445          12 :   fd_stake_history_entry_decode_inner( &self->entry, alloc_mem, ctx );
     446          12 : }
     447           0 : void * fd_epoch_stake_history_entry_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     448           0 :   fd_epoch_stake_history_entry_pair_t * self = (fd_epoch_stake_history_entry_pair_t *)mem;
     449           0 :   fd_epoch_stake_history_entry_pair_new( self );
     450           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_epoch_stake_history_entry_pair_t);
     451           0 :   void * * alloc_mem = &alloc_region;
     452           0 :   fd_epoch_stake_history_entry_pair_decode_inner( mem, alloc_mem, ctx );
     453           0 :   return self;
     454           0 : }
     455           9 : int fd_stake_history_encode( fd_stake_history_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     456           9 :   int err;
     457           9 :   err = fd_bincode_uint64_encode( self->fd_stake_history_len, ctx );
     458           9 :   if( FD_UNLIKELY(err) ) return err;
     459           9 :   if( FD_UNLIKELY( 0 == self->fd_stake_history_len ) ) return FD_BINCODE_SUCCESS;
     460          15 :   for( ulong i=0; i<self->fd_stake_history_len; i++ ) {
     461           9 :     ulong idx = ( i + self->fd_stake_history_offset ) & (512 - 1);
     462           9 :     err = fd_epoch_stake_history_entry_pair_encode( self->fd_stake_history + idx, ctx );
     463           9 :     if( FD_UNLIKELY( err ) ) return err;
     464           9 :   }
     465           6 :   return FD_BINCODE_SUCCESS;
     466           6 : }
     467          15 : static int fd_stake_history_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     468          15 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     469          15 :   int err = 0;
     470          15 :   ulong fd_stake_history_len;
     471          15 :   err = fd_bincode_uint64_decode( &fd_stake_history_len, ctx );
     472          15 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     473          15 :   if( fd_stake_history_len ) {
     474        1560 :     for( ulong i=0; i < fd_stake_history_len; i++ ) {
     475        1548 :       err = fd_epoch_stake_history_entry_pair_decode_footprint_inner( ctx, total_sz );
     476        1548 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     477        1548 :     }
     478          12 :   }
     479          15 :   return 0;
     480          15 : }
     481          15 : int fd_stake_history_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     482          15 :   *total_sz += sizeof(fd_stake_history_t);
     483          15 :   void const * start_data = ctx->data;
     484          15 :   int err = fd_stake_history_decode_footprint_inner( ctx, total_sz );
     485          15 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     486          15 :   ctx->data = start_data;
     487          15 :   return err;
     488          15 : }
     489          12 : static void fd_stake_history_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     490          12 :   fd_stake_history_t * self = (fd_stake_history_t *)struct_mem;
     491          12 :   fd_bincode_uint64_decode_unsafe( &self->fd_stake_history_len, ctx );
     492          12 :   self->fd_stake_history_size = 512;
     493          12 :   self->fd_stake_history_offset = 0;
     494          24 :   for( ulong i=0; i<self->fd_stake_history_len; i++ ) {
     495          12 :     fd_epoch_stake_history_entry_pair_decode_inner( self->fd_stake_history + i, alloc_mem, ctx );
     496          12 :   }
     497          12 : }
     498          12 : void * fd_stake_history_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     499          12 :   fd_stake_history_t * self = (fd_stake_history_t *)mem;
     500          12 :   fd_stake_history_new( self );
     501          12 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_history_t);
     502          12 :   void * * alloc_mem = &alloc_region;
     503          12 :   fd_stake_history_decode_inner( mem, alloc_mem, ctx );
     504          12 :   return self;
     505          12 : }
     506          15 : void fd_stake_history_new(fd_stake_history_t * self) {
     507          15 :   fd_memset( self, 0, sizeof(fd_stake_history_t) );
     508          15 :   self->fd_stake_history_size = 512;
     509        7695 :   for( ulong i=0; i<512; i++ )
     510        7680 :     fd_epoch_stake_history_entry_pair_new( self->fd_stake_history + i );
     511          15 : }
     512         144 : int fd_solana_account_encode( fd_solana_account_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     513         144 :   int err;
     514         144 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
     515         144 :   if( FD_UNLIKELY( err ) ) return err;
     516         144 :   err = fd_bincode_uint64_encode( self->data_len, ctx );
     517         144 :   if( FD_UNLIKELY(err) ) return err;
     518         144 :   if( self->data_len ) {
     519          30 :     err = fd_bincode_bytes_encode( self->data, self->data_len, ctx );
     520          30 :     if( FD_UNLIKELY( err ) ) return err;
     521          30 :   }
     522         144 :   err = fd_pubkey_encode( &self->owner, ctx );
     523         144 :   if( FD_UNLIKELY( err ) ) return err;
     524         144 :   err = fd_bincode_bool_encode( (uchar)(self->executable), ctx );
     525         144 :   if( FD_UNLIKELY( err ) ) return err;
     526         144 :   err = fd_bincode_uint64_encode( self->rent_epoch, ctx );
     527         144 :   if( FD_UNLIKELY( err ) ) return err;
     528         144 :   return FD_BINCODE_SUCCESS;
     529         144 : }
     530           0 : int fd_solana_account_encode_global( fd_solana_account_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     531           0 :   int err;
     532           0 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
     533           0 :   if( FD_UNLIKELY( err ) ) return err;
     534           0 :   err = fd_bincode_uint64_encode( self->data_len, ctx );
     535           0 :   if( FD_UNLIKELY( err ) ) return err;
     536           0 :   if( self->data_len ) {
     537           0 :     uchar * data_laddr = (uchar*)self + self->data_offset;
     538           0 :     err = fd_bincode_bytes_encode( data_laddr, self->data_len, ctx );
     539           0 :     if( FD_UNLIKELY( err ) ) return err;
     540           0 :   }
     541           0 :   err = fd_pubkey_encode( &self->owner, ctx );
     542           0 :   if( FD_UNLIKELY( err ) ) return err;
     543           0 :   err = fd_bincode_bool_encode( (uchar)(self->executable), ctx );
     544           0 :   if( FD_UNLIKELY( err ) ) return err;
     545           0 :   err = fd_bincode_uint64_encode( self->rent_epoch, ctx );
     546           0 :   if( FD_UNLIKELY( err ) ) return err;
     547           0 :   return FD_BINCODE_SUCCESS;
     548           0 : }
     549           0 : static int fd_solana_account_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     550           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     551           0 :   int err = 0;
     552           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
     553           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     554           0 :   ulong data_len;
     555           0 :   err = fd_bincode_uint64_decode( &data_len, ctx );
     556           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     557           0 :   if( data_len ) {
     558           0 :     *total_sz += 8UL + data_len;
     559           0 :     err = fd_bincode_bytes_decode_footprint( data_len, ctx );
     560           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     561           0 :   }
     562           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
     563           0 :   if( FD_UNLIKELY( err ) ) return err;
     564           0 :   err = fd_bincode_bool_decode_footprint( ctx );
     565           0 :   if( FD_UNLIKELY( err ) ) return err;
     566           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
     567           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     568           0 :   return 0;
     569           0 : }
     570           0 : int fd_solana_account_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     571           0 :   *total_sz += sizeof(fd_solana_account_t);
     572           0 :   void const * start_data = ctx->data;
     573           0 :   int err = fd_solana_account_decode_footprint_inner( ctx, total_sz );
     574           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     575           0 :   ctx->data = start_data;
     576           0 :   return err;
     577           0 : }
     578           0 : static void fd_solana_account_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     579           0 :   fd_solana_account_t * self = (fd_solana_account_t *)struct_mem;
     580           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
     581           0 :   fd_bincode_uint64_decode_unsafe( &self->data_len, ctx );
     582           0 :   if( self->data_len ) {
     583           0 :     self->data = *alloc_mem;
     584           0 :     fd_bincode_bytes_decode_unsafe( self->data, self->data_len, ctx );
     585           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->data_len;
     586           0 :   } else
     587           0 :     self->data = NULL;
     588           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
     589           0 :   fd_bincode_bool_decode_unsafe( &self->executable, ctx );
     590           0 :   fd_bincode_uint64_decode_unsafe( &self->rent_epoch, ctx );
     591           0 : }
     592           0 : void * fd_solana_account_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     593           0 :   fd_solana_account_t * self = (fd_solana_account_t *)mem;
     594           0 :   fd_solana_account_new( self );
     595           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_solana_account_t);
     596           0 :   void * * alloc_mem = &alloc_region;
     597           0 :   fd_solana_account_decode_inner( mem, alloc_mem, ctx );
     598           0 :   return self;
     599           0 : }
     600           0 : static void fd_solana_account_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     601           0 :   fd_solana_account_global_t * self = (fd_solana_account_global_t *)struct_mem;
     602           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
     603           0 :   fd_bincode_uint64_decode_unsafe( &self->data_len, ctx );
     604           0 :   if( self->data_len ) {
     605           0 :     self->data_offset = (ulong)*alloc_mem - (ulong)struct_mem;
     606           0 :     fd_bincode_bytes_decode_unsafe( *alloc_mem, self->data_len, ctx );
     607           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->data_len;
     608           0 :   } else {
     609           0 :     self->data_offset = 0UL;
     610           0 :   }
     611           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
     612           0 :   fd_bincode_bool_decode_unsafe( &self->executable, ctx );
     613           0 :   fd_bincode_uint64_decode_unsafe( &self->rent_epoch, ctx );
     614           0 : }
     615           0 : void * fd_solana_account_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     616           0 :   fd_solana_account_global_t * self = (fd_solana_account_global_t *)mem;
     617           0 :   fd_solana_account_new( (fd_solana_account_t *)self );
     618           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_solana_account_global_t);
     619           0 :   void * * alloc_mem = &alloc_region;
     620           0 :   fd_solana_account_decode_inner_global( mem, alloc_mem, ctx );
     621           0 :   return self;
     622           0 : }
     623           0 : void fd_solana_account_new(fd_solana_account_t * self) {
     624           0 :   fd_memset( self, 0, sizeof(fd_solana_account_t) );
     625           0 :   fd_pubkey_new( &self->owner );
     626           0 : }
     627           0 : ulong fd_solana_account_size( fd_solana_account_t const * self ) {
     628           0 :   ulong size = 0;
     629           0 :   size += sizeof(ulong);
     630           0 :   do {
     631           0 :     size += sizeof(ulong);
     632           0 :     size += self->data_len;
     633           0 :   } while(0);
     634           0 :   size += fd_pubkey_size( &self->owner );
     635           0 :   size += sizeof(char);
     636           0 :   size += sizeof(ulong);
     637           0 :   return size;
     638           0 : }
     639             : 
     640           0 : ulong fd_solana_account_size_global( fd_solana_account_global_t const * self ) {
     641           0 :   ulong size = 0;
     642           0 :   size += sizeof(ulong);
     643           0 :   do {
     644           0 :     size += sizeof(ulong);
     645           0 :     uchar * data = self->data_offset ? (uchar *)fd_type_pun( (uchar *)self + self->data_offset ) : NULL;
     646           0 :     size += self->data_len;
     647           0 :   } while(0);
     648           0 :   size += fd_pubkey_size( &self->owner );
     649           0 :   size += sizeof(char);
     650           0 :   size += sizeof(ulong);
     651           0 :   return size;
     652           0 : }
     653             : 
     654          12 : int fd_delegation_encode( fd_delegation_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     655          12 :   int err;
     656          12 :   err = fd_pubkey_encode( &self->voter_pubkey, ctx );
     657          12 :   if( FD_UNLIKELY( err ) ) return err;
     658          12 :   err = fd_bincode_uint64_encode( self->stake, ctx );
     659          12 :   if( FD_UNLIKELY( err ) ) return err;
     660          12 :   err = fd_bincode_uint64_encode( self->activation_epoch, ctx );
     661          12 :   if( FD_UNLIKELY( err ) ) return err;
     662          12 :   err = fd_bincode_uint64_encode( self->deactivation_epoch, ctx );
     663          12 :   if( FD_UNLIKELY( err ) ) return err;
     664          12 :   err = fd_bincode_double_encode( self->warmup_cooldown_rate, ctx );
     665          12 :   if( FD_UNLIKELY( err ) ) return err;
     666          12 :   return FD_BINCODE_SUCCESS;
     667          12 : }
     668           0 : static inline int fd_delegation_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     669           0 :   if( (ulong)ctx->data + 64UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     670           0 :   ctx->data = (void *)( (ulong)ctx->data + 64UL );
     671           0 :   return 0;
     672           0 : }
     673           0 : static void fd_delegation_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     674           0 :   fd_delegation_t * self = (fd_delegation_t *)struct_mem;
     675           0 :   fd_pubkey_decode_inner( &self->voter_pubkey, alloc_mem, ctx );
     676           0 :   fd_bincode_uint64_decode_unsafe( &self->stake, ctx );
     677           0 :   fd_bincode_uint64_decode_unsafe( &self->activation_epoch, ctx );
     678           0 :   fd_bincode_uint64_decode_unsafe( &self->deactivation_epoch, ctx );
     679           0 :   fd_bincode_double_decode_unsafe( &self->warmup_cooldown_rate, ctx );
     680           0 : }
     681           0 : void * fd_delegation_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     682           0 :   fd_delegation_t * self = (fd_delegation_t *)mem;
     683           0 :   fd_delegation_new( self );
     684           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_delegation_t);
     685           0 :   void * * alloc_mem = &alloc_region;
     686           0 :   fd_delegation_decode_inner( mem, alloc_mem, ctx );
     687           0 :   return self;
     688           0 : }
     689          12 : int fd_stake_encode( fd_stake_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     690          12 :   int err;
     691          12 :   err = fd_delegation_encode( &self->delegation, ctx );
     692          12 :   if( FD_UNLIKELY( err ) ) return err;
     693          12 :   err = fd_bincode_uint64_encode( self->credits_observed, ctx );
     694          12 :   if( FD_UNLIKELY( err ) ) return err;
     695          12 :   return FD_BINCODE_SUCCESS;
     696          12 : }
     697           0 : static inline int fd_stake_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     698           0 :   if( (ulong)ctx->data + 72UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     699           0 :   ctx->data = (void *)( (ulong)ctx->data + 72UL );
     700           0 :   return 0;
     701           0 : }
     702           0 : static void fd_stake_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     703           0 :   fd_stake_t * self = (fd_stake_t *)struct_mem;
     704           0 :   fd_delegation_decode_inner( &self->delegation, alloc_mem, ctx );
     705           0 :   fd_bincode_uint64_decode_unsafe( &self->credits_observed, ctx );
     706           0 : }
     707           0 : void * fd_stake_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     708           0 :   fd_stake_t * self = (fd_stake_t *)mem;
     709           0 :   fd_stake_new( self );
     710           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_t);
     711           0 :   void * * alloc_mem = &alloc_region;
     712           0 :   fd_stake_decode_inner( mem, alloc_mem, ctx );
     713           0 :   return self;
     714           0 : }
     715           9 : int fd_rust_duration_encode( fd_rust_duration_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     716           9 :   int err;
     717           9 :   err = fd_bincode_uint64_encode( self->seconds, ctx );
     718           9 :   if( FD_UNLIKELY( err ) ) return err;
     719           9 :   err = fd_bincode_uint32_encode( self->nanoseconds, ctx );
     720           9 :   if( FD_UNLIKELY( err ) ) return err;
     721           9 :   return FD_BINCODE_SUCCESS;
     722           9 : }
     723           0 : static inline int fd_rust_duration_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     724           0 :   if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     725           0 :   int err = fd_rust_duration_footprint_validator( ctx );
     726           0 :   if( FD_UNLIKELY( err != FD_BINCODE_SUCCESS ) )
     727           0 :     return err;
     728           0 :   ctx->data = (void *)( (ulong)ctx->data + 12UL );
     729           0 :   return 0;
     730           0 : }
     731           0 : static void fd_rust_duration_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     732           0 :   fd_rust_duration_t * self = (fd_rust_duration_t *)struct_mem;
     733           0 :   fd_bincode_uint64_decode_unsafe( &self->seconds, ctx );
     734           0 :   fd_bincode_uint32_decode_unsafe( &self->nanoseconds, ctx );
     735           0 :   fd_rust_duration_normalize( self );
     736           0 : }
     737           0 : void * fd_rust_duration_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     738           0 :   fd_rust_duration_t * self = (fd_rust_duration_t *)mem;
     739           0 :   fd_rust_duration_new( self );
     740           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_rust_duration_t);
     741           0 :   void * * alloc_mem = &alloc_region;
     742           0 :   fd_rust_duration_decode_inner( mem, alloc_mem, ctx );
     743           0 :   return self;
     744           0 : }
     745           9 : int fd_poh_config_encode( fd_poh_config_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     746           9 :   int err;
     747           9 :   err = fd_rust_duration_encode( &self->target_tick_duration, ctx );
     748           9 :   if( FD_UNLIKELY( err ) ) return err;
     749           9 :   err = fd_bincode_bool_encode( self->has_target_tick_count, ctx );
     750           9 :   if( FD_UNLIKELY( err ) ) return err;
     751           9 :   if( self->has_target_tick_count ) {
     752           0 :     err = fd_bincode_uint64_encode( self->target_tick_count, ctx );
     753           0 :     if( FD_UNLIKELY( err ) ) return err;
     754           0 :   }
     755           9 :   err = fd_bincode_bool_encode( self->has_hashes_per_tick, ctx );
     756           9 :   if( FD_UNLIKELY( err ) ) return err;
     757           9 :   if( self->has_hashes_per_tick ) {
     758           0 :     err = fd_bincode_uint64_encode( self->hashes_per_tick, ctx );
     759           0 :     if( FD_UNLIKELY( err ) ) return err;
     760           0 :   }
     761           9 :   return FD_BINCODE_SUCCESS;
     762           9 : }
     763           0 : int fd_poh_config_encode_global( fd_poh_config_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     764           0 :   int err;
     765           0 :   err = fd_rust_duration_encode( &self->target_tick_duration, ctx );
     766           0 :   if( FD_UNLIKELY( err ) ) return err;
     767           0 :   err = fd_bincode_bool_encode( self->has_target_tick_count, ctx );
     768           0 :   if( FD_UNLIKELY( err ) ) return err;
     769           0 :   if( self->has_target_tick_count ) {
     770           0 :     err = fd_bincode_uint64_encode( self->target_tick_count, ctx );
     771           0 :     if( FD_UNLIKELY( err ) ) return err;
     772           0 :   }
     773           0 :   err = fd_bincode_bool_encode( self->has_hashes_per_tick, ctx );
     774           0 :   if( FD_UNLIKELY( err ) ) return err;
     775           0 :   if( self->has_hashes_per_tick ) {
     776           0 :     err = fd_bincode_uint64_encode( self->hashes_per_tick, ctx );
     777           0 :     if( FD_UNLIKELY( err ) ) return err;
     778           0 :   }
     779           0 :   return FD_BINCODE_SUCCESS;
     780           0 : }
     781           0 : static int fd_poh_config_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     782           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     783           0 :   int err = 0;
     784           0 :   err = fd_rust_duration_decode_footprint_inner( ctx, total_sz );
     785           0 :   if( FD_UNLIKELY( err ) ) return err;
     786           0 :   {
     787           0 :     uchar o;
     788           0 :     err = fd_bincode_bool_decode( &o, ctx );
     789           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     790           0 :     if( o ) {
     791           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
     792           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     793           0 :     }
     794           0 :   }
     795           0 :   {
     796           0 :     uchar o;
     797           0 :     err = fd_bincode_bool_decode( &o, ctx );
     798           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     799           0 :     if( o ) {
     800           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
     801           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     802           0 :     }
     803           0 :   }
     804           0 :   return 0;
     805           0 : }
     806           0 : int fd_poh_config_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     807           0 :   *total_sz += sizeof(fd_poh_config_t);
     808           0 :   void const * start_data = ctx->data;
     809           0 :   int err = fd_poh_config_decode_footprint_inner( ctx, total_sz );
     810           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     811           0 :   ctx->data = start_data;
     812           0 :   return err;
     813           0 : }
     814           0 : static void fd_poh_config_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     815           0 :   fd_poh_config_t * self = (fd_poh_config_t *)struct_mem;
     816           0 :   fd_rust_duration_decode_inner( &self->target_tick_duration, alloc_mem, ctx );
     817           0 :   {
     818           0 :     uchar o;
     819           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
     820           0 :     self->has_target_tick_count = !!o;
     821           0 :     if( o ) {
     822           0 :       fd_bincode_uint64_decode_unsafe( &self->target_tick_count, ctx );
     823           0 :     }
     824           0 :   }
     825           0 :   {
     826           0 :     uchar o;
     827           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
     828           0 :     self->has_hashes_per_tick = !!o;
     829           0 :     if( o ) {
     830           0 :       fd_bincode_uint64_decode_unsafe( &self->hashes_per_tick, ctx );
     831           0 :     }
     832           0 :   }
     833           0 : }
     834           0 : void * fd_poh_config_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     835           0 :   fd_poh_config_t * self = (fd_poh_config_t *)mem;
     836           0 :   fd_poh_config_new( self );
     837           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_poh_config_t);
     838           0 :   void * * alloc_mem = &alloc_region;
     839           0 :   fd_poh_config_decode_inner( mem, alloc_mem, ctx );
     840           0 :   return self;
     841           0 : }
     842           0 : static void fd_poh_config_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     843           0 :   fd_poh_config_global_t * self = (fd_poh_config_global_t *)struct_mem;
     844           0 :   fd_rust_duration_decode_inner( &self->target_tick_duration, alloc_mem, ctx );
     845           0 :   {
     846           0 :     uchar o;
     847           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
     848           0 :     self->has_target_tick_count = !!o;
     849           0 :     if( o ) {
     850           0 :       fd_bincode_uint64_decode_unsafe( &self->target_tick_count, ctx );
     851           0 :     }
     852           0 :   }
     853           0 :   {
     854           0 :     uchar o;
     855           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
     856           0 :     self->has_hashes_per_tick = !!o;
     857           0 :     if( o ) {
     858           0 :       fd_bincode_uint64_decode_unsafe( &self->hashes_per_tick, ctx );
     859           0 :     }
     860           0 :   }
     861           0 : }
     862           0 : void * fd_poh_config_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     863           0 :   fd_poh_config_global_t * self = (fd_poh_config_global_t *)mem;
     864           0 :   fd_poh_config_new( (fd_poh_config_t *)self );
     865           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_poh_config_global_t);
     866           0 :   void * * alloc_mem = &alloc_region;
     867           0 :   fd_poh_config_decode_inner_global( mem, alloc_mem, ctx );
     868           0 :   return self;
     869           0 : }
     870          12 : void fd_poh_config_new(fd_poh_config_t * self) {
     871          12 :   fd_memset( self, 0, sizeof(fd_poh_config_t) );
     872          12 :   fd_rust_duration_new( &self->target_tick_duration );
     873          12 : }
     874           0 : ulong fd_poh_config_size( fd_poh_config_t const * self ) {
     875           0 :   ulong size = 0;
     876           0 :   size += fd_rust_duration_size( &self->target_tick_duration );
     877           0 :   size += sizeof(char);
     878           0 :   if( self->has_target_tick_count ) {
     879           0 :     size += sizeof(ulong);
     880           0 :   }
     881           0 :   size += sizeof(char);
     882           0 :   if( self->has_hashes_per_tick ) {
     883           0 :     size += sizeof(ulong);
     884           0 :   }
     885           0 :   return size;
     886           0 : }
     887             : 
     888           0 : ulong fd_poh_config_size_global( fd_poh_config_global_t const * self ) {
     889           0 :   ulong size = 0;
     890           0 :   size += fd_rust_duration_size( &self->target_tick_duration );
     891           0 :   size += sizeof(char);
     892           0 :   if( self->has_target_tick_count ) {
     893           0 :     size += sizeof(ulong);
     894           0 :   }
     895           0 :   size += sizeof(char);
     896           0 :   if( self->has_hashes_per_tick ) {
     897           0 :     size += sizeof(ulong);
     898           0 :   }
     899           0 :   return size;
     900           0 : }
     901             : 
     902           0 : int fd_string_pubkey_pair_encode( fd_string_pubkey_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     903           0 :   int err;
     904           0 :   err = fd_bincode_uint64_encode( self->string_len, ctx );
     905           0 :   if( FD_UNLIKELY(err) ) return err;
     906           0 :   if( self->string_len ) {
     907           0 :     err = fd_bincode_bytes_encode( self->string, self->string_len, ctx );
     908           0 :     if( FD_UNLIKELY( err ) ) return err;
     909           0 :   }
     910           0 :   err = fd_pubkey_encode( &self->pubkey, ctx );
     911           0 :   if( FD_UNLIKELY( err ) ) return err;
     912           0 :   return FD_BINCODE_SUCCESS;
     913           0 : }
     914           0 : int fd_string_pubkey_pair_encode_global( fd_string_pubkey_pair_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
     915           0 :   int err;
     916           0 :   err = fd_bincode_uint64_encode( self->string_len, ctx );
     917           0 :   if( FD_UNLIKELY( err ) ) return err;
     918           0 :   if( self->string_len ) {
     919           0 :     uchar * string_laddr = (uchar*)self + self->string_offset;
     920           0 :     err = fd_bincode_bytes_encode( string_laddr, self->string_len, ctx );
     921           0 :     if( FD_UNLIKELY( err ) ) return err;
     922           0 :   }
     923           0 :   err = fd_pubkey_encode( &self->pubkey, ctx );
     924           0 :   if( FD_UNLIKELY( err ) ) return err;
     925           0 :   return FD_BINCODE_SUCCESS;
     926           0 : }
     927           0 : static int fd_string_pubkey_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     928           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     929           0 :   int err = 0;
     930           0 :   ulong string_len;
     931           0 :   err = fd_bincode_uint64_decode( &string_len, ctx );
     932           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     933           0 :   *total_sz += string_len;
     934           0 :   if( string_len ) {
     935           0 :     err = fd_bincode_bytes_decode_footprint( string_len, ctx );
     936           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     937           0 :     err = !fd_utf8_verify( (char const *) ctx->data - string_len, string_len );
     938           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
     939           0 :   }
     940           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
     941           0 :   if( FD_UNLIKELY( err ) ) return err;
     942           0 :   return 0;
     943           0 : }
     944           0 : int fd_string_pubkey_pair_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
     945           0 :   *total_sz += sizeof(fd_string_pubkey_pair_t);
     946           0 :   void const * start_data = ctx->data;
     947           0 :   int err = fd_string_pubkey_pair_decode_footprint_inner( ctx, total_sz );
     948           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
     949           0 :   ctx->data = start_data;
     950           0 :   return err;
     951           0 : }
     952           0 : static void fd_string_pubkey_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     953           0 :   fd_string_pubkey_pair_t * self = (fd_string_pubkey_pair_t *)struct_mem;
     954           0 :   fd_bincode_uint64_decode_unsafe( &self->string_len, ctx );
     955           0 :   if( self->string_len ) {
     956           0 :     self->string = *alloc_mem;
     957           0 :     fd_bincode_bytes_decode_unsafe( self->string, self->string_len, ctx );
     958           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->string_len;
     959           0 :   } else
     960           0 :     self->string = NULL;
     961           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
     962           0 : }
     963           0 : void * fd_string_pubkey_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     964           0 :   fd_string_pubkey_pair_t * self = (fd_string_pubkey_pair_t *)mem;
     965           0 :   fd_string_pubkey_pair_new( self );
     966           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_string_pubkey_pair_t);
     967           0 :   void * * alloc_mem = &alloc_region;
     968           0 :   fd_string_pubkey_pair_decode_inner( mem, alloc_mem, ctx );
     969           0 :   return self;
     970           0 : }
     971           0 : static void fd_string_pubkey_pair_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
     972           0 :   fd_string_pubkey_pair_global_t * self = (fd_string_pubkey_pair_global_t *)struct_mem;
     973           0 :   fd_bincode_uint64_decode_unsafe( &self->string_len, ctx );
     974           0 :   if( self->string_len ) {
     975           0 :     self->string_offset = (ulong)*alloc_mem - (ulong)struct_mem;
     976           0 :     fd_bincode_bytes_decode_unsafe( *alloc_mem, self->string_len, ctx );
     977           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->string_len;
     978           0 :   } else {
     979           0 :     self->string_offset = 0UL;
     980           0 :   }
     981           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
     982           0 : }
     983           0 : void * fd_string_pubkey_pair_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
     984           0 :   fd_string_pubkey_pair_global_t * self = (fd_string_pubkey_pair_global_t *)mem;
     985           0 :   fd_string_pubkey_pair_new( (fd_string_pubkey_pair_t *)self );
     986           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_string_pubkey_pair_global_t);
     987           0 :   void * * alloc_mem = &alloc_region;
     988           0 :   fd_string_pubkey_pair_decode_inner_global( mem, alloc_mem, ctx );
     989           0 :   return self;
     990           0 : }
     991           0 : void fd_string_pubkey_pair_new(fd_string_pubkey_pair_t * self) {
     992           0 :   fd_memset( self, 0, sizeof(fd_string_pubkey_pair_t) );
     993           0 :   fd_pubkey_new( &self->pubkey );
     994           0 : }
     995           0 : ulong fd_string_pubkey_pair_size( fd_string_pubkey_pair_t const * self ) {
     996           0 :   ulong size = 0;
     997           0 :   do {
     998           0 :     size += sizeof(ulong);
     999           0 :     size += self->string_len;
    1000           0 :   } while(0);
    1001           0 :   size += fd_pubkey_size( &self->pubkey );
    1002           0 :   return size;
    1003           0 : }
    1004             : 
    1005           0 : ulong fd_string_pubkey_pair_size_global( fd_string_pubkey_pair_global_t const * self ) {
    1006           0 :   ulong size = 0;
    1007           0 :   do {
    1008           0 :     size += sizeof(ulong);
    1009           0 :     uchar * string = self->string_offset ? (uchar *)fd_type_pun( (uchar *)self + self->string_offset ) : NULL;
    1010           0 :     size += self->string_len;
    1011           0 :   } while(0);
    1012           0 :   size += fd_pubkey_size( &self->pubkey );
    1013           0 :   return size;
    1014           0 : }
    1015             : 
    1016         144 : int fd_pubkey_account_pair_encode( fd_pubkey_account_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1017         144 :   int err;
    1018         144 :   err = fd_pubkey_encode( &self->key, ctx );
    1019         144 :   if( FD_UNLIKELY( err ) ) return err;
    1020         144 :   err = fd_solana_account_encode( &self->account, ctx );
    1021         144 :   if( FD_UNLIKELY( err ) ) return err;
    1022         144 :   return FD_BINCODE_SUCCESS;
    1023         144 : }
    1024           0 : int fd_pubkey_account_pair_encode_global( fd_pubkey_account_pair_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1025           0 :   int err;
    1026           0 :   err = fd_pubkey_encode( &self->key, ctx );
    1027           0 :   if( FD_UNLIKELY( err ) ) return err;
    1028           0 :   err = fd_solana_account_encode_global( &self->account, ctx );
    1029           0 :   if( FD_UNLIKELY( err ) ) return err;
    1030           0 :   return FD_BINCODE_SUCCESS;
    1031           0 : }
    1032           0 : static int fd_pubkey_account_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1033           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1034           0 :   int err = 0;
    1035           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    1036           0 :   if( FD_UNLIKELY( err ) ) return err;
    1037           0 :   err = fd_solana_account_decode_footprint_inner( ctx, total_sz );
    1038           0 :   if( FD_UNLIKELY( err ) ) return err;
    1039           0 :   return 0;
    1040           0 : }
    1041           0 : int fd_pubkey_account_pair_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1042           0 :   *total_sz += sizeof(fd_pubkey_account_pair_t);
    1043           0 :   void const * start_data = ctx->data;
    1044           0 :   int err = fd_pubkey_account_pair_decode_footprint_inner( ctx, total_sz );
    1045           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1046           0 :   ctx->data = start_data;
    1047           0 :   return err;
    1048           0 : }
    1049           0 : static void fd_pubkey_account_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1050           0 :   fd_pubkey_account_pair_t * self = (fd_pubkey_account_pair_t *)struct_mem;
    1051           0 :   fd_pubkey_decode_inner( &self->key, alloc_mem, ctx );
    1052           0 :   fd_solana_account_decode_inner( &self->account, alloc_mem, ctx );
    1053           0 : }
    1054           0 : void * fd_pubkey_account_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1055           0 :   fd_pubkey_account_pair_t * self = (fd_pubkey_account_pair_t *)mem;
    1056           0 :   fd_pubkey_account_pair_new( self );
    1057           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_pubkey_account_pair_t);
    1058           0 :   void * * alloc_mem = &alloc_region;
    1059           0 :   fd_pubkey_account_pair_decode_inner( mem, alloc_mem, ctx );
    1060           0 :   return self;
    1061           0 : }
    1062           0 : static void fd_pubkey_account_pair_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1063           0 :   fd_pubkey_account_pair_global_t * self = (fd_pubkey_account_pair_global_t *)struct_mem;
    1064           0 :   fd_pubkey_decode_inner( &self->key, alloc_mem, ctx );
    1065           0 :   fd_solana_account_decode_inner_global( &self->account, alloc_mem, ctx );
    1066           0 : }
    1067           0 : void * fd_pubkey_account_pair_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1068           0 :   fd_pubkey_account_pair_global_t * self = (fd_pubkey_account_pair_global_t *)mem;
    1069           0 :   fd_pubkey_account_pair_new( (fd_pubkey_account_pair_t *)self );
    1070           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_pubkey_account_pair_global_t);
    1071           0 :   void * * alloc_mem = &alloc_region;
    1072           0 :   fd_pubkey_account_pair_decode_inner_global( mem, alloc_mem, ctx );
    1073           0 :   return self;
    1074           0 : }
    1075           0 : void fd_pubkey_account_pair_new(fd_pubkey_account_pair_t * self) {
    1076           0 :   fd_memset( self, 0, sizeof(fd_pubkey_account_pair_t) );
    1077           0 :   fd_pubkey_new( &self->key );
    1078           0 :   fd_solana_account_new( &self->account );
    1079           0 : }
    1080           0 : ulong fd_pubkey_account_pair_size( fd_pubkey_account_pair_t const * self ) {
    1081           0 :   ulong size = 0;
    1082           0 :   size += fd_pubkey_size( &self->key );
    1083           0 :   size += fd_solana_account_size( &self->account );
    1084           0 :   return size;
    1085           0 : }
    1086             : 
    1087           0 : ulong fd_pubkey_account_pair_size_global( fd_pubkey_account_pair_global_t const * self ) {
    1088           0 :   ulong size = 0;
    1089           0 :   size += fd_pubkey_size( &self->key );
    1090           0 :   size += fd_solana_account_size_global( &self->account );
    1091           0 :   return size;
    1092           0 : }
    1093             : 
    1094          12 : int fd_genesis_solana_encode( fd_genesis_solana_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1095          12 :   int err;
    1096          12 :   err = fd_bincode_uint64_encode( self->creation_time, ctx );
    1097          12 :   if( FD_UNLIKELY( err ) ) return err;
    1098           9 :   err = fd_bincode_uint64_encode( self->accounts_len, ctx );
    1099           9 :   if( FD_UNLIKELY(err) ) return err;
    1100           9 :   if( self->accounts_len ) {
    1101         153 :     for( ulong i=0; i < self->accounts_len; i++ ) {
    1102         144 :       err = fd_pubkey_account_pair_encode( self->accounts + i, ctx );
    1103         144 :       if( FD_UNLIKELY( err ) ) return err;
    1104         144 :     }
    1105           9 :   }
    1106           9 :   err = fd_bincode_uint64_encode( self->native_instruction_processors_len, ctx );
    1107           9 :   if( FD_UNLIKELY(err) ) return err;
    1108           9 :   if( self->native_instruction_processors_len ) {
    1109           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ ) {
    1110           0 :       err = fd_string_pubkey_pair_encode( self->native_instruction_processors + i, ctx );
    1111           0 :       if( FD_UNLIKELY( err ) ) return err;
    1112           0 :     }
    1113           0 :   }
    1114           9 :   err = fd_bincode_uint64_encode( self->rewards_pools_len, ctx );
    1115           9 :   if( FD_UNLIKELY(err) ) return err;
    1116           9 :   if( self->rewards_pools_len ) {
    1117           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ ) {
    1118           0 :       err = fd_pubkey_account_pair_encode( self->rewards_pools + i, ctx );
    1119           0 :       if( FD_UNLIKELY( err ) ) return err;
    1120           0 :     }
    1121           0 :   }
    1122           9 :   err = fd_bincode_uint64_encode( self->ticks_per_slot, ctx );
    1123           9 :   if( FD_UNLIKELY( err ) ) return err;
    1124           9 :   err = fd_bincode_uint64_encode( self->unused, ctx );
    1125           9 :   if( FD_UNLIKELY( err ) ) return err;
    1126           9 :   err = fd_poh_config_encode( &self->poh_config, ctx );
    1127           9 :   if( FD_UNLIKELY( err ) ) return err;
    1128           9 :   err = fd_bincode_uint64_encode( self->__backwards_compat_with_v0_23, ctx );
    1129           9 :   if( FD_UNLIKELY( err ) ) return err;
    1130           9 :   err = fd_fee_rate_governor_encode( &self->fee_rate_governor, ctx );
    1131           9 :   if( FD_UNLIKELY( err ) ) return err;
    1132           9 :   err = fd_rent_encode( &self->rent, ctx );
    1133           9 :   if( FD_UNLIKELY( err ) ) return err;
    1134           9 :   err = fd_inflation_encode( &self->inflation, ctx );
    1135           9 :   if( FD_UNLIKELY( err ) ) return err;
    1136           9 :   err = fd_epoch_schedule_encode( &self->epoch_schedule, ctx );
    1137           9 :   if( FD_UNLIKELY( err ) ) return err;
    1138           9 :   err = fd_bincode_uint32_encode( self->cluster_type, ctx );
    1139           9 :   if( FD_UNLIKELY( err ) ) return err;
    1140           9 :   return FD_BINCODE_SUCCESS;
    1141           9 : }
    1142           0 : int fd_genesis_solana_encode_global( fd_genesis_solana_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1143           0 :   int err;
    1144           0 :   err = fd_bincode_uint64_encode( self->creation_time, ctx );
    1145           0 :   if( FD_UNLIKELY( err ) ) return err;
    1146           0 :   err = fd_bincode_uint64_encode( self->accounts_len, ctx );
    1147           0 :   if( FD_UNLIKELY( err ) ) return err;
    1148           0 :   if( self->accounts_len ) {
    1149           0 :     uchar * accounts_laddr = (uchar*)self + self->accounts_offset;
    1150           0 :     fd_pubkey_account_pair_global_t * accounts = (fd_pubkey_account_pair_global_t *)accounts_laddr;
    1151           0 :     for( ulong i=0; i < self->accounts_len; i++ ) {
    1152           0 :       err = fd_pubkey_account_pair_encode_global( &accounts[i], ctx );
    1153           0 :       if( FD_UNLIKELY( err ) ) return err;
    1154           0 :     }
    1155           0 :   }
    1156           0 :   err = fd_bincode_uint64_encode( self->native_instruction_processors_len, ctx );
    1157           0 :   if( FD_UNLIKELY( err ) ) return err;
    1158           0 :   if( self->native_instruction_processors_len ) {
    1159           0 :     uchar * native_instruction_processors_laddr = (uchar*)self + self->native_instruction_processors_offset;
    1160           0 :     fd_string_pubkey_pair_global_t * native_instruction_processors = (fd_string_pubkey_pair_global_t *)native_instruction_processors_laddr;
    1161           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ ) {
    1162           0 :       err = fd_string_pubkey_pair_encode_global( &native_instruction_processors[i], ctx );
    1163           0 :       if( FD_UNLIKELY( err ) ) return err;
    1164           0 :     }
    1165           0 :   }
    1166           0 :   err = fd_bincode_uint64_encode( self->rewards_pools_len, ctx );
    1167           0 :   if( FD_UNLIKELY( err ) ) return err;
    1168           0 :   if( self->rewards_pools_len ) {
    1169           0 :     uchar * rewards_pools_laddr = (uchar*)self + self->rewards_pools_offset;
    1170           0 :     fd_pubkey_account_pair_global_t * rewards_pools = (fd_pubkey_account_pair_global_t *)rewards_pools_laddr;
    1171           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ ) {
    1172           0 :       err = fd_pubkey_account_pair_encode_global( &rewards_pools[i], ctx );
    1173           0 :       if( FD_UNLIKELY( err ) ) return err;
    1174           0 :     }
    1175           0 :   }
    1176           0 :   err = fd_bincode_uint64_encode( self->ticks_per_slot, ctx );
    1177           0 :   if( FD_UNLIKELY( err ) ) return err;
    1178           0 :   err = fd_bincode_uint64_encode( self->unused, ctx );
    1179           0 :   if( FD_UNLIKELY( err ) ) return err;
    1180           0 :   err = fd_poh_config_encode_global( &self->poh_config, ctx );
    1181           0 :   if( FD_UNLIKELY( err ) ) return err;
    1182           0 :   err = fd_bincode_uint64_encode( self->__backwards_compat_with_v0_23, ctx );
    1183           0 :   if( FD_UNLIKELY( err ) ) return err;
    1184           0 :   err = fd_fee_rate_governor_encode( &self->fee_rate_governor, ctx );
    1185           0 :   if( FD_UNLIKELY( err ) ) return err;
    1186           0 :   err = fd_rent_encode( &self->rent, ctx );
    1187           0 :   if( FD_UNLIKELY( err ) ) return err;
    1188           0 :   err = fd_inflation_encode( &self->inflation, ctx );
    1189           0 :   if( FD_UNLIKELY( err ) ) return err;
    1190           0 :   err = fd_epoch_schedule_encode( &self->epoch_schedule, ctx );
    1191           0 :   if( FD_UNLIKELY( err ) ) return err;
    1192           0 :   err = fd_bincode_uint32_encode( self->cluster_type, ctx );
    1193           0 :   if( FD_UNLIKELY( err ) ) return err;
    1194           0 :   return FD_BINCODE_SUCCESS;
    1195           0 : }
    1196           0 : static int fd_genesis_solana_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1197           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1198           0 :   int err = 0;
    1199           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1200           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1201           0 :   ulong accounts_len;
    1202           0 :   err = fd_bincode_uint64_decode( &accounts_len, ctx );
    1203           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1204           0 :   if( accounts_len ) {
    1205           0 :     *total_sz += FD_PUBKEY_ACCOUNT_PAIR_ALIGN + sizeof(fd_pubkey_account_pair_t)*accounts_len;
    1206           0 :     for( ulong i=0; i < accounts_len; i++ ) {
    1207           0 :       err = fd_pubkey_account_pair_decode_footprint_inner( ctx, total_sz );
    1208           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1209           0 :     }
    1210           0 :   }
    1211           0 :   ulong native_instruction_processors_len;
    1212           0 :   err = fd_bincode_uint64_decode( &native_instruction_processors_len, ctx );
    1213           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1214           0 :   if( native_instruction_processors_len ) {
    1215           0 :     *total_sz += FD_STRING_PUBKEY_PAIR_ALIGN + sizeof(fd_string_pubkey_pair_t)*native_instruction_processors_len;
    1216           0 :     for( ulong i=0; i < native_instruction_processors_len; i++ ) {
    1217           0 :       err = fd_string_pubkey_pair_decode_footprint_inner( ctx, total_sz );
    1218           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1219           0 :     }
    1220           0 :   }
    1221           0 :   ulong rewards_pools_len;
    1222           0 :   err = fd_bincode_uint64_decode( &rewards_pools_len, ctx );
    1223           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1224           0 :   if( rewards_pools_len ) {
    1225           0 :     *total_sz += FD_PUBKEY_ACCOUNT_PAIR_ALIGN + sizeof(fd_pubkey_account_pair_t)*rewards_pools_len;
    1226           0 :     for( ulong i=0; i < rewards_pools_len; i++ ) {
    1227           0 :       err = fd_pubkey_account_pair_decode_footprint_inner( ctx, total_sz );
    1228           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1229           0 :     }
    1230           0 :   }
    1231           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1232           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1233           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1234           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1235           0 :   err = fd_poh_config_decode_footprint_inner( ctx, total_sz );
    1236           0 :   if( FD_UNLIKELY( err ) ) return err;
    1237           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1238           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1239           0 :   err = fd_fee_rate_governor_decode_footprint_inner( ctx, total_sz );
    1240           0 :   if( FD_UNLIKELY( err ) ) return err;
    1241           0 :   err = fd_rent_decode_footprint_inner( ctx, total_sz );
    1242           0 :   if( FD_UNLIKELY( err ) ) return err;
    1243           0 :   err = fd_inflation_decode_footprint_inner( ctx, total_sz );
    1244           0 :   if( FD_UNLIKELY( err ) ) return err;
    1245           0 :   err = fd_epoch_schedule_decode_footprint_inner( ctx, total_sz );
    1246           0 :   if( FD_UNLIKELY( err ) ) return err;
    1247           0 :   err = fd_bincode_uint32_decode_footprint( ctx );
    1248           0 :   if( FD_UNLIKELY( err ) ) return err;
    1249           0 :   return 0;
    1250           0 : }
    1251           0 : int fd_genesis_solana_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1252           0 :   *total_sz += sizeof(fd_genesis_solana_t);
    1253           0 :   void const * start_data = ctx->data;
    1254           0 :   int err = fd_genesis_solana_decode_footprint_inner( ctx, total_sz );
    1255           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1256           0 :   ctx->data = start_data;
    1257           0 :   return err;
    1258           0 : }
    1259           0 : static void fd_genesis_solana_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1260           0 :   fd_genesis_solana_t * self = (fd_genesis_solana_t *)struct_mem;
    1261           0 :   fd_bincode_uint64_decode_unsafe( &self->creation_time, ctx );
    1262           0 :   fd_bincode_uint64_decode_unsafe( &self->accounts_len, ctx );
    1263           0 :   if( self->accounts_len ) {
    1264           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_PUBKEY_ACCOUNT_PAIR_ALIGN );
    1265           0 :     self->accounts = *alloc_mem;
    1266           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_pubkey_account_pair_t)*self->accounts_len;
    1267           0 :     for( ulong i=0; i < self->accounts_len; i++ ) {
    1268           0 :       fd_pubkey_account_pair_new( self->accounts + i );
    1269           0 :       fd_pubkey_account_pair_decode_inner( self->accounts + i, alloc_mem, ctx );
    1270           0 :     }
    1271           0 :   } else
    1272           0 :     self->accounts = NULL;
    1273           0 :   fd_bincode_uint64_decode_unsafe( &self->native_instruction_processors_len, ctx );
    1274           0 :   if( self->native_instruction_processors_len ) {
    1275           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_STRING_PUBKEY_PAIR_ALIGN );
    1276           0 :     self->native_instruction_processors = *alloc_mem;
    1277           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_string_pubkey_pair_t)*self->native_instruction_processors_len;
    1278           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ ) {
    1279           0 :       fd_string_pubkey_pair_new( self->native_instruction_processors + i );
    1280           0 :       fd_string_pubkey_pair_decode_inner( self->native_instruction_processors + i, alloc_mem, ctx );
    1281           0 :     }
    1282           0 :   } else
    1283           0 :     self->native_instruction_processors = NULL;
    1284           0 :   fd_bincode_uint64_decode_unsafe( &self->rewards_pools_len, ctx );
    1285           0 :   if( self->rewards_pools_len ) {
    1286           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_PUBKEY_ACCOUNT_PAIR_ALIGN );
    1287           0 :     self->rewards_pools = *alloc_mem;
    1288           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_pubkey_account_pair_t)*self->rewards_pools_len;
    1289           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ ) {
    1290           0 :       fd_pubkey_account_pair_new( self->rewards_pools + i );
    1291           0 :       fd_pubkey_account_pair_decode_inner( self->rewards_pools + i, alloc_mem, ctx );
    1292           0 :     }
    1293           0 :   } else
    1294           0 :     self->rewards_pools = NULL;
    1295           0 :   fd_bincode_uint64_decode_unsafe( &self->ticks_per_slot, ctx );
    1296           0 :   fd_bincode_uint64_decode_unsafe( &self->unused, ctx );
    1297           0 :   fd_poh_config_decode_inner( &self->poh_config, alloc_mem, ctx );
    1298           0 :   fd_bincode_uint64_decode_unsafe( &self->__backwards_compat_with_v0_23, ctx );
    1299           0 :   fd_fee_rate_governor_decode_inner( &self->fee_rate_governor, alloc_mem, ctx );
    1300           0 :   fd_rent_decode_inner( &self->rent, alloc_mem, ctx );
    1301           0 :   fd_inflation_decode_inner( &self->inflation, alloc_mem, ctx );
    1302           0 :   fd_epoch_schedule_decode_inner( &self->epoch_schedule, alloc_mem, ctx );
    1303           0 :   fd_bincode_uint32_decode_unsafe( &self->cluster_type, ctx );
    1304           0 : }
    1305           0 : void * fd_genesis_solana_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1306           0 :   fd_genesis_solana_t * self = (fd_genesis_solana_t *)mem;
    1307           0 :   fd_genesis_solana_new( self );
    1308           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_genesis_solana_t);
    1309           0 :   void * * alloc_mem = &alloc_region;
    1310           0 :   fd_genesis_solana_decode_inner( mem, alloc_mem, ctx );
    1311           0 :   return self;
    1312           0 : }
    1313           0 : static void fd_genesis_solana_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1314           0 :   fd_genesis_solana_global_t * self = (fd_genesis_solana_global_t *)struct_mem;
    1315           0 :   fd_bincode_uint64_decode_unsafe( &self->creation_time, ctx );
    1316           0 :   fd_bincode_uint64_decode_unsafe( &self->accounts_len, ctx );
    1317           0 :   if( self->accounts_len ) {
    1318           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_PUBKEY_ACCOUNT_PAIR_ALIGN );
    1319           0 :     self->accounts_offset = (ulong)*alloc_mem - (ulong)struct_mem;
    1320           0 :     uchar * cur_mem = (uchar *)(*alloc_mem);
    1321           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_pubkey_account_pair_t)*self->accounts_len;
    1322           0 :     for( ulong i=0; i < self->accounts_len; i++ ) {
    1323           0 :       fd_pubkey_account_pair_new( (fd_pubkey_account_pair_t *)fd_type_pun(cur_mem + sizeof(fd_pubkey_account_pair_t) * i) );
    1324           0 :       fd_pubkey_account_pair_decode_inner_global( cur_mem + sizeof(fd_pubkey_account_pair_t) * i, alloc_mem, ctx );
    1325           0 :     }
    1326           0 :   } else {
    1327           0 :     self->accounts_offset = 0UL;
    1328           0 :   }
    1329           0 :   fd_bincode_uint64_decode_unsafe( &self->native_instruction_processors_len, ctx );
    1330           0 :   if( self->native_instruction_processors_len ) {
    1331           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_STRING_PUBKEY_PAIR_ALIGN );
    1332           0 :     self->native_instruction_processors_offset = (ulong)*alloc_mem - (ulong)struct_mem;
    1333           0 :     uchar * cur_mem = (uchar *)(*alloc_mem);
    1334           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_string_pubkey_pair_t)*self->native_instruction_processors_len;
    1335           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ ) {
    1336           0 :       fd_string_pubkey_pair_new( (fd_string_pubkey_pair_t *)fd_type_pun(cur_mem + sizeof(fd_string_pubkey_pair_t) * i) );
    1337           0 :       fd_string_pubkey_pair_decode_inner_global( cur_mem + sizeof(fd_string_pubkey_pair_t) * i, alloc_mem, ctx );
    1338           0 :     }
    1339           0 :   } else {
    1340           0 :     self->native_instruction_processors_offset = 0UL;
    1341           0 :   }
    1342           0 :   fd_bincode_uint64_decode_unsafe( &self->rewards_pools_len, ctx );
    1343           0 :   if( self->rewards_pools_len ) {
    1344           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_PUBKEY_ACCOUNT_PAIR_ALIGN );
    1345           0 :     self->rewards_pools_offset = (ulong)*alloc_mem - (ulong)struct_mem;
    1346           0 :     uchar * cur_mem = (uchar *)(*alloc_mem);
    1347           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_pubkey_account_pair_t)*self->rewards_pools_len;
    1348           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ ) {
    1349           0 :       fd_pubkey_account_pair_new( (fd_pubkey_account_pair_t *)fd_type_pun(cur_mem + sizeof(fd_pubkey_account_pair_t) * i) );
    1350           0 :       fd_pubkey_account_pair_decode_inner_global( cur_mem + sizeof(fd_pubkey_account_pair_t) * i, alloc_mem, ctx );
    1351           0 :     }
    1352           0 :   } else {
    1353           0 :     self->rewards_pools_offset = 0UL;
    1354           0 :   }
    1355           0 :   fd_bincode_uint64_decode_unsafe( &self->ticks_per_slot, ctx );
    1356           0 :   fd_bincode_uint64_decode_unsafe( &self->unused, ctx );
    1357           0 :   fd_poh_config_decode_inner_global( &self->poh_config, alloc_mem, ctx );
    1358           0 :   fd_bincode_uint64_decode_unsafe( &self->__backwards_compat_with_v0_23, ctx );
    1359           0 :   fd_fee_rate_governor_decode_inner( &self->fee_rate_governor, alloc_mem, ctx );
    1360           0 :   fd_rent_decode_inner( &self->rent, alloc_mem, ctx );
    1361           0 :   fd_inflation_decode_inner( &self->inflation, alloc_mem, ctx );
    1362           0 :   fd_epoch_schedule_decode_inner( &self->epoch_schedule, alloc_mem, ctx );
    1363           0 :   fd_bincode_uint32_decode_unsafe( &self->cluster_type, ctx );
    1364           0 : }
    1365           0 : void * fd_genesis_solana_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1366           0 :   fd_genesis_solana_global_t * self = (fd_genesis_solana_global_t *)mem;
    1367           0 :   fd_genesis_solana_new( (fd_genesis_solana_t *)self );
    1368           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_genesis_solana_global_t);
    1369           0 :   void * * alloc_mem = &alloc_region;
    1370           0 :   fd_genesis_solana_decode_inner_global( mem, alloc_mem, ctx );
    1371           0 :   return self;
    1372           0 : }
    1373          12 : void fd_genesis_solana_new(fd_genesis_solana_t * self) {
    1374          12 :   fd_memset( self, 0, sizeof(fd_genesis_solana_t) );
    1375          12 :   fd_poh_config_new( &self->poh_config );
    1376          12 :   fd_fee_rate_governor_new( &self->fee_rate_governor );
    1377          12 :   fd_rent_new( &self->rent );
    1378          12 :   fd_inflation_new( &self->inflation );
    1379          12 :   fd_epoch_schedule_new( &self->epoch_schedule );
    1380          12 : }
    1381           0 : ulong fd_genesis_solana_size( fd_genesis_solana_t const * self ) {
    1382           0 :   ulong size = 0;
    1383           0 :   size += sizeof(ulong);
    1384           0 :   do {
    1385           0 :     size += sizeof(ulong);
    1386           0 :     for( ulong i=0; i < self->accounts_len; i++ )
    1387           0 :       size += fd_pubkey_account_pair_size( self->accounts + i );
    1388           0 :   } while(0);
    1389           0 :   do {
    1390           0 :     size += sizeof(ulong);
    1391           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ )
    1392           0 :       size += fd_string_pubkey_pair_size( self->native_instruction_processors + i );
    1393           0 :   } while(0);
    1394           0 :   do {
    1395           0 :     size += sizeof(ulong);
    1396           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ )
    1397           0 :       size += fd_pubkey_account_pair_size( self->rewards_pools + i );
    1398           0 :   } while(0);
    1399           0 :   size += sizeof(ulong);
    1400           0 :   size += sizeof(ulong);
    1401           0 :   size += fd_poh_config_size( &self->poh_config );
    1402           0 :   size += sizeof(ulong);
    1403           0 :   size += fd_fee_rate_governor_size( &self->fee_rate_governor );
    1404           0 :   size += fd_rent_size( &self->rent );
    1405           0 :   size += fd_inflation_size( &self->inflation );
    1406           0 :   size += fd_epoch_schedule_size( &self->epoch_schedule );
    1407           0 :   size += sizeof(uint);
    1408           0 :   return size;
    1409           0 : }
    1410             : 
    1411           0 : ulong fd_genesis_solana_size_global( fd_genesis_solana_global_t const * self ) {
    1412           0 :   ulong size = 0;
    1413           0 :   size += sizeof(ulong);
    1414           0 :   do {
    1415           0 :     size += sizeof(ulong);
    1416           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;
    1417           0 :     for( ulong i=0; i < self->accounts_len; i++ )
    1418           0 :       size += fd_pubkey_account_pair_size_global( accounts + i );
    1419           0 :   } while(0);
    1420           0 :   do {
    1421           0 :     size += sizeof(ulong);
    1422           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;
    1423           0 :     for( ulong i=0; i < self->native_instruction_processors_len; i++ )
    1424           0 :       size += fd_string_pubkey_pair_size_global( native_instruction_processors + i );
    1425           0 :   } while(0);
    1426           0 :   do {
    1427           0 :     size += sizeof(ulong);
    1428           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;
    1429           0 :     for( ulong i=0; i < self->rewards_pools_len; i++ )
    1430           0 :       size += fd_pubkey_account_pair_size_global( rewards_pools + i );
    1431           0 :   } while(0);
    1432           0 :   size += sizeof(ulong);
    1433           0 :   size += sizeof(ulong);
    1434           0 :   size += fd_poh_config_size_global( &self->poh_config );
    1435           0 :   size += sizeof(ulong);
    1436           0 :   size += fd_fee_rate_governor_size( &self->fee_rate_governor );
    1437           0 :   size += fd_rent_size( &self->rent );
    1438           0 :   size += fd_inflation_size( &self->inflation );
    1439           0 :   size += fd_epoch_schedule_size( &self->epoch_schedule );
    1440           0 :   size += sizeof(uint);
    1441           0 :   return size;
    1442           0 : }
    1443             : 
    1444           0 : int fd_sol_sysvar_clock_encode( fd_sol_sysvar_clock_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1445           0 :   int err;
    1446           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    1447           0 :   if( FD_UNLIKELY( err ) ) return err;
    1448           0 :   err = fd_bincode_uint64_encode( (ulong)self->epoch_start_timestamp, ctx );
    1449           0 :   if( FD_UNLIKELY( err ) ) return err;
    1450           0 :   err = fd_bincode_uint64_encode( self->epoch, ctx );
    1451           0 :   if( FD_UNLIKELY( err ) ) return err;
    1452           0 :   err = fd_bincode_uint64_encode( self->leader_schedule_epoch, ctx );
    1453           0 :   if( FD_UNLIKELY( err ) ) return err;
    1454           0 :   err = fd_bincode_uint64_encode( (ulong)self->unix_timestamp, ctx );
    1455           0 :   if( FD_UNLIKELY( err ) ) return err;
    1456           0 :   return FD_BINCODE_SUCCESS;
    1457           0 : }
    1458           0 : static inline int fd_sol_sysvar_clock_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1459           0 :   if( (ulong)ctx->data + 40UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1460           0 :   ctx->data = (void *)( (ulong)ctx->data + 40UL );
    1461           0 :   return 0;
    1462           0 : }
    1463           3 : static void fd_sol_sysvar_clock_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1464           3 :   fd_sol_sysvar_clock_t * self = (fd_sol_sysvar_clock_t *)struct_mem;
    1465           3 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    1466           3 :   fd_bincode_uint64_decode_unsafe( (ulong *) &self->epoch_start_timestamp, ctx );
    1467           3 :   fd_bincode_uint64_decode_unsafe( &self->epoch, ctx );
    1468           3 :   fd_bincode_uint64_decode_unsafe( &self->leader_schedule_epoch, ctx );
    1469           3 :   fd_bincode_uint64_decode_unsafe( (ulong *) &self->unix_timestamp, ctx );
    1470           3 : }
    1471           3 : void * fd_sol_sysvar_clock_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1472           3 :   fd_sol_sysvar_clock_t * self = (fd_sol_sysvar_clock_t *)mem;
    1473           3 :   fd_sol_sysvar_clock_new( self );
    1474           3 :   void * alloc_region = (uchar *)mem + sizeof(fd_sol_sysvar_clock_t);
    1475           3 :   void * * alloc_mem = &alloc_region;
    1476           3 :   fd_sol_sysvar_clock_decode_inner( mem, alloc_mem, ctx );
    1477           3 :   return self;
    1478           3 : }
    1479           0 : int fd_sol_sysvar_last_restart_slot_encode( fd_sol_sysvar_last_restart_slot_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1480           0 :   int err;
    1481           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    1482           0 :   if( FD_UNLIKELY( err ) ) return err;
    1483           0 :   return FD_BINCODE_SUCCESS;
    1484           0 : }
    1485           0 : static inline int fd_sol_sysvar_last_restart_slot_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1486           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1487           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
    1488           0 :   return 0;
    1489           0 : }
    1490           0 : static void fd_sol_sysvar_last_restart_slot_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1491           0 :   fd_sol_sysvar_last_restart_slot_t * self = (fd_sol_sysvar_last_restart_slot_t *)struct_mem;
    1492           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    1493           0 : }
    1494           0 : void * fd_sol_sysvar_last_restart_slot_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1495           0 :   fd_sol_sysvar_last_restart_slot_t * self = (fd_sol_sysvar_last_restart_slot_t *)mem;
    1496           0 :   fd_sol_sysvar_last_restart_slot_new( self );
    1497           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_sol_sysvar_last_restart_slot_t);
    1498           0 :   void * * alloc_mem = &alloc_region;
    1499           0 :   fd_sol_sysvar_last_restart_slot_decode_inner( mem, alloc_mem, ctx );
    1500           0 :   return self;
    1501           0 : }
    1502           0 : int fd_vote_lockout_encode( fd_vote_lockout_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1503           0 :   int err;
    1504           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    1505           0 :   if( FD_UNLIKELY( err ) ) return err;
    1506           0 :   err = fd_bincode_uint32_encode( self->confirmation_count, ctx );
    1507           0 :   if( FD_UNLIKELY( err ) ) return err;
    1508           0 :   return FD_BINCODE_SUCCESS;
    1509           0 : }
    1510           0 : static inline int fd_vote_lockout_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1511           0 :   if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1512           0 :   ctx->data = (void *)( (ulong)ctx->data + 12UL );
    1513           0 :   return 0;
    1514           0 : }
    1515           0 : static void fd_vote_lockout_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1516           0 :   fd_vote_lockout_t * self = (fd_vote_lockout_t *)struct_mem;
    1517           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    1518           0 :   fd_bincode_uint32_decode_unsafe( &self->confirmation_count, ctx );
    1519           0 : }
    1520           0 : void * fd_vote_lockout_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1521           0 :   fd_vote_lockout_t * self = (fd_vote_lockout_t *)mem;
    1522           0 :   fd_vote_lockout_new( self );
    1523           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_lockout_t);
    1524           0 :   void * * alloc_mem = &alloc_region;
    1525           0 :   fd_vote_lockout_decode_inner( mem, alloc_mem, ctx );
    1526           0 :   return self;
    1527           0 : }
    1528           0 : int fd_lockout_offset_encode( fd_lockout_offset_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1529           0 :   int err;
    1530           0 :   err = fd_bincode_varint_encode( self->offset, ctx );
    1531           0 :   if( FD_UNLIKELY( err ) ) return err;
    1532           0 :   err = fd_bincode_uint8_encode( (uchar)(self->confirmation_count), ctx );
    1533           0 :   if( FD_UNLIKELY( err ) ) return err;
    1534           0 :   return FD_BINCODE_SUCCESS;
    1535           0 : }
    1536           0 : static int fd_lockout_offset_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1537           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1538           0 :   int err = 0;
    1539           0 :   err = fd_bincode_varint_decode_footprint( ctx );
    1540           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1541           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    1542           0 :   if( FD_UNLIKELY( err ) ) return err;
    1543           0 :   return 0;
    1544           0 : }
    1545           0 : int fd_lockout_offset_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1546           0 :   *total_sz += sizeof(fd_lockout_offset_t);
    1547           0 :   void const * start_data = ctx->data;
    1548           0 :   int err = fd_lockout_offset_decode_footprint_inner( ctx, total_sz );
    1549           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1550           0 :   ctx->data = start_data;
    1551           0 :   return err;
    1552           0 : }
    1553           0 : static void fd_lockout_offset_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1554           0 :   fd_lockout_offset_t * self = (fd_lockout_offset_t *)struct_mem;
    1555           0 :   fd_bincode_varint_decode_unsafe( &self->offset, ctx );
    1556           0 :   fd_bincode_uint8_decode_unsafe( &self->confirmation_count, ctx );
    1557           0 : }
    1558           0 : void * fd_lockout_offset_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1559           0 :   fd_lockout_offset_t * self = (fd_lockout_offset_t *)mem;
    1560           0 :   fd_lockout_offset_new( self );
    1561           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_lockout_offset_t);
    1562           0 :   void * * alloc_mem = &alloc_region;
    1563           0 :   fd_lockout_offset_decode_inner( mem, alloc_mem, ctx );
    1564           0 :   return self;
    1565           0 : }
    1566           0 : void fd_lockout_offset_new(fd_lockout_offset_t * self) {
    1567           0 :   fd_memset( self, 0, sizeof(fd_lockout_offset_t) );
    1568           0 : }
    1569           0 : ulong fd_lockout_offset_size( fd_lockout_offset_t const * self ) {
    1570           0 :   ulong size = 0;
    1571           0 :   size += fd_bincode_varint_size( self->offset );
    1572           0 :   size += sizeof(char);
    1573           0 :   return size;
    1574           0 : }
    1575             : 
    1576          12 : int fd_vote_authorized_voter_encode( fd_vote_authorized_voter_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1577          12 :   int err;
    1578          12 :   err = fd_bincode_uint64_encode( self->epoch, ctx );
    1579          12 :   if( FD_UNLIKELY( err ) ) return err;
    1580          12 :   err = fd_pubkey_encode( &self->pubkey, ctx );
    1581          12 :   if( FD_UNLIKELY( err ) ) return err;
    1582          12 :   return FD_BINCODE_SUCCESS;
    1583          12 : }
    1584           0 : static inline int fd_vote_authorized_voter_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1585           0 :   if( (ulong)ctx->data + 40UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1586           0 :   ctx->data = (void *)( (ulong)ctx->data + 40UL );
    1587           0 :   return 0;
    1588           0 : }
    1589           0 : static void fd_vote_authorized_voter_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1590           0 :   fd_vote_authorized_voter_t * self = (fd_vote_authorized_voter_t *)struct_mem;
    1591           0 :   fd_bincode_uint64_decode_unsafe( &self->epoch, ctx );
    1592           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
    1593           0 : }
    1594           0 : void * fd_vote_authorized_voter_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1595           0 :   fd_vote_authorized_voter_t * self = (fd_vote_authorized_voter_t *)mem;
    1596           0 :   fd_vote_authorized_voter_new( self );
    1597           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorized_voter_t);
    1598           0 :   void * * alloc_mem = &alloc_region;
    1599           0 :   fd_vote_authorized_voter_decode_inner( mem, alloc_mem, ctx );
    1600           0 :   return self;
    1601           0 : }
    1602         384 : int fd_vote_prior_voter_encode( fd_vote_prior_voter_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1603         384 :   int err;
    1604         384 :   err = fd_pubkey_encode( &self->pubkey, ctx );
    1605         384 :   if( FD_UNLIKELY( err ) ) return err;
    1606         384 :   err = fd_bincode_uint64_encode( self->epoch_start, ctx );
    1607         384 :   if( FD_UNLIKELY( err ) ) return err;
    1608         384 :   err = fd_bincode_uint64_encode( self->epoch_end, ctx );
    1609         384 :   if( FD_UNLIKELY( err ) ) return err;
    1610         384 :   return FD_BINCODE_SUCCESS;
    1611         384 : }
    1612           0 : static inline int fd_vote_prior_voter_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1613           0 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1614           0 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
    1615           0 :   return 0;
    1616           0 : }
    1617           0 : static void fd_vote_prior_voter_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1618           0 :   fd_vote_prior_voter_t * self = (fd_vote_prior_voter_t *)struct_mem;
    1619           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
    1620           0 :   fd_bincode_uint64_decode_unsafe( &self->epoch_start, ctx );
    1621           0 :   fd_bincode_uint64_decode_unsafe( &self->epoch_end, ctx );
    1622           0 : }
    1623           0 : void * fd_vote_prior_voter_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1624           0 :   fd_vote_prior_voter_t * self = (fd_vote_prior_voter_t *)mem;
    1625           0 :   fd_vote_prior_voter_new( self );
    1626           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_prior_voter_t);
    1627           0 :   void * * alloc_mem = &alloc_region;
    1628           0 :   fd_vote_prior_voter_decode_inner( mem, alloc_mem, ctx );
    1629           0 :   return self;
    1630           0 : }
    1631           0 : int fd_vote_prior_voter_0_23_5_encode( fd_vote_prior_voter_0_23_5_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1632           0 :   int err;
    1633           0 :   err = fd_pubkey_encode( &self->pubkey, ctx );
    1634           0 :   if( FD_UNLIKELY( err ) ) return err;
    1635           0 :   err = fd_bincode_uint64_encode( self->epoch_start, ctx );
    1636           0 :   if( FD_UNLIKELY( err ) ) return err;
    1637           0 :   err = fd_bincode_uint64_encode( self->epoch_end, ctx );
    1638           0 :   if( FD_UNLIKELY( err ) ) return err;
    1639           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    1640           0 :   if( FD_UNLIKELY( err ) ) return err;
    1641           0 :   return FD_BINCODE_SUCCESS;
    1642           0 : }
    1643           0 : static inline int fd_vote_prior_voter_0_23_5_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1644           0 :   if( (ulong)ctx->data + 56UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1645           0 :   ctx->data = (void *)( (ulong)ctx->data + 56UL );
    1646           0 :   return 0;
    1647           0 : }
    1648           0 : static void fd_vote_prior_voter_0_23_5_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1649           0 :   fd_vote_prior_voter_0_23_5_t * self = (fd_vote_prior_voter_0_23_5_t *)struct_mem;
    1650           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
    1651           0 :   fd_bincode_uint64_decode_unsafe( &self->epoch_start, ctx );
    1652           0 :   fd_bincode_uint64_decode_unsafe( &self->epoch_end, ctx );
    1653           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    1654           0 : }
    1655           0 : void * fd_vote_prior_voter_0_23_5_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1656           0 :   fd_vote_prior_voter_0_23_5_t * self = (fd_vote_prior_voter_0_23_5_t *)mem;
    1657           0 :   fd_vote_prior_voter_0_23_5_new( self );
    1658           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_prior_voter_0_23_5_t);
    1659           0 :   void * * alloc_mem = &alloc_region;
    1660           0 :   fd_vote_prior_voter_0_23_5_decode_inner( mem, alloc_mem, ctx );
    1661           0 :   return self;
    1662           0 : }
    1663           0 : int fd_vote_epoch_credits_encode( fd_vote_epoch_credits_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1664           0 :   int err;
    1665           0 :   err = fd_bincode_uint64_encode( self->epoch, ctx );
    1666           0 :   if( FD_UNLIKELY( err ) ) return err;
    1667           0 :   err = fd_bincode_uint64_encode( self->credits, ctx );
    1668           0 :   if( FD_UNLIKELY( err ) ) return err;
    1669           0 :   err = fd_bincode_uint64_encode( self->prev_credits, ctx );
    1670           0 :   if( FD_UNLIKELY( err ) ) return err;
    1671           0 :   return FD_BINCODE_SUCCESS;
    1672           0 : }
    1673           0 : static inline int fd_vote_epoch_credits_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1674           0 :   if( (ulong)ctx->data + 24UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1675           0 :   ctx->data = (void *)( (ulong)ctx->data + 24UL );
    1676           0 :   return 0;
    1677           0 : }
    1678           0 : static void fd_vote_epoch_credits_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1679           0 :   fd_vote_epoch_credits_t * self = (fd_vote_epoch_credits_t *)struct_mem;
    1680           0 :   fd_bincode_uint64_decode_unsafe( &self->epoch, ctx );
    1681           0 :   fd_bincode_uint64_decode_unsafe( &self->credits, ctx );
    1682           0 :   fd_bincode_uint64_decode_unsafe( &self->prev_credits, ctx );
    1683           0 : }
    1684           0 : void * fd_vote_epoch_credits_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1685           0 :   fd_vote_epoch_credits_t * self = (fd_vote_epoch_credits_t *)mem;
    1686           0 :   fd_vote_epoch_credits_new( self );
    1687           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_epoch_credits_t);
    1688           0 :   void * * alloc_mem = &alloc_region;
    1689           0 :   fd_vote_epoch_credits_decode_inner( mem, alloc_mem, ctx );
    1690           0 :   return self;
    1691           0 : }
    1692          12 : int fd_vote_block_timestamp_encode( fd_vote_block_timestamp_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1693          12 :   int err;
    1694          12 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    1695          12 :   if( FD_UNLIKELY( err ) ) return err;
    1696          12 :   err = fd_bincode_uint64_encode( (ulong)self->timestamp, ctx );
    1697          12 :   if( FD_UNLIKELY( err ) ) return err;
    1698          12 :   return FD_BINCODE_SUCCESS;
    1699          12 : }
    1700           0 : static inline int fd_vote_block_timestamp_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1701           0 :   if( (ulong)ctx->data + 16UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1702           0 :   ctx->data = (void *)( (ulong)ctx->data + 16UL );
    1703           0 :   return 0;
    1704           0 : }
    1705           0 : static void fd_vote_block_timestamp_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1706           0 :   fd_vote_block_timestamp_t * self = (fd_vote_block_timestamp_t *)struct_mem;
    1707           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    1708           0 :   fd_bincode_uint64_decode_unsafe( (ulong *) &self->timestamp, ctx );
    1709           0 : }
    1710           0 : void * fd_vote_block_timestamp_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1711           0 :   fd_vote_block_timestamp_t * self = (fd_vote_block_timestamp_t *)mem;
    1712           0 :   fd_vote_block_timestamp_new( self );
    1713           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_block_timestamp_t);
    1714           0 :   void * * alloc_mem = &alloc_region;
    1715           0 :   fd_vote_block_timestamp_decode_inner( mem, alloc_mem, ctx );
    1716           0 :   return self;
    1717           0 : }
    1718          12 : int fd_vote_prior_voters_encode( fd_vote_prior_voters_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1719          12 :   int err;
    1720         396 :   for( ulong i=0; i<32; i++ ) {
    1721         384 :     err = fd_vote_prior_voter_encode( self->buf + i, ctx );
    1722         384 :     if( FD_UNLIKELY( err ) ) return err;
    1723         384 :   }
    1724          12 :   err = fd_bincode_uint64_encode( self->idx, ctx );
    1725          12 :   if( FD_UNLIKELY( err ) ) return err;
    1726          12 :   err = fd_bincode_bool_encode( (uchar)(self->is_empty), ctx );
    1727          12 :   if( FD_UNLIKELY( err ) ) return err;
    1728          12 :   return FD_BINCODE_SUCCESS;
    1729          12 : }
    1730           0 : static int fd_vote_prior_voters_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1731           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1732           0 :   int err = 0;
    1733           0 :   for( ulong i=0; i<32; i++ ) {
    1734           0 :     err = fd_vote_prior_voter_decode_footprint_inner( ctx, total_sz );
    1735           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1736           0 :   }
    1737           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1738           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1739           0 :   err = fd_bincode_bool_decode_footprint( ctx );
    1740           0 :   if( FD_UNLIKELY( err ) ) return err;
    1741           0 :   return 0;
    1742           0 : }
    1743           0 : int fd_vote_prior_voters_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1744           0 :   *total_sz += sizeof(fd_vote_prior_voters_t);
    1745           0 :   void const * start_data = ctx->data;
    1746           0 :   int err = fd_vote_prior_voters_decode_footprint_inner( ctx, total_sz );
    1747           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1748           0 :   ctx->data = start_data;
    1749           0 :   return err;
    1750           0 : }
    1751           0 : static void fd_vote_prior_voters_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1752           0 :   fd_vote_prior_voters_t * self = (fd_vote_prior_voters_t *)struct_mem;
    1753           0 :   for( ulong i=0; i<32; i++ ) {
    1754           0 :     fd_vote_prior_voter_decode_inner( self->buf + i, alloc_mem, ctx );
    1755           0 :   }
    1756           0 :   fd_bincode_uint64_decode_unsafe( &self->idx, ctx );
    1757           0 :   fd_bincode_bool_decode_unsafe( &self->is_empty, ctx );
    1758           0 : }
    1759           0 : void * fd_vote_prior_voters_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1760           0 :   fd_vote_prior_voters_t * self = (fd_vote_prior_voters_t *)mem;
    1761           0 :   fd_vote_prior_voters_new( self );
    1762           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_prior_voters_t);
    1763           0 :   void * * alloc_mem = &alloc_region;
    1764           0 :   fd_vote_prior_voters_decode_inner( mem, alloc_mem, ctx );
    1765           0 :   return self;
    1766           0 : }
    1767          12 : void fd_vote_prior_voters_new(fd_vote_prior_voters_t * self) {
    1768          12 :   fd_memset( self, 0, sizeof(fd_vote_prior_voters_t) );
    1769         396 :   for( ulong i=0; i<32; i++ )
    1770         384 :     fd_vote_prior_voter_new( self->buf + i );
    1771          12 : }
    1772           0 : int fd_vote_prior_voters_0_23_5_encode( fd_vote_prior_voters_0_23_5_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1773           0 :   int err;
    1774           0 :   for( ulong i=0; i<32; i++ ) {
    1775           0 :     err = fd_vote_prior_voter_0_23_5_encode( self->buf + i, ctx );
    1776           0 :     if( FD_UNLIKELY( err ) ) return err;
    1777           0 :   }
    1778           0 :   err = fd_bincode_uint64_encode( self->idx, ctx );
    1779           0 :   if( FD_UNLIKELY( err ) ) return err;
    1780           0 :   return FD_BINCODE_SUCCESS;
    1781           0 : }
    1782           0 : static inline int fd_vote_prior_voters_0_23_5_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1783           0 :   if( (ulong)ctx->data + 1800UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1784           0 :   ctx->data = (void *)( (ulong)ctx->data + 1800UL );
    1785           0 :   return 0;
    1786           0 : }
    1787           0 : static void fd_vote_prior_voters_0_23_5_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1788           0 :   fd_vote_prior_voters_0_23_5_t * self = (fd_vote_prior_voters_0_23_5_t *)struct_mem;
    1789           0 :   for( ulong i=0; i<32; i++ ) {
    1790           0 :     fd_vote_prior_voter_0_23_5_decode_inner( self->buf + i, alloc_mem, ctx );
    1791           0 :   }
    1792           0 :   fd_bincode_uint64_decode_unsafe( &self->idx, ctx );
    1793           0 : }
    1794           0 : void * fd_vote_prior_voters_0_23_5_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1795           0 :   fd_vote_prior_voters_0_23_5_t * self = (fd_vote_prior_voters_0_23_5_t *)mem;
    1796           0 :   fd_vote_prior_voters_0_23_5_new( self );
    1797           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_prior_voters_0_23_5_t);
    1798           0 :   void * * alloc_mem = &alloc_region;
    1799           0 :   fd_vote_prior_voters_0_23_5_decode_inner( mem, alloc_mem, ctx );
    1800           0 :   return self;
    1801           0 : }
    1802           0 : int fd_landed_vote_encode( fd_landed_vote_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1803           0 :   int err;
    1804           0 :   err = fd_bincode_uint8_encode( (uchar)(self->latency), ctx );
    1805           0 :   if( FD_UNLIKELY( err ) ) return err;
    1806           0 :   err = fd_vote_lockout_encode( &self->lockout, ctx );
    1807           0 :   if( FD_UNLIKELY( err ) ) return err;
    1808           0 :   return FD_BINCODE_SUCCESS;
    1809           0 : }
    1810           0 : static inline int fd_landed_vote_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1811           0 :   if( (ulong)ctx->data + 13UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1812           0 :   ctx->data = (void *)( (ulong)ctx->data + 13UL );
    1813           0 :   return 0;
    1814           0 : }
    1815           0 : static void fd_landed_vote_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1816           0 :   fd_landed_vote_t * self = (fd_landed_vote_t *)struct_mem;
    1817           0 :   fd_bincode_uint8_decode_unsafe( &self->latency, ctx );
    1818           0 :   fd_vote_lockout_decode_inner( &self->lockout, alloc_mem, ctx );
    1819           0 : }
    1820           0 : void * fd_landed_vote_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1821           0 :   fd_landed_vote_t * self = (fd_landed_vote_t *)mem;
    1822           0 :   fd_landed_vote_new( self );
    1823           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_landed_vote_t);
    1824           0 :   void * * alloc_mem = &alloc_region;
    1825           0 :   fd_landed_vote_decode_inner( mem, alloc_mem, ctx );
    1826           0 :   return self;
    1827           0 : }
    1828           0 : int fd_vote_state_0_23_5_encode( fd_vote_state_0_23_5_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    1829           0 :   int err;
    1830           0 :   err = fd_pubkey_encode( &self->node_pubkey, ctx );
    1831           0 :   if( FD_UNLIKELY( err ) ) return err;
    1832           0 :   err = fd_pubkey_encode( &self->authorized_voter, ctx );
    1833           0 :   if( FD_UNLIKELY( err ) ) return err;
    1834           0 :   err = fd_bincode_uint64_encode( self->authorized_voter_epoch, ctx );
    1835           0 :   if( FD_UNLIKELY( err ) ) return err;
    1836           0 :   err = fd_vote_prior_voters_0_23_5_encode( &self->prior_voters, ctx );
    1837           0 :   if( FD_UNLIKELY( err ) ) return err;
    1838           0 :   err = fd_pubkey_encode( &self->authorized_withdrawer, ctx );
    1839           0 :   if( FD_UNLIKELY( err ) ) return err;
    1840           0 :   err = fd_bincode_uint8_encode( (uchar)(self->commission), ctx );
    1841           0 :   if( FD_UNLIKELY( err ) ) return err;
    1842           0 :   if( self->votes ) {
    1843           0 :     ulong votes_len = deq_fd_vote_lockout_t_cnt( self->votes );
    1844           0 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    1845           0 :     if( FD_UNLIKELY( err ) ) return err;
    1846           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 ) ) {
    1847           0 :       fd_vote_lockout_t const * ele = deq_fd_vote_lockout_t_iter_ele_const( self->votes, iter );
    1848           0 :       err = fd_vote_lockout_encode( ele, ctx );
    1849           0 :       if( FD_UNLIKELY( err ) ) return err;
    1850           0 :     }
    1851           0 :   } else {
    1852           0 :     ulong votes_len = 0;
    1853           0 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    1854           0 :     if( FD_UNLIKELY( err ) ) return err;
    1855           0 :   }
    1856           0 :   err = fd_bincode_bool_encode( self->has_root_slot, ctx );
    1857           0 :   if( FD_UNLIKELY( err ) ) return err;
    1858           0 :   if( self->has_root_slot ) {
    1859           0 :     err = fd_bincode_uint64_encode( self->root_slot, ctx );
    1860           0 :     if( FD_UNLIKELY( err ) ) return err;
    1861           0 :   }
    1862           0 :   if( self->epoch_credits ) {
    1863           0 :     ulong epoch_credits_len = deq_fd_vote_epoch_credits_t_cnt( self->epoch_credits );
    1864           0 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    1865           0 :     if( FD_UNLIKELY( err ) ) return err;
    1866           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 ) ) {
    1867           0 :       fd_vote_epoch_credits_t const * ele = deq_fd_vote_epoch_credits_t_iter_ele_const( self->epoch_credits, iter );
    1868           0 :       err = fd_vote_epoch_credits_encode( ele, ctx );
    1869           0 :       if( FD_UNLIKELY( err ) ) return err;
    1870           0 :     }
    1871           0 :   } else {
    1872           0 :     ulong epoch_credits_len = 0;
    1873           0 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    1874           0 :     if( FD_UNLIKELY( err ) ) return err;
    1875           0 :   }
    1876           0 :   err = fd_vote_block_timestamp_encode( &self->last_timestamp, ctx );
    1877           0 :   if( FD_UNLIKELY( err ) ) return err;
    1878           0 :   return FD_BINCODE_SUCCESS;
    1879           0 : }
    1880           0 : static int fd_vote_state_0_23_5_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1881           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1882           0 :   int err = 0;
    1883           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    1884           0 :   if( FD_UNLIKELY( err ) ) return err;
    1885           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    1886           0 :   if( FD_UNLIKELY( err ) ) return err;
    1887           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    1888           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1889           0 :   err = fd_vote_prior_voters_0_23_5_decode_footprint_inner( ctx, total_sz );
    1890           0 :   if( FD_UNLIKELY( err ) ) return err;
    1891           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    1892           0 :   if( FD_UNLIKELY( err ) ) return err;
    1893           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    1894           0 :   if( FD_UNLIKELY( err ) ) return err;
    1895           0 :   ulong votes_len;
    1896           0 :   err = fd_bincode_uint64_decode( &votes_len, ctx );
    1897           0 :   if( FD_UNLIKELY( err ) ) return err;
    1898           0 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    1899           0 :   *total_sz += deq_fd_vote_lockout_t_align() + deq_fd_vote_lockout_t_footprint( votes_max );
    1900           0 :   ulong votes_sz;
    1901           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( votes_len, 12, &votes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    1902           0 :   err = fd_bincode_bytes_decode_footprint( votes_sz, ctx );
    1903           0 :   if( FD_UNLIKELY( err ) ) return err;
    1904           0 :   {
    1905           0 :     uchar o;
    1906           0 :     err = fd_bincode_bool_decode( &o, ctx );
    1907           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1908           0 :     if( o ) {
    1909           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
    1910           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    1911           0 :     }
    1912           0 :   }
    1913           0 :   ulong epoch_credits_len;
    1914           0 :   err = fd_bincode_uint64_decode( &epoch_credits_len, ctx );
    1915           0 :   if( FD_UNLIKELY( err ) ) return err;
    1916           0 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    1917           0 :   *total_sz += deq_fd_vote_epoch_credits_t_align() + deq_fd_vote_epoch_credits_t_footprint( epoch_credits_max );
    1918           0 :   ulong epoch_credits_sz;
    1919           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( epoch_credits_len, 24, &epoch_credits_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    1920           0 :   err = fd_bincode_bytes_decode_footprint( epoch_credits_sz, ctx );
    1921           0 :   if( FD_UNLIKELY( err ) ) return err;
    1922           0 :   err = fd_vote_block_timestamp_decode_footprint_inner( ctx, total_sz );
    1923           0 :   if( FD_UNLIKELY( err ) ) return err;
    1924           0 :   return 0;
    1925           0 : }
    1926           0 : int fd_vote_state_0_23_5_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    1927           0 :   *total_sz += sizeof(fd_vote_state_0_23_5_t);
    1928           0 :   void const * start_data = ctx->data;
    1929           0 :   int err = fd_vote_state_0_23_5_decode_footprint_inner( ctx, total_sz );
    1930           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    1931           0 :   ctx->data = start_data;
    1932           0 :   return err;
    1933           0 : }
    1934           0 : static void fd_vote_state_0_23_5_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    1935           0 :   fd_vote_state_0_23_5_t * self = (fd_vote_state_0_23_5_t *)struct_mem;
    1936           0 :   fd_pubkey_decode_inner( &self->node_pubkey, alloc_mem, ctx );
    1937           0 :   fd_pubkey_decode_inner( &self->authorized_voter, alloc_mem, ctx );
    1938           0 :   fd_bincode_uint64_decode_unsafe( &self->authorized_voter_epoch, ctx );
    1939           0 :   fd_vote_prior_voters_0_23_5_decode_inner( &self->prior_voters, alloc_mem, ctx );
    1940           0 :   fd_pubkey_decode_inner( &self->authorized_withdrawer, alloc_mem, ctx );
    1941           0 :   fd_bincode_uint8_decode_unsafe( &self->commission, ctx );
    1942           0 :   ulong votes_len;
    1943           0 :   fd_bincode_uint64_decode_unsafe( &votes_len, ctx );
    1944           0 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    1945           0 :   self->votes = deq_fd_vote_lockout_t_join_new( alloc_mem, votes_max );
    1946           0 :   for( ulong i=0; i < votes_len; i++ ) {
    1947           0 :     fd_vote_lockout_t * elem = deq_fd_vote_lockout_t_push_tail_nocopy( self->votes );
    1948           0 :     fd_vote_lockout_new( elem );
    1949           0 :     fd_vote_lockout_decode_inner( elem, alloc_mem, ctx );
    1950           0 :   }
    1951           0 :   {
    1952           0 :     uchar o;
    1953           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    1954           0 :     self->has_root_slot = !!o;
    1955           0 :     if( o ) {
    1956           0 :       fd_bincode_uint64_decode_unsafe( &self->root_slot, ctx );
    1957           0 :     }
    1958           0 :   }
    1959           0 :   ulong epoch_credits_len;
    1960           0 :   fd_bincode_uint64_decode_unsafe( &epoch_credits_len, ctx );
    1961           0 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    1962           0 :   self->epoch_credits = deq_fd_vote_epoch_credits_t_join_new( alloc_mem, epoch_credits_max );
    1963           0 :   for( ulong i=0; i < epoch_credits_len; i++ ) {
    1964           0 :     fd_vote_epoch_credits_t * elem = deq_fd_vote_epoch_credits_t_push_tail_nocopy( self->epoch_credits );
    1965           0 :     fd_vote_epoch_credits_new( elem );
    1966           0 :     fd_vote_epoch_credits_decode_inner( elem, alloc_mem, ctx );
    1967           0 :   }
    1968           0 :   fd_vote_block_timestamp_decode_inner( &self->last_timestamp, alloc_mem, ctx );
    1969           0 : }
    1970           0 : void * fd_vote_state_0_23_5_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    1971           0 :   fd_vote_state_0_23_5_t * self = (fd_vote_state_0_23_5_t *)mem;
    1972           0 :   fd_vote_state_0_23_5_new( self );
    1973           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_0_23_5_t);
    1974           0 :   void * * alloc_mem = &alloc_region;
    1975           0 :   fd_vote_state_0_23_5_decode_inner( mem, alloc_mem, ctx );
    1976           0 :   return self;
    1977           0 : }
    1978           0 : void fd_vote_state_0_23_5_new(fd_vote_state_0_23_5_t * self) {
    1979           0 :   fd_memset( self, 0, sizeof(fd_vote_state_0_23_5_t) );
    1980           0 :   fd_pubkey_new( &self->node_pubkey );
    1981           0 :   fd_pubkey_new( &self->authorized_voter );
    1982           0 :   fd_vote_prior_voters_0_23_5_new( &self->prior_voters );
    1983           0 :   fd_pubkey_new( &self->authorized_withdrawer );
    1984           0 :   fd_vote_block_timestamp_new( &self->last_timestamp );
    1985           0 : }
    1986           0 : ulong fd_vote_state_0_23_5_size( fd_vote_state_0_23_5_t const * self ) {
    1987           0 :   ulong size = 0;
    1988           0 :   size += fd_pubkey_size( &self->node_pubkey );
    1989           0 :   size += fd_pubkey_size( &self->authorized_voter );
    1990           0 :   size += sizeof(ulong);
    1991           0 :   size += fd_vote_prior_voters_0_23_5_size( &self->prior_voters );
    1992           0 :   size += fd_pubkey_size( &self->authorized_withdrawer );
    1993           0 :   size += sizeof(char);
    1994           0 :   if( self->votes ) {
    1995           0 :     size += sizeof(ulong);
    1996           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 ) ) {
    1997           0 :       fd_vote_lockout_t * ele = deq_fd_vote_lockout_t_iter_ele( self->votes, iter );
    1998           0 :       size += fd_vote_lockout_size( ele );
    1999           0 :     }
    2000           0 :   } else {
    2001           0 :     size += sizeof(ulong);
    2002           0 :   }
    2003           0 :   size += sizeof(char);
    2004           0 :   if( self->has_root_slot ) {
    2005           0 :     size += sizeof(ulong);
    2006           0 :   }
    2007           0 :   if( self->epoch_credits ) {
    2008           0 :     size += sizeof(ulong);
    2009           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 ) ) {
    2010           0 :       fd_vote_epoch_credits_t * ele = deq_fd_vote_epoch_credits_t_iter_ele( self->epoch_credits, iter );
    2011           0 :       size += fd_vote_epoch_credits_size( ele );
    2012           0 :     }
    2013           0 :   } else {
    2014           0 :     size += sizeof(ulong);
    2015           0 :   }
    2016           0 :   size += fd_vote_block_timestamp_size( &self->last_timestamp );
    2017           0 :   return size;
    2018           0 : }
    2019             : 
    2020          12 : int fd_vote_authorized_voters_encode( fd_vote_authorized_voters_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2021          12 :   int err;
    2022          12 :   if( self->treap ) {
    2023          12 :     ulong fd_vote_authorized_voters_len = fd_vote_authorized_voters_treap_ele_cnt( self->treap );
    2024          12 :     err = fd_bincode_uint64_encode( fd_vote_authorized_voters_len, ctx );
    2025          12 :     if( FD_UNLIKELY( err ) ) return err;
    2026          12 :     for( fd_vote_authorized_voters_treap_fwd_iter_t iter = fd_vote_authorized_voters_treap_fwd_iter_init( self->treap, self->pool );
    2027          24 :          !fd_vote_authorized_voters_treap_fwd_iter_done( iter );
    2028          12 :          iter = fd_vote_authorized_voters_treap_fwd_iter_next( iter, self->pool ) ) {
    2029          12 :       fd_vote_authorized_voter_t * ele = fd_vote_authorized_voters_treap_fwd_iter_ele( iter, self->pool );
    2030          12 :       err = fd_vote_authorized_voter_encode( ele, ctx );
    2031          12 :       if( FD_UNLIKELY( err ) ) return err;
    2032          12 :     }
    2033          12 :   } else {
    2034           0 :     ulong fd_vote_authorized_voters_len = 0;
    2035           0 :     err = fd_bincode_uint64_encode( fd_vote_authorized_voters_len, ctx );
    2036           0 :     if( FD_UNLIKELY( err ) ) return err;
    2037           0 :   }
    2038          12 :   return FD_BINCODE_SUCCESS;
    2039          12 : }
    2040           0 : static int fd_vote_authorized_voters_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2041           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2042           0 :   int err = 0;
    2043           0 :   ulong fd_vote_authorized_voters_treap_len;
    2044           0 :   err = fd_bincode_uint64_decode( &fd_vote_authorized_voters_treap_len, ctx );
    2045           0 :   if( FD_UNLIKELY( err ) ) return err;
    2046           0 :   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 );
    2047           0 :   *total_sz += fd_vote_authorized_voters_pool_align() + fd_vote_authorized_voters_pool_footprint( fd_vote_authorized_voters_treap_max );
    2048           0 :   *total_sz += fd_vote_authorized_voters_treap_align() + fd_vote_authorized_voters_treap_footprint( fd_vote_authorized_voters_treap_max );
    2049           0 :   for( ulong i=0; i < fd_vote_authorized_voters_treap_len; i++ ) {
    2050           0 :     err = fd_vote_authorized_voter_decode_footprint_inner( ctx, total_sz );
    2051           0 :     if( FD_UNLIKELY ( err ) ) return err;
    2052           0 :   }
    2053           0 :   return 0;
    2054           0 : }
    2055           0 : int fd_vote_authorized_voters_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2056           0 :   *total_sz += sizeof(fd_vote_authorized_voters_t);
    2057           0 :   void const * start_data = ctx->data;
    2058           0 :   int err = fd_vote_authorized_voters_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           0 : static void fd_vote_authorized_voters_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2064           0 :   fd_vote_authorized_voters_t * self = (fd_vote_authorized_voters_t *)struct_mem;
    2065           0 :   ulong fd_vote_authorized_voters_treap_len;
    2066           0 :   fd_bincode_uint64_decode_unsafe( &fd_vote_authorized_voters_treap_len, ctx );
    2067           0 :   ulong fd_vote_authorized_voters_treap_max = fd_ulong_max( fd_vote_authorized_voters_treap_len, FD_VOTE_AUTHORIZED_VOTERS_MIN );
    2068           0 :   self->pool = fd_vote_authorized_voters_pool_join_new( alloc_mem, fd_vote_authorized_voters_treap_max );
    2069           0 :   self->treap = fd_vote_authorized_voters_treap_join_new( alloc_mem, fd_vote_authorized_voters_treap_max );
    2070           0 :   for( ulong i=0; i < fd_vote_authorized_voters_treap_len; i++ ) {
    2071           0 :     fd_vote_authorized_voter_t * ele = fd_vote_authorized_voters_pool_ele_acquire( self->pool );
    2072           0 :     fd_vote_authorized_voter_new( ele );
    2073           0 :     fd_vote_authorized_voter_decode_inner( ele, alloc_mem, ctx );
    2074           0 :     fd_vote_authorized_voter_t * repeated_entry = fd_vote_authorized_voters_treap_ele_query( self->treap, ele->epoch, self->pool );
    2075           0 :     if( repeated_entry ) {
    2076           0 :         fd_vote_authorized_voters_treap_ele_remove( self->treap, repeated_entry, self->pool ); // Remove the element before inserting it back to avoid duplication
    2077           0 :         fd_vote_authorized_voters_pool_ele_release( self->pool, repeated_entry );
    2078           0 :     }
    2079           0 :     fd_vote_authorized_voters_treap_ele_insert( self->treap, ele, self->pool ); /* this cannot fail */
    2080           0 :   }
    2081           0 : }
    2082           0 : void * fd_vote_authorized_voters_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2083           0 :   fd_vote_authorized_voters_t * self = (fd_vote_authorized_voters_t *)mem;
    2084           0 :   fd_vote_authorized_voters_new( self );
    2085           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorized_voters_t);
    2086           0 :   void * * alloc_mem = &alloc_region;
    2087           0 :   fd_vote_authorized_voters_decode_inner( mem, alloc_mem, ctx );
    2088           0 :   return self;
    2089           0 : }
    2090          12 : void fd_vote_authorized_voters_new(fd_vote_authorized_voters_t * self) {
    2091          12 :   fd_memset( self, 0, sizeof(fd_vote_authorized_voters_t) );
    2092          12 : }
    2093           0 : ulong fd_vote_authorized_voters_size( fd_vote_authorized_voters_t const * self ) {
    2094           0 :   ulong size = 0;
    2095           0 :   size += sizeof(ulong);
    2096           0 :   if( self->treap ) {
    2097           0 :     for( fd_vote_authorized_voters_treap_fwd_iter_t iter = fd_vote_authorized_voters_treap_fwd_iter_init( self->treap, self->pool );
    2098           0 :          !fd_vote_authorized_voters_treap_fwd_iter_done( iter );
    2099           0 :          iter = fd_vote_authorized_voters_treap_fwd_iter_next( iter, self->pool ) ) {
    2100           0 :       fd_vote_authorized_voter_t * ele = fd_vote_authorized_voters_treap_fwd_iter_ele( iter, self->pool );
    2101           0 :       size += fd_vote_authorized_voter_size( ele );
    2102           0 :     }
    2103           0 :   }
    2104           0 :   return size;
    2105           0 : }
    2106             : 
    2107           0 : int fd_vote_state_1_14_11_encode( fd_vote_state_1_14_11_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2108           0 :   int err;
    2109           0 :   err = fd_pubkey_encode( &self->node_pubkey, ctx );
    2110           0 :   if( FD_UNLIKELY( err ) ) return err;
    2111           0 :   err = fd_pubkey_encode( &self->authorized_withdrawer, ctx );
    2112           0 :   if( FD_UNLIKELY( err ) ) return err;
    2113           0 :   err = fd_bincode_uint8_encode( (uchar)(self->commission), ctx );
    2114           0 :   if( FD_UNLIKELY( err ) ) return err;
    2115           0 :   if( self->votes ) {
    2116           0 :     ulong votes_len = deq_fd_vote_lockout_t_cnt( self->votes );
    2117           0 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    2118           0 :     if( FD_UNLIKELY( err ) ) return err;
    2119           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 ) ) {
    2120           0 :       fd_vote_lockout_t const * ele = deq_fd_vote_lockout_t_iter_ele_const( self->votes, iter );
    2121           0 :       err = fd_vote_lockout_encode( ele, ctx );
    2122           0 :       if( FD_UNLIKELY( err ) ) return err;
    2123           0 :     }
    2124           0 :   } else {
    2125           0 :     ulong votes_len = 0;
    2126           0 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    2127           0 :     if( FD_UNLIKELY( err ) ) return err;
    2128           0 :   }
    2129           0 :   err = fd_bincode_bool_encode( self->has_root_slot, ctx );
    2130           0 :   if( FD_UNLIKELY( err ) ) return err;
    2131           0 :   if( self->has_root_slot ) {
    2132           0 :     err = fd_bincode_uint64_encode( self->root_slot, ctx );
    2133           0 :     if( FD_UNLIKELY( err ) ) return err;
    2134           0 :   }
    2135           0 :   err = fd_vote_authorized_voters_encode( &self->authorized_voters, ctx );
    2136           0 :   if( FD_UNLIKELY( err ) ) return err;
    2137           0 :   err = fd_vote_prior_voters_encode( &self->prior_voters, ctx );
    2138           0 :   if( FD_UNLIKELY( err ) ) return err;
    2139           0 :   if( self->epoch_credits ) {
    2140           0 :     ulong epoch_credits_len = deq_fd_vote_epoch_credits_t_cnt( self->epoch_credits );
    2141           0 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    2142           0 :     if( FD_UNLIKELY( err ) ) return err;
    2143           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 ) ) {
    2144           0 :       fd_vote_epoch_credits_t const * ele = deq_fd_vote_epoch_credits_t_iter_ele_const( self->epoch_credits, iter );
    2145           0 :       err = fd_vote_epoch_credits_encode( ele, ctx );
    2146           0 :       if( FD_UNLIKELY( err ) ) return err;
    2147           0 :     }
    2148           0 :   } else {
    2149           0 :     ulong epoch_credits_len = 0;
    2150           0 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    2151           0 :     if( FD_UNLIKELY( err ) ) return err;
    2152           0 :   }
    2153           0 :   err = fd_vote_block_timestamp_encode( &self->last_timestamp, ctx );
    2154           0 :   if( FD_UNLIKELY( err ) ) return err;
    2155           0 :   return FD_BINCODE_SUCCESS;
    2156           0 : }
    2157           0 : static int fd_vote_state_1_14_11_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2158           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2159           0 :   int err = 0;
    2160           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2161           0 :   if( FD_UNLIKELY( err ) ) return err;
    2162           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2163           0 :   if( FD_UNLIKELY( err ) ) return err;
    2164           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    2165           0 :   if( FD_UNLIKELY( err ) ) return err;
    2166           0 :   ulong votes_len;
    2167           0 :   err = fd_bincode_uint64_decode( &votes_len, ctx );
    2168           0 :   if( FD_UNLIKELY( err ) ) return err;
    2169           0 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    2170           0 :   *total_sz += deq_fd_vote_lockout_t_align() + deq_fd_vote_lockout_t_footprint( votes_max );
    2171           0 :   ulong votes_sz;
    2172           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( votes_len, 12, &votes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2173           0 :   err = fd_bincode_bytes_decode_footprint( votes_sz, ctx );
    2174           0 :   if( FD_UNLIKELY( err ) ) return err;
    2175           0 :   {
    2176           0 :     uchar o;
    2177           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2178           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2179           0 :     if( o ) {
    2180           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
    2181           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2182           0 :     }
    2183           0 :   }
    2184           0 :   err = fd_vote_authorized_voters_decode_footprint_inner( ctx, total_sz );
    2185           0 :   if( FD_UNLIKELY( err ) ) return err;
    2186           0 :   err = fd_vote_prior_voters_decode_footprint_inner( ctx, total_sz );
    2187           0 :   if( FD_UNLIKELY( err ) ) return err;
    2188           0 :   ulong epoch_credits_len;
    2189           0 :   err = fd_bincode_uint64_decode( &epoch_credits_len, ctx );
    2190           0 :   if( FD_UNLIKELY( err ) ) return err;
    2191           0 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    2192           0 :   *total_sz += deq_fd_vote_epoch_credits_t_align() + deq_fd_vote_epoch_credits_t_footprint( epoch_credits_max );
    2193           0 :   ulong epoch_credits_sz;
    2194           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( epoch_credits_len, 24, &epoch_credits_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2195           0 :   err = fd_bincode_bytes_decode_footprint( epoch_credits_sz, ctx );
    2196           0 :   if( FD_UNLIKELY( err ) ) return err;
    2197           0 :   err = fd_vote_block_timestamp_decode_footprint_inner( ctx, total_sz );
    2198           0 :   if( FD_UNLIKELY( err ) ) return err;
    2199           0 :   return 0;
    2200           0 : }
    2201           0 : int fd_vote_state_1_14_11_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2202           0 :   *total_sz += sizeof(fd_vote_state_1_14_11_t);
    2203           0 :   void const * start_data = ctx->data;
    2204           0 :   int err = fd_vote_state_1_14_11_decode_footprint_inner( ctx, total_sz );
    2205           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2206           0 :   ctx->data = start_data;
    2207           0 :   return err;
    2208           0 : }
    2209           0 : static void fd_vote_state_1_14_11_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2210           0 :   fd_vote_state_1_14_11_t * self = (fd_vote_state_1_14_11_t *)struct_mem;
    2211           0 :   fd_pubkey_decode_inner( &self->node_pubkey, alloc_mem, ctx );
    2212           0 :   fd_pubkey_decode_inner( &self->authorized_withdrawer, alloc_mem, ctx );
    2213           0 :   fd_bincode_uint8_decode_unsafe( &self->commission, ctx );
    2214           0 :   ulong votes_len;
    2215           0 :   fd_bincode_uint64_decode_unsafe( &votes_len, ctx );
    2216           0 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    2217           0 :   self->votes = deq_fd_vote_lockout_t_join_new( alloc_mem, votes_max );
    2218           0 :   for( ulong i=0; i < votes_len; i++ ) {
    2219           0 :     fd_vote_lockout_t * elem = deq_fd_vote_lockout_t_push_tail_nocopy( self->votes );
    2220           0 :     fd_vote_lockout_new( elem );
    2221           0 :     fd_vote_lockout_decode_inner( elem, alloc_mem, ctx );
    2222           0 :   }
    2223           0 :   {
    2224           0 :     uchar o;
    2225           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2226           0 :     self->has_root_slot = !!o;
    2227           0 :     if( o ) {
    2228           0 :       fd_bincode_uint64_decode_unsafe( &self->root_slot, ctx );
    2229           0 :     }
    2230           0 :   }
    2231           0 :   fd_vote_authorized_voters_decode_inner( &self->authorized_voters, alloc_mem, ctx );
    2232           0 :   fd_vote_prior_voters_decode_inner( &self->prior_voters, alloc_mem, ctx );
    2233           0 :   ulong epoch_credits_len;
    2234           0 :   fd_bincode_uint64_decode_unsafe( &epoch_credits_len, ctx );
    2235           0 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    2236           0 :   self->epoch_credits = deq_fd_vote_epoch_credits_t_join_new( alloc_mem, epoch_credits_max );
    2237           0 :   for( ulong i=0; i < epoch_credits_len; i++ ) {
    2238           0 :     fd_vote_epoch_credits_t * elem = deq_fd_vote_epoch_credits_t_push_tail_nocopy( self->epoch_credits );
    2239           0 :     fd_vote_epoch_credits_new( elem );
    2240           0 :     fd_vote_epoch_credits_decode_inner( elem, alloc_mem, ctx );
    2241           0 :   }
    2242           0 :   fd_vote_block_timestamp_decode_inner( &self->last_timestamp, alloc_mem, ctx );
    2243           0 : }
    2244           0 : void * fd_vote_state_1_14_11_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2245           0 :   fd_vote_state_1_14_11_t * self = (fd_vote_state_1_14_11_t *)mem;
    2246           0 :   fd_vote_state_1_14_11_new( self );
    2247           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_1_14_11_t);
    2248           0 :   void * * alloc_mem = &alloc_region;
    2249           0 :   fd_vote_state_1_14_11_decode_inner( mem, alloc_mem, ctx );
    2250           0 :   return self;
    2251           0 : }
    2252           0 : void fd_vote_state_1_14_11_new(fd_vote_state_1_14_11_t * self) {
    2253           0 :   fd_memset( self, 0, sizeof(fd_vote_state_1_14_11_t) );
    2254           0 :   fd_pubkey_new( &self->node_pubkey );
    2255           0 :   fd_pubkey_new( &self->authorized_withdrawer );
    2256           0 :   fd_vote_authorized_voters_new( &self->authorized_voters );
    2257           0 :   fd_vote_prior_voters_new( &self->prior_voters );
    2258           0 :   fd_vote_block_timestamp_new( &self->last_timestamp );
    2259           0 : }
    2260           0 : ulong fd_vote_state_1_14_11_size( fd_vote_state_1_14_11_t const * self ) {
    2261           0 :   ulong size = 0;
    2262           0 :   size += fd_pubkey_size( &self->node_pubkey );
    2263           0 :   size += fd_pubkey_size( &self->authorized_withdrawer );
    2264           0 :   size += sizeof(char);
    2265           0 :   if( self->votes ) {
    2266           0 :     size += sizeof(ulong);
    2267           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 ) ) {
    2268           0 :       fd_vote_lockout_t * ele = deq_fd_vote_lockout_t_iter_ele( self->votes, iter );
    2269           0 :       size += fd_vote_lockout_size( ele );
    2270           0 :     }
    2271           0 :   } else {
    2272           0 :     size += sizeof(ulong);
    2273           0 :   }
    2274           0 :   size += sizeof(char);
    2275           0 :   if( self->has_root_slot ) {
    2276           0 :     size += sizeof(ulong);
    2277           0 :   }
    2278           0 :   size += fd_vote_authorized_voters_size( &self->authorized_voters );
    2279           0 :   size += fd_vote_prior_voters_size( &self->prior_voters );
    2280           0 :   if( self->epoch_credits ) {
    2281           0 :     size += sizeof(ulong);
    2282           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 ) ) {
    2283           0 :       fd_vote_epoch_credits_t * ele = deq_fd_vote_epoch_credits_t_iter_ele( self->epoch_credits, iter );
    2284           0 :       size += fd_vote_epoch_credits_size( ele );
    2285           0 :     }
    2286           0 :   } else {
    2287           0 :     size += sizeof(ulong);
    2288           0 :   }
    2289           0 :   size += fd_vote_block_timestamp_size( &self->last_timestamp );
    2290           0 :   return size;
    2291           0 : }
    2292             : 
    2293          12 : int fd_vote_state_encode( fd_vote_state_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2294          12 :   int err;
    2295          12 :   err = fd_pubkey_encode( &self->node_pubkey, ctx );
    2296          12 :   if( FD_UNLIKELY( err ) ) return err;
    2297          12 :   err = fd_pubkey_encode( &self->authorized_withdrawer, ctx );
    2298          12 :   if( FD_UNLIKELY( err ) ) return err;
    2299          12 :   err = fd_bincode_uint8_encode( (uchar)(self->commission), ctx );
    2300          12 :   if( FD_UNLIKELY( err ) ) return err;
    2301          12 :   if( self->votes ) {
    2302           0 :     ulong votes_len = deq_fd_landed_vote_t_cnt( self->votes );
    2303           0 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    2304           0 :     if( FD_UNLIKELY( err ) ) return err;
    2305           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 ) ) {
    2306           0 :       fd_landed_vote_t const * ele = deq_fd_landed_vote_t_iter_ele_const( self->votes, iter );
    2307           0 :       err = fd_landed_vote_encode( ele, ctx );
    2308           0 :       if( FD_UNLIKELY( err ) ) return err;
    2309           0 :     }
    2310          12 :   } else {
    2311          12 :     ulong votes_len = 0;
    2312          12 :     err = fd_bincode_uint64_encode( votes_len, ctx );
    2313          12 :     if( FD_UNLIKELY( err ) ) return err;
    2314          12 :   }
    2315          12 :   err = fd_bincode_bool_encode( self->has_root_slot, ctx );
    2316          12 :   if( FD_UNLIKELY( err ) ) return err;
    2317          12 :   if( self->has_root_slot ) {
    2318           0 :     err = fd_bincode_uint64_encode( self->root_slot, ctx );
    2319           0 :     if( FD_UNLIKELY( err ) ) return err;
    2320           0 :   }
    2321          12 :   err = fd_vote_authorized_voters_encode( &self->authorized_voters, ctx );
    2322          12 :   if( FD_UNLIKELY( err ) ) return err;
    2323          12 :   err = fd_vote_prior_voters_encode( &self->prior_voters, ctx );
    2324          12 :   if( FD_UNLIKELY( err ) ) return err;
    2325          12 :   if( self->epoch_credits ) {
    2326           0 :     ulong epoch_credits_len = deq_fd_vote_epoch_credits_t_cnt( self->epoch_credits );
    2327           0 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    2328           0 :     if( FD_UNLIKELY( err ) ) return err;
    2329           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 ) ) {
    2330           0 :       fd_vote_epoch_credits_t const * ele = deq_fd_vote_epoch_credits_t_iter_ele_const( self->epoch_credits, iter );
    2331           0 :       err = fd_vote_epoch_credits_encode( ele, ctx );
    2332           0 :       if( FD_UNLIKELY( err ) ) return err;
    2333           0 :     }
    2334          12 :   } else {
    2335          12 :     ulong epoch_credits_len = 0;
    2336          12 :     err = fd_bincode_uint64_encode( epoch_credits_len, ctx );
    2337          12 :     if( FD_UNLIKELY( err ) ) return err;
    2338          12 :   }
    2339          12 :   err = fd_vote_block_timestamp_encode( &self->last_timestamp, ctx );
    2340          12 :   if( FD_UNLIKELY( err ) ) return err;
    2341          12 :   return FD_BINCODE_SUCCESS;
    2342          12 : }
    2343           0 : static int fd_vote_state_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2344           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2345           0 :   int err = 0;
    2346           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2347           0 :   if( FD_UNLIKELY( err ) ) return err;
    2348           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    2349           0 :   if( FD_UNLIKELY( err ) ) return err;
    2350           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    2351           0 :   if( FD_UNLIKELY( err ) ) return err;
    2352           0 :   ulong votes_len;
    2353           0 :   err = fd_bincode_uint64_decode( &votes_len, ctx );
    2354           0 :   if( FD_UNLIKELY( err ) ) return err;
    2355           0 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    2356           0 :   *total_sz += deq_fd_landed_vote_t_align() + deq_fd_landed_vote_t_footprint( votes_max );
    2357           0 :   ulong votes_sz;
    2358           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( votes_len, 13, &votes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2359           0 :   err = fd_bincode_bytes_decode_footprint( votes_sz, ctx );
    2360           0 :   if( FD_UNLIKELY( err ) ) return err;
    2361           0 :   {
    2362           0 :     uchar o;
    2363           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2364           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2365           0 :     if( o ) {
    2366           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
    2367           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2368           0 :     }
    2369           0 :   }
    2370           0 :   err = fd_vote_authorized_voters_decode_footprint_inner( ctx, total_sz );
    2371           0 :   if( FD_UNLIKELY( err ) ) return err;
    2372           0 :   err = fd_vote_prior_voters_decode_footprint_inner( ctx, total_sz );
    2373           0 :   if( FD_UNLIKELY( err ) ) return err;
    2374           0 :   ulong epoch_credits_len;
    2375           0 :   err = fd_bincode_uint64_decode( &epoch_credits_len, ctx );
    2376           0 :   if( FD_UNLIKELY( err ) ) return err;
    2377           0 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    2378           0 :   *total_sz += deq_fd_vote_epoch_credits_t_align() + deq_fd_vote_epoch_credits_t_footprint( epoch_credits_max );
    2379           0 :   ulong epoch_credits_sz;
    2380           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( epoch_credits_len, 24, &epoch_credits_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2381           0 :   err = fd_bincode_bytes_decode_footprint( epoch_credits_sz, ctx );
    2382           0 :   if( FD_UNLIKELY( err ) ) return err;
    2383           0 :   err = fd_vote_block_timestamp_decode_footprint_inner( ctx, total_sz );
    2384           0 :   if( FD_UNLIKELY( err ) ) return err;
    2385           0 :   return 0;
    2386           0 : }
    2387           0 : int fd_vote_state_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2388           0 :   *total_sz += sizeof(fd_vote_state_t);
    2389           0 :   void const * start_data = ctx->data;
    2390           0 :   int err = fd_vote_state_decode_footprint_inner( ctx, total_sz );
    2391           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2392           0 :   ctx->data = start_data;
    2393           0 :   return err;
    2394           0 : }
    2395           0 : static void fd_vote_state_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2396           0 :   fd_vote_state_t * self = (fd_vote_state_t *)struct_mem;
    2397           0 :   fd_pubkey_decode_inner( &self->node_pubkey, alloc_mem, ctx );
    2398           0 :   fd_pubkey_decode_inner( &self->authorized_withdrawer, alloc_mem, ctx );
    2399           0 :   fd_bincode_uint8_decode_unsafe( &self->commission, ctx );
    2400           0 :   ulong votes_len;
    2401           0 :   fd_bincode_uint64_decode_unsafe( &votes_len, ctx );
    2402           0 :   ulong votes_max = fd_ulong_max( votes_len, 32 );
    2403           0 :   self->votes = deq_fd_landed_vote_t_join_new( alloc_mem, votes_max );
    2404           0 :   for( ulong i=0; i < votes_len; i++ ) {
    2405           0 :     fd_landed_vote_t * elem = deq_fd_landed_vote_t_push_tail_nocopy( self->votes );
    2406           0 :     fd_landed_vote_new( elem );
    2407           0 :     fd_landed_vote_decode_inner( elem, alloc_mem, ctx );
    2408           0 :   }
    2409           0 :   {
    2410           0 :     uchar o;
    2411           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2412           0 :     self->has_root_slot = !!o;
    2413           0 :     if( o ) {
    2414           0 :       fd_bincode_uint64_decode_unsafe( &self->root_slot, ctx );
    2415           0 :     }
    2416           0 :   }
    2417           0 :   fd_vote_authorized_voters_decode_inner( &self->authorized_voters, alloc_mem, ctx );
    2418           0 :   fd_vote_prior_voters_decode_inner( &self->prior_voters, alloc_mem, ctx );
    2419           0 :   ulong epoch_credits_len;
    2420           0 :   fd_bincode_uint64_decode_unsafe( &epoch_credits_len, ctx );
    2421           0 :   ulong epoch_credits_max = fd_ulong_max( epoch_credits_len, 64 );
    2422           0 :   self->epoch_credits = deq_fd_vote_epoch_credits_t_join_new( alloc_mem, epoch_credits_max );
    2423           0 :   for( ulong i=0; i < epoch_credits_len; i++ ) {
    2424           0 :     fd_vote_epoch_credits_t * elem = deq_fd_vote_epoch_credits_t_push_tail_nocopy( self->epoch_credits );
    2425           0 :     fd_vote_epoch_credits_new( elem );
    2426           0 :     fd_vote_epoch_credits_decode_inner( elem, alloc_mem, ctx );
    2427           0 :   }
    2428           0 :   fd_vote_block_timestamp_decode_inner( &self->last_timestamp, alloc_mem, ctx );
    2429           0 : }
    2430           0 : void * fd_vote_state_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2431           0 :   fd_vote_state_t * self = (fd_vote_state_t *)mem;
    2432           0 :   fd_vote_state_new( self );
    2433           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_t);
    2434           0 :   void * * alloc_mem = &alloc_region;
    2435           0 :   fd_vote_state_decode_inner( mem, alloc_mem, ctx );
    2436           0 :   return self;
    2437           0 : }
    2438          12 : void fd_vote_state_new(fd_vote_state_t * self) {
    2439          12 :   fd_memset( self, 0, sizeof(fd_vote_state_t) );
    2440          12 :   fd_pubkey_new( &self->node_pubkey );
    2441          12 :   fd_pubkey_new( &self->authorized_withdrawer );
    2442          12 :   fd_vote_authorized_voters_new( &self->authorized_voters );
    2443          12 :   fd_vote_prior_voters_new( &self->prior_voters );
    2444          12 :   fd_vote_block_timestamp_new( &self->last_timestamp );
    2445          12 : }
    2446           0 : ulong fd_vote_state_size( fd_vote_state_t const * self ) {
    2447           0 :   ulong size = 0;
    2448           0 :   size += fd_pubkey_size( &self->node_pubkey );
    2449           0 :   size += fd_pubkey_size( &self->authorized_withdrawer );
    2450           0 :   size += sizeof(char);
    2451           0 :   if( self->votes ) {
    2452           0 :     size += sizeof(ulong);
    2453           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 ) ) {
    2454           0 :       fd_landed_vote_t * ele = deq_fd_landed_vote_t_iter_ele( self->votes, iter );
    2455           0 :       size += fd_landed_vote_size( ele );
    2456           0 :     }
    2457           0 :   } else {
    2458           0 :     size += sizeof(ulong);
    2459           0 :   }
    2460           0 :   size += sizeof(char);
    2461           0 :   if( self->has_root_slot ) {
    2462           0 :     size += sizeof(ulong);
    2463           0 :   }
    2464           0 :   size += fd_vote_authorized_voters_size( &self->authorized_voters );
    2465           0 :   size += fd_vote_prior_voters_size( &self->prior_voters );
    2466           0 :   if( self->epoch_credits ) {
    2467           0 :     size += sizeof(ulong);
    2468           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 ) ) {
    2469           0 :       fd_vote_epoch_credits_t * ele = deq_fd_vote_epoch_credits_t_iter_ele( self->epoch_credits, iter );
    2470           0 :       size += fd_vote_epoch_credits_size( ele );
    2471           0 :     }
    2472           0 :   } else {
    2473           0 :     size += sizeof(ulong);
    2474           0 :   }
    2475           0 :   size += fd_vote_block_timestamp_size( &self->last_timestamp );
    2476           0 :   return size;
    2477           0 : }
    2478             : 
    2479           0 : FD_FN_PURE uchar fd_vote_state_versioned_is_v0_23_5(fd_vote_state_versioned_t const * self) {
    2480           0 :   return self->discriminant == 0;
    2481           0 : }
    2482           0 : FD_FN_PURE uchar fd_vote_state_versioned_is_v1_14_11(fd_vote_state_versioned_t const * self) {
    2483           0 :   return self->discriminant == 1;
    2484           0 : }
    2485           0 : FD_FN_PURE uchar fd_vote_state_versioned_is_current(fd_vote_state_versioned_t const * self) {
    2486           0 :   return self->discriminant == 2;
    2487           0 : }
    2488             : void fd_vote_state_versioned_inner_new( fd_vote_state_versioned_inner_t * self, uint discriminant );
    2489           0 : int fd_vote_state_versioned_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2490           0 :   int err;
    2491           0 :   switch (discriminant) {
    2492           0 :   case 0: {
    2493           0 :     err = fd_vote_state_0_23_5_decode_footprint_inner( ctx, total_sz );
    2494           0 :     if( FD_UNLIKELY( err ) ) return err;
    2495           0 :     return FD_BINCODE_SUCCESS;
    2496           0 :   }
    2497           0 :   case 1: {
    2498           0 :     err = fd_vote_state_1_14_11_decode_footprint_inner( ctx, total_sz );
    2499           0 :     if( FD_UNLIKELY( err ) ) return err;
    2500           0 :     return FD_BINCODE_SUCCESS;
    2501           0 :   }
    2502           0 :   case 2: {
    2503           0 :     err = fd_vote_state_decode_footprint_inner( ctx, total_sz );
    2504           0 :     if( FD_UNLIKELY( err ) ) return err;
    2505           0 :     return FD_BINCODE_SUCCESS;
    2506           0 :   }
    2507           0 :   default: return FD_BINCODE_ERR_ENCODING;
    2508           0 :   }
    2509           0 : }
    2510           0 : static int fd_vote_state_versioned_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2511           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2512           0 :   uint discriminant = 0;
    2513           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    2514           0 :   if( FD_UNLIKELY( err ) ) return err;
    2515           0 :   return fd_vote_state_versioned_inner_decode_footprint( discriminant, ctx, total_sz );
    2516           0 : }
    2517           0 : int fd_vote_state_versioned_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2518           0 :   *total_sz += sizeof(fd_vote_state_versioned_t);
    2519           0 :   void const * start_data = ctx->data;
    2520           0 :   int err =  fd_vote_state_versioned_decode_footprint_inner( ctx, total_sz );
    2521           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2522           0 :   ctx->data = start_data;
    2523           0 :   return err;
    2524           0 : }
    2525           0 : 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 ) {
    2526           0 :   switch (discriminant) {
    2527           0 :   case 0: {
    2528           0 :     fd_vote_state_0_23_5_decode_inner( &self->v0_23_5, alloc_mem, ctx );
    2529           0 :     break;
    2530           0 :   }
    2531           0 :   case 1: {
    2532           0 :     fd_vote_state_1_14_11_decode_inner( &self->v1_14_11, alloc_mem, ctx );
    2533           0 :     break;
    2534           0 :   }
    2535           0 :   case 2: {
    2536           0 :     fd_vote_state_decode_inner( &self->current, alloc_mem, ctx );
    2537           0 :     break;
    2538           0 :   }
    2539           0 :   }
    2540           0 : }
    2541           0 : static void fd_vote_state_versioned_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2542           0 :   fd_vote_state_versioned_t * self = (fd_vote_state_versioned_t *)struct_mem;
    2543           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    2544           0 :   fd_vote_state_versioned_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    2545           0 : }
    2546           0 : void * fd_vote_state_versioned_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2547           0 :   fd_vote_state_versioned_t * self = (fd_vote_state_versioned_t *)mem;
    2548           0 :   fd_vote_state_versioned_new( self );
    2549           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_versioned_t);
    2550           0 :   void * * alloc_mem = &alloc_region;
    2551           0 :   fd_vote_state_versioned_decode_inner( mem, alloc_mem, ctx );
    2552           0 :   return self;
    2553           0 : }
    2554          12 : void fd_vote_state_versioned_inner_new( fd_vote_state_versioned_inner_t * self, uint discriminant ) {
    2555          12 :   switch( discriminant ) {
    2556           0 :   case 0: {
    2557           0 :     fd_vote_state_0_23_5_new( &self->v0_23_5 );
    2558           0 :     break;
    2559           0 :   }
    2560           0 :   case 1: {
    2561           0 :     fd_vote_state_1_14_11_new( &self->v1_14_11 );
    2562           0 :     break;
    2563           0 :   }
    2564          12 :   case 2: {
    2565          12 :     fd_vote_state_new( &self->current );
    2566          12 :     break;
    2567           0 :   }
    2568           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    2569          12 :   }
    2570          12 : }
    2571          12 : void fd_vote_state_versioned_new_disc( fd_vote_state_versioned_t * self, uint discriminant ) {
    2572          12 :   self->discriminant = discriminant;
    2573          12 :   fd_vote_state_versioned_inner_new( &self->inner, self->discriminant );
    2574          12 : }
    2575           0 : void fd_vote_state_versioned_new( fd_vote_state_versioned_t * self ) {
    2576           0 :   fd_memset( self, 0, sizeof(fd_vote_state_versioned_t) );
    2577           0 :   fd_vote_state_versioned_new_disc( self, UINT_MAX );
    2578           0 : }
    2579             : 
    2580           0 : ulong fd_vote_state_versioned_size( fd_vote_state_versioned_t const * self ) {
    2581           0 :   ulong size = 0;
    2582           0 :   size += sizeof(uint);
    2583           0 :   switch (self->discriminant) {
    2584           0 :   case 0: {
    2585           0 :     size += fd_vote_state_0_23_5_size( &self->inner.v0_23_5 );
    2586           0 :     break;
    2587           0 :   }
    2588           0 :   case 1: {
    2589           0 :     size += fd_vote_state_1_14_11_size( &self->inner.v1_14_11 );
    2590           0 :     break;
    2591           0 :   }
    2592           0 :   case 2: {
    2593           0 :     size += fd_vote_state_size( &self->inner.current );
    2594           0 :     break;
    2595           0 :   }
    2596           0 :   }
    2597           0 :   return size;
    2598           0 : }
    2599             : 
    2600          12 : int fd_vote_state_versioned_inner_encode( fd_vote_state_versioned_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    2601          12 :   int err;
    2602          12 :   switch (discriminant) {
    2603           0 :   case 0: {
    2604           0 :     err = fd_vote_state_0_23_5_encode( &self->v0_23_5, ctx );
    2605           0 :     if( FD_UNLIKELY( err ) ) return err;
    2606           0 :     break;
    2607           0 :   }
    2608           0 :   case 1: {
    2609           0 :     err = fd_vote_state_1_14_11_encode( &self->v1_14_11, ctx );
    2610           0 :     if( FD_UNLIKELY( err ) ) return err;
    2611           0 :     break;
    2612           0 :   }
    2613          12 :   case 2: {
    2614          12 :     err = fd_vote_state_encode( &self->current, ctx );
    2615          12 :     if( FD_UNLIKELY( err ) ) return err;
    2616          12 :     break;
    2617          12 :   }
    2618          12 :   }
    2619          12 :   return FD_BINCODE_SUCCESS;
    2620          12 : }
    2621          12 : int fd_vote_state_versioned_encode( fd_vote_state_versioned_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2622          12 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    2623          12 :   if( FD_UNLIKELY( err ) ) return err;
    2624          12 :   return fd_vote_state_versioned_inner_encode( &self->inner, self->discriminant, ctx );
    2625          12 : }
    2626             : 
    2627           0 : int fd_vote_state_update_encode( fd_vote_state_update_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2628           0 :   int err;
    2629           0 :   if( self->lockouts ) {
    2630           0 :     ulong lockouts_len = deq_fd_vote_lockout_t_cnt( self->lockouts );
    2631           0 :     err = fd_bincode_uint64_encode( lockouts_len, ctx );
    2632           0 :     if( FD_UNLIKELY( err ) ) return err;
    2633           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 ) ) {
    2634           0 :       fd_vote_lockout_t const * ele = deq_fd_vote_lockout_t_iter_ele_const( self->lockouts, iter );
    2635           0 :       err = fd_vote_lockout_encode( ele, ctx );
    2636           0 :       if( FD_UNLIKELY( err ) ) return err;
    2637           0 :     }
    2638           0 :   } else {
    2639           0 :     ulong lockouts_len = 0;
    2640           0 :     err = fd_bincode_uint64_encode( lockouts_len, ctx );
    2641           0 :     if( FD_UNLIKELY( err ) ) return err;
    2642           0 :   }
    2643           0 :   err = fd_bincode_bool_encode( self->has_root, ctx );
    2644           0 :   if( FD_UNLIKELY( err ) ) return err;
    2645           0 :   if( self->has_root ) {
    2646           0 :     err = fd_bincode_uint64_encode( self->root, ctx );
    2647           0 :     if( FD_UNLIKELY( err ) ) return err;
    2648           0 :   }
    2649           0 :   err = fd_hash_encode( &self->hash, ctx );
    2650           0 :   if( FD_UNLIKELY( err ) ) return err;
    2651           0 :   err = fd_bincode_bool_encode( self->has_timestamp, ctx );
    2652           0 :   if( FD_UNLIKELY( err ) ) return err;
    2653           0 :   if( self->has_timestamp ) {
    2654           0 :     err = fd_bincode_int64_encode( self->timestamp, ctx );
    2655           0 :     if( FD_UNLIKELY( err ) ) return err;
    2656           0 :   }
    2657           0 :   return FD_BINCODE_SUCCESS;
    2658           0 : }
    2659           0 : static int fd_vote_state_update_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2660           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2661           0 :   int err = 0;
    2662           0 :   ulong lockouts_len;
    2663           0 :   err = fd_bincode_uint64_decode( &lockouts_len, ctx );
    2664           0 :   if( FD_UNLIKELY( err ) ) return err;
    2665           0 :   ulong lockouts_max = fd_ulong_max( lockouts_len, 32 );
    2666           0 :   *total_sz += deq_fd_vote_lockout_t_align() + deq_fd_vote_lockout_t_footprint( lockouts_max );
    2667           0 :   ulong lockouts_sz;
    2668           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( lockouts_len, 12, &lockouts_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    2669           0 :   err = fd_bincode_bytes_decode_footprint( lockouts_sz, ctx );
    2670           0 :   if( FD_UNLIKELY( err ) ) return err;
    2671           0 :   {
    2672           0 :     uchar o;
    2673           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2674           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2675           0 :     if( o ) {
    2676           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
    2677           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2678           0 :     }
    2679           0 :   }
    2680           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2681           0 :   if( FD_UNLIKELY( err ) ) return err;
    2682           0 :   {
    2683           0 :     uchar o;
    2684           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2685           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2686           0 :     if( o ) {
    2687           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    2688           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2689           0 :     }
    2690           0 :   }
    2691           0 :   return 0;
    2692           0 : }
    2693           0 : int fd_vote_state_update_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2694           0 :   *total_sz += sizeof(fd_vote_state_update_t);
    2695           0 :   void const * start_data = ctx->data;
    2696           0 :   int err = fd_vote_state_update_decode_footprint_inner( ctx, total_sz );
    2697           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2698           0 :   ctx->data = start_data;
    2699           0 :   return err;
    2700           0 : }
    2701           0 : static void fd_vote_state_update_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2702           0 :   fd_vote_state_update_t * self = (fd_vote_state_update_t *)struct_mem;
    2703           0 :   ulong lockouts_len;
    2704           0 :   fd_bincode_uint64_decode_unsafe( &lockouts_len, ctx );
    2705           0 :   ulong lockouts_max = fd_ulong_max( lockouts_len, 32 );
    2706           0 :   self->lockouts = deq_fd_vote_lockout_t_join_new( alloc_mem, lockouts_max );
    2707           0 :   for( ulong i=0; i < lockouts_len; i++ ) {
    2708           0 :     fd_vote_lockout_t * elem = deq_fd_vote_lockout_t_push_tail_nocopy( self->lockouts );
    2709           0 :     fd_vote_lockout_new( elem );
    2710           0 :     fd_vote_lockout_decode_inner( elem, alloc_mem, ctx );
    2711           0 :   }
    2712           0 :   {
    2713           0 :     uchar o;
    2714           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2715           0 :     self->has_root = !!o;
    2716           0 :     if( o ) {
    2717           0 :       fd_bincode_uint64_decode_unsafe( &self->root, ctx );
    2718           0 :     }
    2719           0 :   }
    2720           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    2721           0 :   {
    2722           0 :     uchar o;
    2723           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2724           0 :     self->has_timestamp = !!o;
    2725           0 :     if( o ) {
    2726           0 :       fd_bincode_int64_decode_unsafe( &self->timestamp, ctx );
    2727           0 :     }
    2728           0 :   }
    2729           0 : }
    2730           0 : void * fd_vote_state_update_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2731           0 :   fd_vote_state_update_t * self = (fd_vote_state_update_t *)mem;
    2732           0 :   fd_vote_state_update_new( self );
    2733           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_state_update_t);
    2734           0 :   void * * alloc_mem = &alloc_region;
    2735           0 :   fd_vote_state_update_decode_inner( mem, alloc_mem, ctx );
    2736           0 :   return self;
    2737           0 : }
    2738           0 : void fd_vote_state_update_new(fd_vote_state_update_t * self) {
    2739           0 :   fd_memset( self, 0, sizeof(fd_vote_state_update_t) );
    2740           0 :   fd_hash_new( &self->hash );
    2741           0 : }
    2742           0 : ulong fd_vote_state_update_size( fd_vote_state_update_t const * self ) {
    2743           0 :   ulong size = 0;
    2744           0 :   if( self->lockouts ) {
    2745           0 :     size += sizeof(ulong);
    2746           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 ) ) {
    2747           0 :       fd_vote_lockout_t * ele = deq_fd_vote_lockout_t_iter_ele( self->lockouts, iter );
    2748           0 :       size += fd_vote_lockout_size( ele );
    2749           0 :     }
    2750           0 :   } else {
    2751           0 :     size += sizeof(ulong);
    2752           0 :   }
    2753           0 :   size += sizeof(char);
    2754           0 :   if( self->has_root ) {
    2755           0 :     size += sizeof(ulong);
    2756           0 :   }
    2757           0 :   size += fd_hash_size( &self->hash );
    2758           0 :   size += sizeof(char);
    2759           0 :   if( self->has_timestamp ) {
    2760           0 :     size += sizeof(long);
    2761           0 :   }
    2762           0 :   return size;
    2763           0 : }
    2764             : 
    2765           0 : int fd_compact_vote_state_update_encode( fd_compact_vote_state_update_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2766           0 :   int err;
    2767           0 :   err = fd_bincode_uint64_encode( self->root, ctx );
    2768           0 :   if( FD_UNLIKELY( err ) ) return err;
    2769           0 :   err = fd_bincode_compact_u16_encode( &self->lockouts_len, ctx );
    2770           0 :   if( FD_UNLIKELY(err) ) return err;
    2771           0 :   if( self->lockouts_len ) {
    2772           0 :     for( ulong i=0; i < self->lockouts_len; i++ ) {
    2773           0 :       err = fd_lockout_offset_encode( self->lockouts + i, ctx );
    2774           0 :       if( FD_UNLIKELY( err ) ) return err;
    2775           0 :     }
    2776           0 :   }
    2777           0 :   err = fd_hash_encode( &self->hash, ctx );
    2778           0 :   if( FD_UNLIKELY( err ) ) return err;
    2779           0 :   err = fd_bincode_bool_encode( self->has_timestamp, ctx );
    2780           0 :   if( FD_UNLIKELY( err ) ) return err;
    2781           0 :   if( self->has_timestamp ) {
    2782           0 :     err = fd_bincode_int64_encode( self->timestamp, ctx );
    2783           0 :     if( FD_UNLIKELY( err ) ) return err;
    2784           0 :   }
    2785           0 :   return FD_BINCODE_SUCCESS;
    2786           0 : }
    2787           0 : static int fd_compact_vote_state_update_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2788           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2789           0 :   int err = 0;
    2790           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    2791           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2792           0 :   ushort lockouts_len;
    2793           0 :   err = fd_bincode_compact_u16_decode( &lockouts_len, ctx );
    2794           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2795           0 :   if( lockouts_len ) {
    2796           0 :     *total_sz += FD_LOCKOUT_OFFSET_ALIGN + sizeof(fd_lockout_offset_t)*lockouts_len;
    2797           0 :     for( ulong i=0; i < lockouts_len; i++ ) {
    2798           0 :       err = fd_lockout_offset_decode_footprint_inner( ctx, total_sz );
    2799           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2800           0 :     }
    2801           0 :   }
    2802           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2803           0 :   if( FD_UNLIKELY( err ) ) return err;
    2804           0 :   {
    2805           0 :     uchar o;
    2806           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2807           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2808           0 :     if( o ) {
    2809           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    2810           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2811           0 :     }
    2812           0 :   }
    2813           0 :   return 0;
    2814           0 : }
    2815           0 : int fd_compact_vote_state_update_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2816           0 :   *total_sz += sizeof(fd_compact_vote_state_update_t);
    2817           0 :   void const * start_data = ctx->data;
    2818           0 :   int err = fd_compact_vote_state_update_decode_footprint_inner( ctx, total_sz );
    2819           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2820           0 :   ctx->data = start_data;
    2821           0 :   return err;
    2822           0 : }
    2823           0 : static void fd_compact_vote_state_update_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2824           0 :   fd_compact_vote_state_update_t * self = (fd_compact_vote_state_update_t *)struct_mem;
    2825           0 :   fd_bincode_uint64_decode_unsafe( &self->root, ctx );
    2826           0 :   fd_bincode_compact_u16_decode_unsafe( &self->lockouts_len, ctx );
    2827           0 :   if( self->lockouts_len ) {
    2828           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_LOCKOUT_OFFSET_ALIGN );
    2829           0 :     self->lockouts = *alloc_mem;
    2830           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_lockout_offset_t)*self->lockouts_len;
    2831           0 :     for( ulong i=0; i < self->lockouts_len; i++ ) {
    2832           0 :       fd_lockout_offset_new( self->lockouts + i );
    2833           0 :       fd_lockout_offset_decode_inner( self->lockouts + i, alloc_mem, ctx );
    2834           0 :     }
    2835           0 :   } else
    2836           0 :     self->lockouts = NULL;
    2837           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    2838           0 :   {
    2839           0 :     uchar o;
    2840           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    2841           0 :     self->has_timestamp = !!o;
    2842           0 :     if( o ) {
    2843           0 :       fd_bincode_int64_decode_unsafe( &self->timestamp, ctx );
    2844           0 :     }
    2845           0 :   }
    2846           0 : }
    2847           0 : void * fd_compact_vote_state_update_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2848           0 :   fd_compact_vote_state_update_t * self = (fd_compact_vote_state_update_t *)mem;
    2849           0 :   fd_compact_vote_state_update_new( self );
    2850           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_compact_vote_state_update_t);
    2851           0 :   void * * alloc_mem = &alloc_region;
    2852           0 :   fd_compact_vote_state_update_decode_inner( mem, alloc_mem, ctx );
    2853           0 :   return self;
    2854           0 : }
    2855           0 : void fd_compact_vote_state_update_new(fd_compact_vote_state_update_t * self) {
    2856           0 :   fd_memset( self, 0, sizeof(fd_compact_vote_state_update_t) );
    2857           0 :   fd_hash_new( &self->hash );
    2858           0 : }
    2859           0 : ulong fd_compact_vote_state_update_size( fd_compact_vote_state_update_t const * self ) {
    2860           0 :   ulong size = 0;
    2861           0 :   size += sizeof(ulong);
    2862           0 :   do {
    2863           0 :     ushort tmp = (ushort)self->lockouts_len;
    2864           0 :     size += fd_bincode_compact_u16_size( &tmp );
    2865           0 :     for( ulong i=0; i < self->lockouts_len; i++ )
    2866           0 :       size += fd_lockout_offset_size( self->lockouts + i );
    2867           0 :   } while(0);
    2868           0 :   size += fd_hash_size( &self->hash );
    2869           0 :   size += sizeof(char);
    2870           0 :   if( self->has_timestamp ) {
    2871           0 :     size += sizeof(long);
    2872           0 :   }
    2873           0 :   return size;
    2874           0 : }
    2875             : 
    2876           0 : int fd_compact_vote_state_update_switch_encode( fd_compact_vote_state_update_switch_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2877           0 :   int err;
    2878           0 :   err = fd_compact_vote_state_update_encode( &self->compact_vote_state_update, ctx );
    2879           0 :   if( FD_UNLIKELY( err ) ) return err;
    2880           0 :   err = fd_hash_encode( &self->hash, ctx );
    2881           0 :   if( FD_UNLIKELY( err ) ) return err;
    2882           0 :   return FD_BINCODE_SUCCESS;
    2883           0 : }
    2884           0 : static int fd_compact_vote_state_update_switch_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2885           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2886           0 :   int err = 0;
    2887           0 :   err = fd_compact_vote_state_update_decode_footprint_inner( ctx, total_sz );
    2888           0 :   if( FD_UNLIKELY( err ) ) return err;
    2889           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2890           0 :   if( FD_UNLIKELY( err ) ) return err;
    2891           0 :   return 0;
    2892           0 : }
    2893           0 : int fd_compact_vote_state_update_switch_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2894           0 :   *total_sz += sizeof(fd_compact_vote_state_update_switch_t);
    2895           0 :   void const * start_data = ctx->data;
    2896           0 :   int err = fd_compact_vote_state_update_switch_decode_footprint_inner( ctx, total_sz );
    2897           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2898           0 :   ctx->data = start_data;
    2899           0 :   return err;
    2900           0 : }
    2901           0 : static void fd_compact_vote_state_update_switch_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2902           0 :   fd_compact_vote_state_update_switch_t * self = (fd_compact_vote_state_update_switch_t *)struct_mem;
    2903           0 :   fd_compact_vote_state_update_decode_inner( &self->compact_vote_state_update, alloc_mem, ctx );
    2904           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    2905           0 : }
    2906           0 : void * fd_compact_vote_state_update_switch_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    2907           0 :   fd_compact_vote_state_update_switch_t * self = (fd_compact_vote_state_update_switch_t *)mem;
    2908           0 :   fd_compact_vote_state_update_switch_new( self );
    2909           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_compact_vote_state_update_switch_t);
    2910           0 :   void * * alloc_mem = &alloc_region;
    2911           0 :   fd_compact_vote_state_update_switch_decode_inner( mem, alloc_mem, ctx );
    2912           0 :   return self;
    2913           0 : }
    2914           0 : void fd_compact_vote_state_update_switch_new(fd_compact_vote_state_update_switch_t * self) {
    2915           0 :   fd_memset( self, 0, sizeof(fd_compact_vote_state_update_switch_t) );
    2916           0 :   fd_compact_vote_state_update_new( &self->compact_vote_state_update );
    2917           0 :   fd_hash_new( &self->hash );
    2918           0 : }
    2919           0 : ulong fd_compact_vote_state_update_switch_size( fd_compact_vote_state_update_switch_t const * self ) {
    2920           0 :   ulong size = 0;
    2921           0 :   size += fd_compact_vote_state_update_size( &self->compact_vote_state_update );
    2922           0 :   size += fd_hash_size( &self->hash );
    2923           0 :   return size;
    2924           0 : }
    2925             : 
    2926           0 : int fd_compact_tower_sync_encode( fd_compact_tower_sync_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    2927           0 :   int err;
    2928           0 :   err = fd_bincode_uint64_encode( self->root, ctx );
    2929           0 :   if( FD_UNLIKELY( err ) ) return err;
    2930           0 :   if( self->lockout_offsets ) {
    2931           0 :     ushort lockout_offsets_len = (ushort)deq_fd_lockout_offset_t_cnt( self->lockout_offsets );
    2932           0 :     err = fd_bincode_compact_u16_encode( &lockout_offsets_len, ctx );
    2933           0 :     if( FD_UNLIKELY( err ) ) return err;
    2934           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 ) ) {
    2935           0 :       fd_lockout_offset_t const * ele = deq_fd_lockout_offset_t_iter_ele_const( self->lockout_offsets, iter );
    2936           0 :       err = fd_lockout_offset_encode( ele, ctx );
    2937           0 :       if( FD_UNLIKELY( err ) ) return err;
    2938           0 :     }
    2939           0 :   } else {
    2940           0 :     ushort lockout_offsets_len = 0;
    2941           0 :     err = fd_bincode_compact_u16_encode( &lockout_offsets_len, ctx );
    2942           0 :     if( FD_UNLIKELY( err ) ) return err;
    2943           0 :   }
    2944           0 :   err = fd_hash_encode( &self->hash, ctx );
    2945           0 :   if( FD_UNLIKELY( err ) ) return err;
    2946           0 :   err = fd_bincode_bool_encode( self->has_timestamp, ctx );
    2947           0 :   if( FD_UNLIKELY( err ) ) return err;
    2948           0 :   if( self->has_timestamp ) {
    2949           0 :     err = fd_bincode_int64_encode( self->timestamp, ctx );
    2950           0 :     if( FD_UNLIKELY( err ) ) return err;
    2951           0 :   }
    2952           0 :   err = fd_hash_encode( &self->block_id, ctx );
    2953           0 :   if( FD_UNLIKELY( err ) ) return err;
    2954           0 :   return FD_BINCODE_SUCCESS;
    2955           0 : }
    2956           0 : static int fd_compact_tower_sync_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2957           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2958           0 :   int err = 0;
    2959           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    2960           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2961           0 :   ushort lockout_offsets_len;
    2962           0 :   err = fd_bincode_compact_u16_decode( &lockout_offsets_len, ctx );
    2963           0 :   if( FD_UNLIKELY( err ) ) return err;
    2964           0 :   ulong lockout_offsets_max = fd_ulong_max( lockout_offsets_len, 32 );
    2965           0 :   *total_sz += deq_fd_lockout_offset_t_align() + deq_fd_lockout_offset_t_footprint( lockout_offsets_max );
    2966           0 :   for( ulong i = 0; i < lockout_offsets_len; ++i ) {
    2967           0 :     err = fd_lockout_offset_decode_footprint_inner( ctx, total_sz );
    2968           0 :     if( FD_UNLIKELY( err ) ) return err;
    2969           0 :   }
    2970           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2971           0 :   if( FD_UNLIKELY( err ) ) return err;
    2972           0 :   {
    2973           0 :     uchar o;
    2974           0 :     err = fd_bincode_bool_decode( &o, ctx );
    2975           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2976           0 :     if( o ) {
    2977           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    2978           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    2979           0 :     }
    2980           0 :   }
    2981           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    2982           0 :   if( FD_UNLIKELY( err ) ) return err;
    2983           0 :   return 0;
    2984           0 : }
    2985           0 : int fd_compact_tower_sync_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    2986           0 :   *total_sz += sizeof(fd_compact_tower_sync_t);
    2987           0 :   void const * start_data = ctx->data;
    2988           0 :   int err = fd_compact_tower_sync_decode_footprint_inner( ctx, total_sz );
    2989           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    2990           0 :   ctx->data = start_data;
    2991           0 :   return err;
    2992           0 : }
    2993           0 : static void fd_compact_tower_sync_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    2994           0 :   fd_compact_tower_sync_t * self = (fd_compact_tower_sync_t *)struct_mem;
    2995           0 :   fd_bincode_uint64_decode_unsafe( &self->root, ctx );
    2996           0 :   ushort lockout_offsets_len;
    2997           0 :   fd_bincode_compact_u16_decode_unsafe( &lockout_offsets_len, ctx );
    2998           0 :   ulong lockout_offsets_max = fd_ulong_max( lockout_offsets_len, 32 );
    2999           0 :   self->lockout_offsets = deq_fd_lockout_offset_t_join_new( alloc_mem, lockout_offsets_max );
    3000           0 :   for( ulong i=0; i < lockout_offsets_len; i++ ) {
    3001           0 :     fd_lockout_offset_t * elem = deq_fd_lockout_offset_t_push_tail_nocopy( self->lockout_offsets );
    3002           0 :     fd_lockout_offset_new( elem );
    3003           0 :     fd_lockout_offset_decode_inner( elem, alloc_mem, ctx );
    3004           0 :   }
    3005           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    3006           0 :   {
    3007           0 :     uchar o;
    3008           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    3009           0 :     self->has_timestamp = !!o;
    3010           0 :     if( o ) {
    3011           0 :       fd_bincode_int64_decode_unsafe( &self->timestamp, ctx );
    3012           0 :     }
    3013           0 :   }
    3014           0 :   fd_hash_decode_inner( &self->block_id, alloc_mem, ctx );
    3015           0 : }
    3016           0 : void * fd_compact_tower_sync_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3017           0 :   fd_compact_tower_sync_t * self = (fd_compact_tower_sync_t *)mem;
    3018           0 :   fd_compact_tower_sync_new( self );
    3019           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_compact_tower_sync_t);
    3020           0 :   void * * alloc_mem = &alloc_region;
    3021           0 :   fd_compact_tower_sync_decode_inner( mem, alloc_mem, ctx );
    3022           0 :   return self;
    3023           0 : }
    3024           0 : void fd_compact_tower_sync_new(fd_compact_tower_sync_t * self) {
    3025           0 :   fd_memset( self, 0, sizeof(fd_compact_tower_sync_t) );
    3026           0 :   fd_hash_new( &self->hash );
    3027           0 :   fd_hash_new( &self->block_id );
    3028           0 : }
    3029           0 : ulong fd_compact_tower_sync_size( fd_compact_tower_sync_t const * self ) {
    3030           0 :   ulong size = 0;
    3031           0 :   size += sizeof(ulong);
    3032           0 :   if( self->lockout_offsets ) {
    3033           0 :     ushort lockout_offsets_len = (ushort)deq_fd_lockout_offset_t_cnt( self->lockout_offsets );
    3034           0 :     size += fd_bincode_compact_u16_size( &lockout_offsets_len );
    3035           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 ) ) {
    3036           0 :       fd_lockout_offset_t * ele = deq_fd_lockout_offset_t_iter_ele( self->lockout_offsets, iter );
    3037           0 :       size += fd_lockout_offset_size( ele );
    3038           0 :     }
    3039           0 :   } else {
    3040           0 :     size += 1;
    3041           0 :   }
    3042           0 :   size += fd_hash_size( &self->hash );
    3043           0 :   size += sizeof(char);
    3044           0 :   if( self->has_timestamp ) {
    3045           0 :     size += sizeof(long);
    3046           0 :   }
    3047           0 :   size += fd_hash_size( &self->block_id );
    3048           0 :   return size;
    3049           0 : }
    3050             : 
    3051           0 : void fd_tower_sync_new(fd_tower_sync_t * self) {
    3052           0 :   fd_memset( self, 0, sizeof(fd_tower_sync_t) );
    3053           0 :   fd_hash_new( &self->hash );
    3054           0 :   fd_hash_new( &self->block_id );
    3055           0 : }
    3056           0 : ulong fd_tower_sync_size( fd_tower_sync_t const * self ) {
    3057           0 :   ulong size = 0;
    3058           0 :   if( self->lockouts ) {
    3059           0 :     size += sizeof(ulong);
    3060           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 ) ) {
    3061           0 :       fd_vote_lockout_t * ele = deq_fd_vote_lockout_t_iter_ele( self->lockouts, iter );
    3062           0 :       size += fd_vote_lockout_size( ele );
    3063           0 :     }
    3064           0 :   } else {
    3065           0 :     size += sizeof(ulong);
    3066           0 :   }
    3067           0 :   size += sizeof(ulong);
    3068           0 :   size += sizeof(char);
    3069           0 :   if( self->has_root ) {
    3070           0 :     size += sizeof(ulong);
    3071           0 :   }
    3072           0 :   size += fd_hash_size( &self->hash );
    3073           0 :   size += sizeof(char);
    3074           0 :   if( self->has_timestamp ) {
    3075           0 :     size += sizeof(long);
    3076           0 :   }
    3077           0 :   size += fd_hash_size( &self->block_id );
    3078           0 :   return size;
    3079           0 : }
    3080             : 
    3081           0 : int fd_tower_sync_switch_encode( fd_tower_sync_switch_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3082           0 :   int err;
    3083           0 :   err = fd_tower_sync_encode( &self->tower_sync, ctx );
    3084           0 :   if( FD_UNLIKELY( err ) ) return err;
    3085           0 :   err = fd_hash_encode( &self->hash, ctx );
    3086           0 :   if( FD_UNLIKELY( err ) ) return err;
    3087           0 :   return FD_BINCODE_SUCCESS;
    3088           0 : }
    3089           0 : static int fd_tower_sync_switch_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3090           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3091           0 :   int err = 0;
    3092           0 :   err = fd_tower_sync_decode_footprint_inner( ctx, total_sz );
    3093           0 :   if( FD_UNLIKELY( err ) ) return err;
    3094           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    3095           0 :   if( FD_UNLIKELY( err ) ) return err;
    3096           0 :   return 0;
    3097           0 : }
    3098           0 : int fd_tower_sync_switch_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3099           0 :   *total_sz += sizeof(fd_tower_sync_switch_t);
    3100           0 :   void const * start_data = ctx->data;
    3101           0 :   int err = fd_tower_sync_switch_decode_footprint_inner( ctx, total_sz );
    3102           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3103           0 :   ctx->data = start_data;
    3104           0 :   return err;
    3105           0 : }
    3106           0 : static void fd_tower_sync_switch_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3107           0 :   fd_tower_sync_switch_t * self = (fd_tower_sync_switch_t *)struct_mem;
    3108           0 :   fd_tower_sync_decode_inner( &self->tower_sync, alloc_mem, ctx );
    3109           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    3110           0 : }
    3111           0 : void * fd_tower_sync_switch_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3112           0 :   fd_tower_sync_switch_t * self = (fd_tower_sync_switch_t *)mem;
    3113           0 :   fd_tower_sync_switch_new( self );
    3114           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_tower_sync_switch_t);
    3115           0 :   void * * alloc_mem = &alloc_region;
    3116           0 :   fd_tower_sync_switch_decode_inner( mem, alloc_mem, ctx );
    3117           0 :   return self;
    3118           0 : }
    3119           0 : void fd_tower_sync_switch_new(fd_tower_sync_switch_t * self) {
    3120           0 :   fd_memset( self, 0, sizeof(fd_tower_sync_switch_t) );
    3121           0 :   fd_tower_sync_new( &self->tower_sync );
    3122           0 :   fd_hash_new( &self->hash );
    3123           0 : }
    3124           0 : ulong fd_tower_sync_switch_size( fd_tower_sync_switch_t const * self ) {
    3125           0 :   ulong size = 0;
    3126           0 :   size += fd_tower_sync_size( &self->tower_sync );
    3127           0 :   size += fd_hash_size( &self->hash );
    3128           0 :   return size;
    3129           0 : }
    3130             : 
    3131           0 : int fd_slot_history_encode( fd_slot_history_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3132           0 :   int err;
    3133           0 :   err = fd_bincode_bool_encode( self->has_bits, ctx );
    3134           0 :   if( FD_UNLIKELY( err ) ) return err;
    3135           0 :   if( self->has_bits ) {
    3136           0 :     err = fd_bincode_uint64_encode( self->bits_bitvec_len, ctx );
    3137           0 :     if( FD_UNLIKELY(err) ) return err;
    3138           0 :     if( self->bits_bitvec_len ) {
    3139           0 :       for( ulong i=0; i < self->bits_bitvec_len; i++ ) {
    3140           0 :         err = fd_bincode_uint64_encode( self->bits_bitvec[i], ctx );
    3141           0 :       }
    3142           0 :     }
    3143           0 :     if( FD_UNLIKELY( err ) ) return err;
    3144           0 :   }
    3145           0 :   err = fd_bincode_uint64_encode( self->bits_len, ctx );
    3146           0 :   if( FD_UNLIKELY( err ) ) return err;
    3147           0 :   err = fd_bincode_uint64_encode( self->next_slot, ctx );
    3148           0 :   if( FD_UNLIKELY( err ) ) return err;
    3149           0 :   return FD_BINCODE_SUCCESS;
    3150           0 : }
    3151           0 : int fd_slot_history_encode_global( fd_slot_history_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3152           0 :   int err;
    3153           0 :   err = fd_bincode_bool_encode( self->has_bits, ctx );
    3154           0 :   if( FD_UNLIKELY( err ) ) return err;
    3155           0 :   if( self->has_bits ) {
    3156           0 :   if( FD_UNLIKELY( err ) ) return err;
    3157           0 :     err = fd_bincode_uint64_encode( self->bits_bitvec_len, ctx );
    3158           0 :     if( FD_UNLIKELY( err ) ) return err;
    3159           0 :     if( self->bits_bitvec_len ) {
    3160           0 :       uchar * bits_bitvec_laddr = (uchar*)self + self->bits_bitvec_offset;
    3161           0 :       ulong * bits_bitvec = (ulong *)bits_bitvec_laddr;
    3162           0 :       for( ulong i=0; i < self->bits_bitvec_len; i++ ) {
    3163           0 :         err = fd_bincode_uint64_encode( bits_bitvec[i], ctx );
    3164           0 :         if( FD_UNLIKELY( err ) ) return err;
    3165           0 :       }
    3166           0 :     }
    3167           0 :     if( FD_UNLIKELY( err ) ) return err;
    3168           0 :   }
    3169           0 :   err = fd_bincode_uint64_encode( self->bits_len, ctx );
    3170           0 :   if( FD_UNLIKELY( err ) ) return err;
    3171           0 :   err = fd_bincode_uint64_encode( self->next_slot, ctx );
    3172           0 :   if( FD_UNLIKELY( err ) ) return err;
    3173           0 :   return FD_BINCODE_SUCCESS;
    3174           0 : }
    3175           3 : static int fd_slot_history_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3176           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3177           3 :   int err = 0;
    3178           3 :   {
    3179           3 :     uchar o;
    3180           3 :     ulong inner_len = 0UL;
    3181           3 :     err = fd_bincode_bool_decode( &o, ctx );
    3182           3 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3183           3 :     if( o ) {
    3184           3 :       ulong bits_bitvec_len;
    3185           3 :       err = fd_bincode_uint64_decode( &bits_bitvec_len, ctx );
    3186           3 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3187           3 :       if( bits_bitvec_len ) {
    3188           3 :         *total_sz += 8UL + sizeof(ulong)*bits_bitvec_len;
    3189       49155 :         for( ulong i=0; i < bits_bitvec_len; i++ ) {
    3190       49152 :           err = fd_bincode_uint64_decode_footprint( ctx );
    3191       49152 :           if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3192       49152 :         }
    3193           3 :       }
    3194           3 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3195           3 :       inner_len = bits_bitvec_len;
    3196           3 :       if( inner_len==0 ) return FD_BINCODE_ERR_ENCODING;
    3197           3 :     }
    3198           3 :     ulong len;
    3199           3 :     err = fd_bincode_uint64_decode( &len, ctx );
    3200           3 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3201           3 :     if( len > inner_len * sizeof(ulong) * 8UL ) return FD_BINCODE_ERR_ENCODING;
    3202           3 :   }
    3203           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3204           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3205           3 :   return 0;
    3206           3 : }
    3207           3 : int fd_slot_history_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3208           3 :   *total_sz += sizeof(fd_slot_history_t);
    3209           3 :   void const * start_data = ctx->data;
    3210           3 :   int err = fd_slot_history_decode_footprint_inner( ctx, total_sz );
    3211           3 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3212           3 :   ctx->data = start_data;
    3213           3 :   return err;
    3214           3 : }
    3215           0 : static void fd_slot_history_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3216           0 :   fd_slot_history_t * self = (fd_slot_history_t *)struct_mem;
    3217           0 :   {
    3218           0 :     uchar o;
    3219           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    3220           0 :     self->has_bits = !!o;
    3221           0 :     if( o ) {
    3222           0 :       fd_bincode_uint64_decode_unsafe( &self->bits_bitvec_len, ctx );
    3223           0 :       if( self->bits_bitvec_len ) {
    3224           0 :         *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), 8UL );
    3225           0 :         self->bits_bitvec = *alloc_mem;
    3226           0 :         *alloc_mem = (uchar *)(*alloc_mem) + sizeof(ulong)*self->bits_bitvec_len;
    3227           0 :         for( ulong i=0; i < self->bits_bitvec_len; i++ ) {
    3228           0 :           fd_bincode_uint64_decode_unsafe( self->bits_bitvec + i, ctx );
    3229           0 :         }
    3230           0 :       } else
    3231           0 :         self->bits_bitvec = NULL;
    3232           0 :     } else {
    3233           0 :       self->bits_bitvec = NULL;
    3234           0 :     }
    3235           0 :     fd_bincode_uint64_decode_unsafe( &self->bits_len, ctx );
    3236           0 :   }
    3237           0 :   fd_bincode_uint64_decode_unsafe( &self->next_slot, ctx );
    3238           0 : }
    3239           0 : void * fd_slot_history_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3240           0 :   fd_slot_history_t * self = (fd_slot_history_t *)mem;
    3241           0 :   fd_slot_history_new( self );
    3242           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_history_t);
    3243           0 :   void * * alloc_mem = &alloc_region;
    3244           0 :   fd_slot_history_decode_inner( mem, alloc_mem, ctx );
    3245           0 :   return self;
    3246           0 : }
    3247           0 : static void fd_slot_history_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3248           0 :   fd_slot_history_global_t * self = (fd_slot_history_global_t *)struct_mem;
    3249           0 :   {
    3250           0 :     uchar o;
    3251           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    3252           0 :     self->has_bits = !!o;
    3253           0 :     if( o ) {
    3254           0 :       fd_bincode_uint64_decode_unsafe( &self->bits_bitvec_len, ctx );
    3255           0 :       if( self->bits_bitvec_len ) {
    3256           0 :         *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), 8UL );
    3257           0 :         self->bits_bitvec_offset = (ulong)*alloc_mem - (ulong)struct_mem;
    3258           0 :         uchar * cur_mem = (uchar *)(*alloc_mem);
    3259           0 :         *alloc_mem = (uchar *)(*alloc_mem) + sizeof(ulong)*self->bits_bitvec_len;
    3260           0 :         for( ulong i=0; i < self->bits_bitvec_len; i++ ) {
    3261           0 :           fd_bincode_uint64_decode_unsafe( (ulong*)(cur_mem + sizeof(ulong) * i), ctx );
    3262           0 :         }
    3263           0 :       } else {
    3264           0 :         self->bits_bitvec_offset = 0UL;
    3265           0 :       }
    3266           0 :     }
    3267           0 :     fd_bincode_uint64_decode_unsafe( &self->bits_len, ctx );
    3268           0 :   }
    3269           0 :   fd_bincode_uint64_decode_unsafe( &self->next_slot, ctx );
    3270           0 : }
    3271           0 : void * fd_slot_history_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3272           0 :   fd_slot_history_global_t * self = (fd_slot_history_global_t *)mem;
    3273           0 :   fd_slot_history_new( (fd_slot_history_t *)self );
    3274           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_history_global_t);
    3275           0 :   void * * alloc_mem = &alloc_region;
    3276           0 :   fd_slot_history_decode_inner_global( mem, alloc_mem, ctx );
    3277           0 :   return self;
    3278           0 : }
    3279           0 : void fd_slot_history_new(fd_slot_history_t * self) {
    3280           0 :   fd_memset( self, 0, sizeof(fd_slot_history_t) );
    3281           0 : }
    3282           0 : ulong fd_slot_history_size( fd_slot_history_t const * self ) {
    3283           0 :   ulong size = 0;
    3284           0 :   size += sizeof(char);
    3285           0 :   if( self->has_bits ) {
    3286           0 :     do {
    3287           0 :       size += sizeof(ulong);
    3288           0 :       size += self->bits_bitvec_len * sizeof(ulong);
    3289           0 :     } while(0);
    3290           0 :   }
    3291           0 :   size += sizeof(ulong);
    3292           0 :   size += sizeof(ulong);
    3293           0 :   return size;
    3294           0 : }
    3295             : 
    3296           0 : ulong fd_slot_history_size_global( fd_slot_history_global_t const * self ) {
    3297           0 :   ulong size = 0;
    3298           0 :   do {
    3299           0 :     size += sizeof(char);
    3300           0 :     if( self->has_bits ) {
    3301           0 :     do {
    3302           0 :       size += sizeof(ulong);
    3303           0 :     ulong * bits_bitvec = self->bits_bitvec_offset ? (ulong *)fd_type_pun( (uchar *)self + self->bits_bitvec_offset ) : NULL;
    3304           0 :       size += self->bits_bitvec_len * sizeof(ulong);
    3305           0 :     } while(0);
    3306           0 :     }
    3307           0 :   } while(0);
    3308           0 :   size += sizeof(ulong);
    3309           0 :   return size;
    3310           0 : }
    3311             : 
    3312           0 : int fd_slot_hash_encode( fd_slot_hash_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3313           0 :   int err;
    3314           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    3315           0 :   if( FD_UNLIKELY( err ) ) return err;
    3316           0 :   err = fd_hash_encode( &self->hash, ctx );
    3317           0 :   if( FD_UNLIKELY( err ) ) return err;
    3318           0 :   return FD_BINCODE_SUCCESS;
    3319           0 : }
    3320           0 : static inline int fd_slot_hash_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3321           0 :   if( (ulong)ctx->data + 40UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3322           0 :   ctx->data = (void *)( (ulong)ctx->data + 40UL );
    3323           0 :   return 0;
    3324           0 : }
    3325           0 : static void fd_slot_hash_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3326           0 :   fd_slot_hash_t * self = (fd_slot_hash_t *)struct_mem;
    3327           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    3328           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    3329           0 : }
    3330           0 : void * fd_slot_hash_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3331           0 :   fd_slot_hash_t * self = (fd_slot_hash_t *)mem;
    3332           0 :   fd_slot_hash_new( self );
    3333           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_hash_t);
    3334           0 :   void * * alloc_mem = &alloc_region;
    3335           0 :   fd_slot_hash_decode_inner( mem, alloc_mem, ctx );
    3336           0 :   return self;
    3337           0 : }
    3338           0 : int fd_slot_hashes_encode( fd_slot_hashes_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3339           0 :   int err;
    3340           0 :   if( self->hashes ) {
    3341           0 :     ulong hashes_len = deq_fd_slot_hash_t_cnt( self->hashes );
    3342           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3343           0 :     if( FD_UNLIKELY( err ) ) return err;
    3344           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 ) ) {
    3345           0 :       fd_slot_hash_t const * ele = deq_fd_slot_hash_t_iter_ele_const( self->hashes, iter );
    3346           0 :       err = fd_slot_hash_encode( ele, ctx );
    3347           0 :       if( FD_UNLIKELY( err ) ) return err;
    3348           0 :     }
    3349           0 :   } else {
    3350           0 :     ulong hashes_len = 0;
    3351           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3352           0 :     if( FD_UNLIKELY( err ) ) return err;
    3353           0 :   }
    3354           0 :   return FD_BINCODE_SUCCESS;
    3355           0 : }
    3356           0 : int fd_slot_hashes_encode_global( fd_slot_hashes_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3357           0 :   int err;
    3358           0 :   if( self->hashes_offset ) {
    3359           0 :   uchar * hashes_laddr = (uchar*)self + self->hashes_offset;
    3360           0 :    fd_slot_hash_t * hashes = deq_fd_slot_hash_t_join( hashes_laddr );
    3361           0 :     ulong hashes_len = deq_fd_slot_hash_t_cnt( hashes );
    3362           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3363           0 :     if( FD_UNLIKELY( err ) ) return err;
    3364           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 ) ) {
    3365           0 :       fd_slot_hash_t const * ele = deq_fd_slot_hash_t_iter_ele_const( hashes, iter );
    3366           0 :       err = fd_slot_hash_encode( ele, ctx );
    3367           0 :       if( FD_UNLIKELY( err ) ) return err;
    3368           0 :     }
    3369           0 :   } else {
    3370           0 :     ulong hashes_len = 0;
    3371           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3372           0 :     if( FD_UNLIKELY( err ) ) return err;
    3373           0 :   }
    3374           0 :   return FD_BINCODE_SUCCESS;
    3375           0 : }
    3376           3 : static int fd_slot_hashes_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3377           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3378           3 :   int err = 0;
    3379           3 :   ulong hashes_len;
    3380           3 :   err = fd_bincode_uint64_decode( &hashes_len, ctx );
    3381           3 :   if( FD_UNLIKELY( err ) ) return err;
    3382           3 :   ulong hashes_max = fd_ulong_max( hashes_len, 512 );
    3383           3 :   *total_sz += deq_fd_slot_hash_t_align() + deq_fd_slot_hash_t_footprint( hashes_max );
    3384           3 :   ulong hashes_sz;
    3385           3 :   if( FD_UNLIKELY( __builtin_umull_overflow( hashes_len, 40, &hashes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    3386           3 :   err = fd_bincode_bytes_decode_footprint( hashes_sz, ctx );
    3387           3 :   if( FD_UNLIKELY( err ) ) return err;
    3388           3 :   return 0;
    3389           3 : }
    3390           3 : int fd_slot_hashes_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3391           3 :   *total_sz += sizeof(fd_slot_hashes_t);
    3392           3 :   void const * start_data = ctx->data;
    3393           3 :   int err = fd_slot_hashes_decode_footprint_inner( ctx, total_sz );
    3394           3 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3395           3 :   ctx->data = start_data;
    3396           3 :   return err;
    3397           3 : }
    3398           0 : static void fd_slot_hashes_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3399           0 :   fd_slot_hashes_t * self = (fd_slot_hashes_t *)struct_mem;
    3400           0 :   ulong hashes_len;
    3401           0 :   fd_bincode_uint64_decode_unsafe( &hashes_len, ctx );
    3402           0 :   ulong hashes_max = fd_ulong_max( hashes_len, 512 );
    3403           0 :   self->hashes = deq_fd_slot_hash_t_join_new( alloc_mem, hashes_max );
    3404           0 :   for( ulong i=0; i < hashes_len; i++ ) {
    3405           0 :     fd_slot_hash_t * elem = deq_fd_slot_hash_t_push_tail_nocopy( self->hashes );
    3406           0 :     fd_slot_hash_new( elem );
    3407           0 :     fd_slot_hash_decode_inner( elem, alloc_mem, ctx );
    3408           0 :   }
    3409           0 : }
    3410           0 : void * fd_slot_hashes_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3411           0 :   fd_slot_hashes_t * self = (fd_slot_hashes_t *)mem;
    3412           0 :   fd_slot_hashes_new( self );
    3413           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_hashes_t);
    3414           0 :   void * * alloc_mem = &alloc_region;
    3415           0 :   fd_slot_hashes_decode_inner( mem, alloc_mem, ctx );
    3416           0 :   return self;
    3417           0 : }
    3418           0 : static void fd_slot_hashes_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3419           0 :   fd_slot_hashes_global_t * self = (fd_slot_hashes_global_t *)struct_mem;
    3420           0 :   ulong hashes_len;
    3421           0 :   fd_bincode_uint64_decode_unsafe( &hashes_len, ctx );
    3422           0 :   *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, deq_fd_slot_hash_t_align() );
    3423           0 :   ulong hashes_max = fd_ulong_max( hashes_len, 512 );
    3424           0 :   fd_slot_hash_t * hashes = deq_fd_slot_hash_t_join_new( alloc_mem, hashes_max );
    3425           0 :   for( ulong i=0; i < hashes_len; i++ ) {
    3426           0 :     fd_slot_hash_t * elem = deq_fd_slot_hash_t_push_tail_nocopy( hashes );
    3427           0 :     fd_slot_hash_new( (fd_slot_hash_t*)fd_type_pun( elem ) );
    3428           0 :     fd_slot_hash_decode_inner( elem, alloc_mem, ctx );
    3429           0 :   }
    3430           0 :   self->hashes_offset = (ulong)deq_fd_slot_hash_t_leave( hashes ) - (ulong)struct_mem;
    3431           0 : }
    3432           0 : void * fd_slot_hashes_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3433           0 :   fd_slot_hashes_global_t * self = (fd_slot_hashes_global_t *)mem;
    3434           0 :   fd_slot_hashes_new( (fd_slot_hashes_t *)self );
    3435           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_hashes_global_t);
    3436           0 :   void * * alloc_mem = &alloc_region;
    3437           0 :   fd_slot_hashes_decode_inner_global( mem, alloc_mem, ctx );
    3438           0 :   return self;
    3439           0 : }
    3440           0 : void fd_slot_hashes_new(fd_slot_hashes_t * self) {
    3441           0 :   fd_memset( self, 0, sizeof(fd_slot_hashes_t) );
    3442           0 : }
    3443           0 : ulong fd_slot_hashes_size( fd_slot_hashes_t const * self ) {
    3444           0 :   ulong size = 0;
    3445           0 :   if( self->hashes ) {
    3446           0 :     size += sizeof(ulong);
    3447           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 ) ) {
    3448           0 :       fd_slot_hash_t * ele = deq_fd_slot_hash_t_iter_ele( self->hashes, iter );
    3449           0 :       size += fd_slot_hash_size( ele );
    3450           0 :     }
    3451           0 :   } else {
    3452           0 :     size += sizeof(ulong);
    3453           0 :   }
    3454           0 :   return size;
    3455           0 : }
    3456             : 
    3457           0 : ulong fd_slot_hashes_size_global( fd_slot_hashes_global_t const * self ) {
    3458           0 :   ulong size = 0;
    3459           0 :   if( self->hashes_offset!=0 ) {
    3460           0 :     fd_slot_hash_t * hashes = (fd_slot_hash_t *)deq_fd_slot_hash_t_join( fd_type_pun( (uchar *)self + self->hashes_offset ) );
    3461           0 :     size += sizeof(ulong);
    3462           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 ) ) {
    3463           0 :       fd_slot_hash_t * ele = deq_fd_slot_hash_t_iter_ele( hashes, iter );
    3464           0 :       size += fd_slot_hash_size( ele );
    3465           0 :     }
    3466           0 :   } else {
    3467           0 :     size += sizeof(ulong);
    3468           0 :   }
    3469           0 :   return size;
    3470           0 : }
    3471             : 
    3472           0 : int fd_block_block_hash_entry_encode( fd_block_block_hash_entry_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3473           0 :   int err;
    3474           0 :   err = fd_hash_encode( &self->blockhash, ctx );
    3475           0 :   if( FD_UNLIKELY( err ) ) return err;
    3476           0 :   err = fd_fee_calculator_encode( &self->fee_calculator, ctx );
    3477           0 :   if( FD_UNLIKELY( err ) ) return err;
    3478           0 :   return FD_BINCODE_SUCCESS;
    3479           0 : }
    3480           0 : static inline int fd_block_block_hash_entry_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3481           0 :   if( (ulong)ctx->data + 40UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3482           0 :   ctx->data = (void *)( (ulong)ctx->data + 40UL );
    3483           0 :   return 0;
    3484           0 : }
    3485       33975 : static void fd_block_block_hash_entry_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3486       33975 :   fd_block_block_hash_entry_t * self = (fd_block_block_hash_entry_t *)struct_mem;
    3487       33975 :   fd_hash_decode_inner( &self->blockhash, alloc_mem, ctx );
    3488       33975 :   fd_fee_calculator_decode_inner( &self->fee_calculator, alloc_mem, ctx );
    3489       33975 : }
    3490           0 : void * fd_block_block_hash_entry_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3491           0 :   fd_block_block_hash_entry_t * self = (fd_block_block_hash_entry_t *)mem;
    3492           0 :   fd_block_block_hash_entry_new( self );
    3493           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_block_block_hash_entry_t);
    3494           0 :   void * * alloc_mem = &alloc_region;
    3495           0 :   fd_block_block_hash_entry_decode_inner( mem, alloc_mem, ctx );
    3496           0 :   return self;
    3497           0 : }
    3498           0 : int fd_recent_block_hashes_encode( fd_recent_block_hashes_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3499           0 :   int err;
    3500           0 :   if( self->hashes ) {
    3501           0 :     ulong hashes_len = deq_fd_block_block_hash_entry_t_cnt( self->hashes );
    3502           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3503           0 :     if( FD_UNLIKELY( err ) ) return err;
    3504           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 ) ) {
    3505           0 :       fd_block_block_hash_entry_t const * ele = deq_fd_block_block_hash_entry_t_iter_ele_const( self->hashes, iter );
    3506           0 :       err = fd_block_block_hash_entry_encode( ele, ctx );
    3507           0 :       if( FD_UNLIKELY( err ) ) return err;
    3508           0 :     }
    3509           0 :   } else {
    3510           0 :     ulong hashes_len = 0;
    3511           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3512           0 :     if( FD_UNLIKELY( err ) ) return err;
    3513           0 :   }
    3514           0 :   return FD_BINCODE_SUCCESS;
    3515           0 : }
    3516           0 : int fd_recent_block_hashes_encode_global( fd_recent_block_hashes_global_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3517           0 :   int err;
    3518           0 :   if( self->hashes_offset ) {
    3519           0 :   uchar * hashes_laddr = (uchar*)self + self->hashes_offset;
    3520           0 :    fd_block_block_hash_entry_t * hashes = deq_fd_block_block_hash_entry_t_join( hashes_laddr );
    3521           0 :     ulong hashes_len = deq_fd_block_block_hash_entry_t_cnt( hashes );
    3522           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3523           0 :     if( FD_UNLIKELY( err ) ) return err;
    3524           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 ) ) {
    3525           0 :       fd_block_block_hash_entry_t const * ele = deq_fd_block_block_hash_entry_t_iter_ele_const( hashes, iter );
    3526           0 :       err = fd_block_block_hash_entry_encode( ele, ctx );
    3527           0 :       if( FD_UNLIKELY( err ) ) return err;
    3528           0 :     }
    3529           0 :   } else {
    3530           0 :     ulong hashes_len = 0;
    3531           0 :     err = fd_bincode_uint64_encode( hashes_len, ctx );
    3532           0 :     if( FD_UNLIKELY( err ) ) return err;
    3533           0 :   }
    3534           0 :   return FD_BINCODE_SUCCESS;
    3535           0 : }
    3536         456 : static int fd_recent_block_hashes_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3537         456 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3538         456 :   int err = 0;
    3539         456 :   ulong hashes_len;
    3540         456 :   err = fd_bincode_uint64_decode( &hashes_len, ctx );
    3541         456 :   if( FD_UNLIKELY( err ) ) return err;
    3542         456 :   ulong hashes_max = fd_ulong_max( hashes_len, 151 );
    3543         456 :   *total_sz += deq_fd_block_block_hash_entry_t_align() + deq_fd_block_block_hash_entry_t_footprint( hashes_max );
    3544         456 :   ulong hashes_sz;
    3545         456 :   if( FD_UNLIKELY( __builtin_umull_overflow( hashes_len, 40, &hashes_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    3546         456 :   err = fd_bincode_bytes_decode_footprint( hashes_sz, ctx );
    3547         456 :   if( FD_UNLIKELY( err ) ) return err;
    3548         456 :   return 0;
    3549         456 : }
    3550         456 : int fd_recent_block_hashes_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3551         456 :   *total_sz += sizeof(fd_recent_block_hashes_t);
    3552         456 :   void const * start_data = ctx->data;
    3553         456 :   int err = fd_recent_block_hashes_decode_footprint_inner( ctx, total_sz );
    3554         456 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3555         456 :   ctx->data = start_data;
    3556         456 :   return err;
    3557         456 : }
    3558           0 : static void fd_recent_block_hashes_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3559           0 :   fd_recent_block_hashes_t * self = (fd_recent_block_hashes_t *)struct_mem;
    3560           0 :   ulong hashes_len;
    3561           0 :   fd_bincode_uint64_decode_unsafe( &hashes_len, ctx );
    3562           0 :   ulong hashes_max = fd_ulong_max( hashes_len, 151 );
    3563           0 :   self->hashes = deq_fd_block_block_hash_entry_t_join_new( alloc_mem, hashes_max );
    3564           0 :   for( ulong i=0; i < hashes_len; i++ ) {
    3565           0 :     fd_block_block_hash_entry_t * elem = deq_fd_block_block_hash_entry_t_push_tail_nocopy( self->hashes );
    3566           0 :     fd_block_block_hash_entry_new( elem );
    3567           0 :     fd_block_block_hash_entry_decode_inner( elem, alloc_mem, ctx );
    3568           0 :   }
    3569           0 : }
    3570           0 : void * fd_recent_block_hashes_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3571           0 :   fd_recent_block_hashes_t * self = (fd_recent_block_hashes_t *)mem;
    3572           0 :   fd_recent_block_hashes_new( self );
    3573           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_recent_block_hashes_t);
    3574           0 :   void * * alloc_mem = &alloc_region;
    3575           0 :   fd_recent_block_hashes_decode_inner( mem, alloc_mem, ctx );
    3576           0 :   return self;
    3577           0 : }
    3578         453 : static void fd_recent_block_hashes_decode_inner_global( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3579         453 :   fd_recent_block_hashes_global_t * self = (fd_recent_block_hashes_global_t *)struct_mem;
    3580         453 :   ulong hashes_len;
    3581         453 :   fd_bincode_uint64_decode_unsafe( &hashes_len, ctx );
    3582         453 :   *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, deq_fd_block_block_hash_entry_t_align() );
    3583         453 :   ulong hashes_max = fd_ulong_max( hashes_len, 151 );
    3584         453 :   fd_block_block_hash_entry_t * hashes = deq_fd_block_block_hash_entry_t_join_new( alloc_mem, hashes_max );
    3585       34428 :   for( ulong i=0; i < hashes_len; i++ ) {
    3586       33975 :     fd_block_block_hash_entry_t * elem = deq_fd_block_block_hash_entry_t_push_tail_nocopy( hashes );
    3587       33975 :     fd_block_block_hash_entry_new( (fd_block_block_hash_entry_t*)fd_type_pun( elem ) );
    3588       33975 :     fd_block_block_hash_entry_decode_inner( elem, alloc_mem, ctx );
    3589       33975 :   }
    3590         453 :   self->hashes_offset = (ulong)deq_fd_block_block_hash_entry_t_leave( hashes ) - (ulong)struct_mem;
    3591         453 : }
    3592         453 : void * fd_recent_block_hashes_decode_global( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3593         453 :   fd_recent_block_hashes_global_t * self = (fd_recent_block_hashes_global_t *)mem;
    3594         453 :   fd_recent_block_hashes_new( (fd_recent_block_hashes_t *)self );
    3595         453 :   void * alloc_region = (uchar *)mem + sizeof(fd_recent_block_hashes_global_t);
    3596         453 :   void * * alloc_mem = &alloc_region;
    3597         453 :   fd_recent_block_hashes_decode_inner_global( mem, alloc_mem, ctx );
    3598         453 :   return self;
    3599         453 : }
    3600         453 : void fd_recent_block_hashes_new(fd_recent_block_hashes_t * self) {
    3601         453 :   fd_memset( self, 0, sizeof(fd_recent_block_hashes_t) );
    3602         453 : }
    3603           0 : ulong fd_recent_block_hashes_size( fd_recent_block_hashes_t const * self ) {
    3604           0 :   ulong size = 0;
    3605           0 :   if( self->hashes ) {
    3606           0 :     size += sizeof(ulong);
    3607           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 ) ) {
    3608           0 :       fd_block_block_hash_entry_t * ele = deq_fd_block_block_hash_entry_t_iter_ele( self->hashes, iter );
    3609           0 :       size += fd_block_block_hash_entry_size( ele );
    3610           0 :     }
    3611           0 :   } else {
    3612           0 :     size += sizeof(ulong);
    3613           0 :   }
    3614           0 :   return size;
    3615           0 : }
    3616             : 
    3617           0 : ulong fd_recent_block_hashes_size_global( fd_recent_block_hashes_global_t const * self ) {
    3618           0 :   ulong size = 0;
    3619           0 :   if( self->hashes_offset!=0 ) {
    3620           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 ) );
    3621           0 :     size += sizeof(ulong);
    3622           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 ) ) {
    3623           0 :       fd_block_block_hash_entry_t * ele = deq_fd_block_block_hash_entry_t_iter_ele( hashes, iter );
    3624           0 :       size += fd_block_block_hash_entry_size( ele );
    3625           0 :     }
    3626           0 :   } else {
    3627           0 :     size += sizeof(ulong);
    3628           0 :   }
    3629           0 :   return size;
    3630           0 : }
    3631             : 
    3632           0 : int fd_slot_meta_encode( fd_slot_meta_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3633           0 :   int err;
    3634           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    3635           0 :   if( FD_UNLIKELY( err ) ) return err;
    3636           0 :   err = fd_bincode_uint64_encode( self->consumed, ctx );
    3637           0 :   if( FD_UNLIKELY( err ) ) return err;
    3638           0 :   err = fd_bincode_uint64_encode( self->received, ctx );
    3639           0 :   if( FD_UNLIKELY( err ) ) return err;
    3640           0 :   err = fd_bincode_uint64_encode( (ulong)self->first_shred_timestamp, ctx );
    3641           0 :   if( FD_UNLIKELY( err ) ) return err;
    3642           0 :   err = fd_bincode_uint64_encode( self->last_index, ctx );
    3643           0 :   if( FD_UNLIKELY( err ) ) return err;
    3644           0 :   err = fd_bincode_uint64_encode( self->parent_slot, ctx );
    3645           0 :   if( FD_UNLIKELY( err ) ) return err;
    3646           0 :   err = fd_bincode_uint64_encode( self->next_slot_len, ctx );
    3647           0 :   if( FD_UNLIKELY(err) ) return err;
    3648           0 :   if( self->next_slot_len ) {
    3649           0 :     for( ulong i=0; i < self->next_slot_len; i++ ) {
    3650           0 :       err = fd_bincode_uint64_encode( self->next_slot[i], ctx );
    3651           0 :     }
    3652           0 :   }
    3653           0 :   err = fd_bincode_uint8_encode( (uchar)(self->is_connected), ctx );
    3654           0 :   if( FD_UNLIKELY( err ) ) return err;
    3655           0 :   return FD_BINCODE_SUCCESS;
    3656           0 : }
    3657           0 : static int fd_slot_meta_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3658           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3659           0 :   int err = 0;
    3660           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3661           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3662           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3663           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3664           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3665           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3666           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3667           0 :   if( FD_UNLIKELY( err ) ) return err;
    3668           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3669           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3670           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3671           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3672           0 :   ulong next_slot_len;
    3673           0 :   err = fd_bincode_uint64_decode( &next_slot_len, ctx );
    3674           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3675           0 :   if( next_slot_len ) {
    3676           0 :     *total_sz += 8UL + sizeof(ulong)*next_slot_len;
    3677           0 :     for( ulong i=0; i < next_slot_len; i++ ) {
    3678           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
    3679           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3680           0 :     }
    3681           0 :   }
    3682           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    3683           0 :   if( FD_UNLIKELY( err ) ) return err;
    3684           0 :   return 0;
    3685           0 : }
    3686           0 : int fd_slot_meta_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3687           0 :   *total_sz += sizeof(fd_slot_meta_t);
    3688           0 :   void const * start_data = ctx->data;
    3689           0 :   int err = fd_slot_meta_decode_footprint_inner( ctx, total_sz );
    3690           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3691           0 :   ctx->data = start_data;
    3692           0 :   return err;
    3693           0 : }
    3694           0 : static void fd_slot_meta_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3695           0 :   fd_slot_meta_t * self = (fd_slot_meta_t *)struct_mem;
    3696           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    3697           0 :   fd_bincode_uint64_decode_unsafe( &self->consumed, ctx );
    3698           0 :   fd_bincode_uint64_decode_unsafe( &self->received, ctx );
    3699           0 :   fd_bincode_uint64_decode_unsafe( (ulong *) &self->first_shred_timestamp, ctx );
    3700           0 :   fd_bincode_uint64_decode_unsafe( &self->last_index, ctx );
    3701           0 :   fd_bincode_uint64_decode_unsafe( &self->parent_slot, ctx );
    3702           0 :   fd_bincode_uint64_decode_unsafe( &self->next_slot_len, ctx );
    3703           0 :   if( self->next_slot_len ) {
    3704           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), 8UL );
    3705           0 :     self->next_slot = *alloc_mem;
    3706           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(ulong)*self->next_slot_len;
    3707           0 :     for( ulong i=0; i < self->next_slot_len; i++ ) {
    3708           0 :       fd_bincode_uint64_decode_unsafe( self->next_slot + i, ctx );
    3709           0 :     }
    3710           0 :   } else
    3711           0 :     self->next_slot = NULL;
    3712           0 :   fd_bincode_uint8_decode_unsafe( &self->is_connected, ctx );
    3713           0 : }
    3714           0 : void * fd_slot_meta_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3715           0 :   fd_slot_meta_t * self = (fd_slot_meta_t *)mem;
    3716           0 :   fd_slot_meta_new( self );
    3717           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_slot_meta_t);
    3718           0 :   void * * alloc_mem = &alloc_region;
    3719           0 :   fd_slot_meta_decode_inner( mem, alloc_mem, ctx );
    3720           0 :   return self;
    3721           0 : }
    3722           0 : void fd_slot_meta_new(fd_slot_meta_t * self) {
    3723           0 :   fd_memset( self, 0, sizeof(fd_slot_meta_t) );
    3724           0 : }
    3725           0 : ulong fd_slot_meta_size( fd_slot_meta_t const * self ) {
    3726           0 :   ulong size = 0;
    3727           0 :   size += sizeof(ulong);
    3728           0 :   size += sizeof(ulong);
    3729           0 :   size += sizeof(ulong);
    3730           0 :   size += sizeof(long);
    3731           0 :   size += sizeof(ulong);
    3732           0 :   size += sizeof(ulong);
    3733           0 :   do {
    3734           0 :     size += sizeof(ulong);
    3735           0 :     size += self->next_slot_len * sizeof(ulong);
    3736           0 :   } while(0);
    3737           0 :   size += sizeof(char);
    3738           0 :   return size;
    3739           0 : }
    3740             : 
    3741           0 : int fd_sysvar_fees_encode( fd_sysvar_fees_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3742           0 :   int err;
    3743           0 :   err = fd_fee_calculator_encode( &self->fee_calculator, ctx );
    3744           0 :   if( FD_UNLIKELY( err ) ) return err;
    3745           0 :   return FD_BINCODE_SUCCESS;
    3746           0 : }
    3747           0 : static inline int fd_sysvar_fees_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3748           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3749           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
    3750           0 :   return 0;
    3751           0 : }
    3752           0 : static void fd_sysvar_fees_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3753           0 :   fd_sysvar_fees_t * self = (fd_sysvar_fees_t *)struct_mem;
    3754           0 :   fd_fee_calculator_decode_inner( &self->fee_calculator, alloc_mem, ctx );
    3755           0 : }
    3756           0 : void * fd_sysvar_fees_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3757           0 :   fd_sysvar_fees_t * self = (fd_sysvar_fees_t *)mem;
    3758           0 :   fd_sysvar_fees_new( self );
    3759           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_sysvar_fees_t);
    3760           0 :   void * * alloc_mem = &alloc_region;
    3761           0 :   fd_sysvar_fees_decode_inner( mem, alloc_mem, ctx );
    3762           0 :   return self;
    3763           0 : }
    3764           0 : int fd_sysvar_epoch_rewards_encode( fd_sysvar_epoch_rewards_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3765           0 :   int err;
    3766           0 :   err = fd_bincode_uint64_encode( self->distribution_starting_block_height, ctx );
    3767           0 :   if( FD_UNLIKELY( err ) ) return err;
    3768           0 :   err = fd_bincode_uint64_encode( self->num_partitions, ctx );
    3769           0 :   if( FD_UNLIKELY( err ) ) return err;
    3770           0 :   err = fd_hash_encode( &self->parent_blockhash, ctx );
    3771           0 :   if( FD_UNLIKELY( err ) ) return err;
    3772           0 :   err = fd_bincode_uint128_encode( self->total_points, ctx );
    3773           0 :   if( FD_UNLIKELY( err ) ) return err;
    3774           0 :   err = fd_bincode_uint64_encode( self->total_rewards, ctx );
    3775           0 :   if( FD_UNLIKELY( err ) ) return err;
    3776           0 :   err = fd_bincode_uint64_encode( self->distributed_rewards, ctx );
    3777           0 :   if( FD_UNLIKELY( err ) ) return err;
    3778           0 :   err = fd_bincode_bool_encode( (uchar)(self->active), ctx );
    3779           0 :   if( FD_UNLIKELY( err ) ) return err;
    3780           0 :   return FD_BINCODE_SUCCESS;
    3781           0 : }
    3782           3 : static int fd_sysvar_epoch_rewards_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3783           3 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3784           3 :   int err = 0;
    3785           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3786           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3787           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3788           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3789           3 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    3790           3 :   if( FD_UNLIKELY( err ) ) return err;
    3791           3 :   err = fd_bincode_uint128_decode_footprint( ctx );
    3792           3 :   if( FD_UNLIKELY( err ) ) return err;
    3793           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3794           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3795           3 :   err = fd_bincode_uint64_decode_footprint( ctx );
    3796           3 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3797           3 :   err = fd_bincode_bool_decode_footprint( ctx );
    3798           3 :   if( FD_UNLIKELY( err ) ) return err;
    3799           3 :   return 0;
    3800           3 : }
    3801           3 : int fd_sysvar_epoch_rewards_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3802           3 :   *total_sz += sizeof(fd_sysvar_epoch_rewards_t);
    3803           3 :   void const * start_data = ctx->data;
    3804           3 :   int err = fd_sysvar_epoch_rewards_decode_footprint_inner( ctx, total_sz );
    3805           3 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3806           3 :   ctx->data = start_data;
    3807           3 :   return err;
    3808           3 : }
    3809           0 : static void fd_sysvar_epoch_rewards_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3810           0 :   fd_sysvar_epoch_rewards_t * self = (fd_sysvar_epoch_rewards_t *)struct_mem;
    3811           0 :   fd_bincode_uint64_decode_unsafe( &self->distribution_starting_block_height, ctx );
    3812           0 :   fd_bincode_uint64_decode_unsafe( &self->num_partitions, ctx );
    3813           0 :   fd_hash_decode_inner( &self->parent_blockhash, alloc_mem, ctx );
    3814           0 :   fd_bincode_uint128_decode_unsafe( &self->total_points, ctx );
    3815           0 :   fd_bincode_uint64_decode_unsafe( &self->total_rewards, ctx );
    3816           0 :   fd_bincode_uint64_decode_unsafe( &self->distributed_rewards, ctx );
    3817           0 :   fd_bincode_bool_decode_unsafe( &self->active, ctx );
    3818           0 : }
    3819           0 : void * fd_sysvar_epoch_rewards_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3820           0 :   fd_sysvar_epoch_rewards_t * self = (fd_sysvar_epoch_rewards_t *)mem;
    3821           0 :   fd_sysvar_epoch_rewards_new( self );
    3822           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_sysvar_epoch_rewards_t);
    3823           0 :   void * * alloc_mem = &alloc_region;
    3824           0 :   fd_sysvar_epoch_rewards_decode_inner( mem, alloc_mem, ctx );
    3825           0 :   return self;
    3826           0 : }
    3827           0 : void fd_sysvar_epoch_rewards_new(fd_sysvar_epoch_rewards_t * self) {
    3828           0 :   fd_memset( self, 0, sizeof(fd_sysvar_epoch_rewards_t) );
    3829           0 :   fd_hash_new( &self->parent_blockhash );
    3830           0 : }
    3831           0 : int fd_config_keys_pair_encode( fd_config_keys_pair_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3832           0 :   int err;
    3833           0 :   err = fd_pubkey_encode( &self->key, ctx );
    3834           0 :   if( FD_UNLIKELY( err ) ) return err;
    3835           0 :   err = fd_bincode_bool_encode( (uchar)(self->signer), ctx );
    3836           0 :   if( FD_UNLIKELY( err ) ) return err;
    3837           0 :   return FD_BINCODE_SUCCESS;
    3838           0 : }
    3839           0 : static int fd_config_keys_pair_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3840           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3841           0 :   int err = 0;
    3842           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    3843           0 :   if( FD_UNLIKELY( err ) ) return err;
    3844           0 :   err = fd_bincode_bool_decode_footprint( ctx );
    3845           0 :   if( FD_UNLIKELY( err ) ) return err;
    3846           0 :   return 0;
    3847           0 : }
    3848           0 : int fd_config_keys_pair_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3849           0 :   *total_sz += sizeof(fd_config_keys_pair_t);
    3850           0 :   void const * start_data = ctx->data;
    3851           0 :   int err = fd_config_keys_pair_decode_footprint_inner( ctx, total_sz );
    3852           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3853           0 :   ctx->data = start_data;
    3854           0 :   return err;
    3855           0 : }
    3856           0 : static void fd_config_keys_pair_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3857           0 :   fd_config_keys_pair_t * self = (fd_config_keys_pair_t *)struct_mem;
    3858           0 :   fd_pubkey_decode_inner( &self->key, alloc_mem, ctx );
    3859           0 :   fd_bincode_bool_decode_unsafe( &self->signer, ctx );
    3860           0 : }
    3861           0 : void * fd_config_keys_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3862           0 :   fd_config_keys_pair_t * self = (fd_config_keys_pair_t *)mem;
    3863           0 :   fd_config_keys_pair_new( self );
    3864           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_config_keys_pair_t);
    3865           0 :   void * * alloc_mem = &alloc_region;
    3866           0 :   fd_config_keys_pair_decode_inner( mem, alloc_mem, ctx );
    3867           0 :   return self;
    3868           0 : }
    3869           0 : void fd_config_keys_pair_new(fd_config_keys_pair_t * self) {
    3870           0 :   fd_memset( self, 0, sizeof(fd_config_keys_pair_t) );
    3871           0 :   fd_pubkey_new( &self->key );
    3872           0 : }
    3873          12 : int fd_stake_config_encode( fd_stake_config_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    3874          12 :   int err;
    3875          12 :   err = fd_bincode_compact_u16_encode( &self->config_keys_len, ctx );
    3876          12 :   if( FD_UNLIKELY(err) ) return err;
    3877          12 :   if( self->config_keys_len ) {
    3878           0 :     for( ulong i=0; i < self->config_keys_len; i++ ) {
    3879           0 :       err = fd_config_keys_pair_encode( self->config_keys + i, ctx );
    3880           0 :       if( FD_UNLIKELY( err ) ) return err;
    3881           0 :     }
    3882           0 :   }
    3883          12 :   err = fd_bincode_double_encode( self->warmup_cooldown_rate, ctx );
    3884          12 :   if( FD_UNLIKELY( err ) ) return err;
    3885          12 :   err = fd_bincode_uint8_encode( (uchar)(self->slash_penalty), ctx );
    3886          12 :   if( FD_UNLIKELY( err ) ) return err;
    3887          12 :   return FD_BINCODE_SUCCESS;
    3888          12 : }
    3889           0 : static int fd_stake_config_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3890           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3891           0 :   int err = 0;
    3892           0 :   ushort config_keys_len;
    3893           0 :   err = fd_bincode_compact_u16_decode( &config_keys_len, ctx );
    3894           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3895           0 :   if( config_keys_len ) {
    3896           0 :     *total_sz += FD_CONFIG_KEYS_PAIR_ALIGN + sizeof(fd_config_keys_pair_t)*config_keys_len;
    3897           0 :     for( ulong i=0; i < config_keys_len; i++ ) {
    3898           0 :       err = fd_config_keys_pair_decode_footprint_inner( ctx, total_sz );
    3899           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    3900           0 :     }
    3901           0 :   }
    3902           0 :   err = fd_bincode_double_decode_footprint( ctx );
    3903           0 :   if( FD_UNLIKELY( err ) ) return err;
    3904           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    3905           0 :   if( FD_UNLIKELY( err ) ) return err;
    3906           0 :   return 0;
    3907           0 : }
    3908           0 : int fd_stake_config_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3909           0 :   *total_sz += sizeof(fd_stake_config_t);
    3910           0 :   void const * start_data = ctx->data;
    3911           0 :   int err = fd_stake_config_decode_footprint_inner( ctx, total_sz );
    3912           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3913           0 :   ctx->data = start_data;
    3914           0 :   return err;
    3915           0 : }
    3916           0 : static void fd_stake_config_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    3917           0 :   fd_stake_config_t * self = (fd_stake_config_t *)struct_mem;
    3918           0 :   fd_bincode_compact_u16_decode_unsafe( &self->config_keys_len, ctx );
    3919           0 :   if( self->config_keys_len ) {
    3920           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_CONFIG_KEYS_PAIR_ALIGN );
    3921           0 :     self->config_keys = *alloc_mem;
    3922           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_config_keys_pair_t)*self->config_keys_len;
    3923           0 :     for( ulong i=0; i < self->config_keys_len; i++ ) {
    3924           0 :       fd_config_keys_pair_new( self->config_keys + i );
    3925           0 :       fd_config_keys_pair_decode_inner( self->config_keys + i, alloc_mem, ctx );
    3926           0 :     }
    3927           0 :   } else
    3928           0 :     self->config_keys = NULL;
    3929           0 :   fd_bincode_double_decode_unsafe( &self->warmup_cooldown_rate, ctx );
    3930           0 :   fd_bincode_uint8_decode_unsafe( &self->slash_penalty, ctx );
    3931           0 : }
    3932           0 : void * fd_stake_config_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    3933           0 :   fd_stake_config_t * self = (fd_stake_config_t *)mem;
    3934           0 :   fd_stake_config_new( self );
    3935           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_config_t);
    3936           0 :   void * * alloc_mem = &alloc_region;
    3937           0 :   fd_stake_config_decode_inner( mem, alloc_mem, ctx );
    3938           0 :   return self;
    3939           0 : }
    3940           0 : void fd_stake_config_new(fd_stake_config_t * self) {
    3941           0 :   fd_memset( self, 0, sizeof(fd_stake_config_t) );
    3942           0 : }
    3943           0 : ulong fd_stake_config_size( fd_stake_config_t const * self ) {
    3944           0 :   ulong size = 0;
    3945           0 :   do {
    3946           0 :     ushort tmp = (ushort)self->config_keys_len;
    3947           0 :     size += fd_bincode_compact_u16_size( &tmp );
    3948           0 :     for( ulong i=0; i < self->config_keys_len; i++ )
    3949           0 :       size += fd_config_keys_pair_size( self->config_keys + i );
    3950           0 :   } while(0);
    3951           0 :   size += sizeof(double);
    3952           0 :   size += sizeof(char);
    3953           0 :   return size;
    3954           0 : }
    3955             : 
    3956           0 : FD_FN_PURE uchar fd_cluster_type_is_Testnet(fd_cluster_type_t const * self) {
    3957           0 :   return self->discriminant == 0;
    3958           0 : }
    3959           0 : FD_FN_PURE uchar fd_cluster_type_is_MainnetBeta(fd_cluster_type_t const * self) {
    3960           0 :   return self->discriminant == 1;
    3961           0 : }
    3962           0 : FD_FN_PURE uchar fd_cluster_type_is_Devnet(fd_cluster_type_t const * self) {
    3963           0 :   return self->discriminant == 2;
    3964           0 : }
    3965           0 : FD_FN_PURE uchar fd_cluster_type_is_Development(fd_cluster_type_t const * self) {
    3966           0 :   return self->discriminant == 3;
    3967           0 : }
    3968           0 : int fd_cluster_type_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3969           0 :   int err;
    3970           0 :   switch (discriminant) {
    3971           0 :   case 0: {
    3972           0 :     return FD_BINCODE_SUCCESS;
    3973           0 :   }
    3974           0 :   case 1: {
    3975           0 :     return FD_BINCODE_SUCCESS;
    3976           0 :   }
    3977           0 :   case 2: {
    3978           0 :     return FD_BINCODE_SUCCESS;
    3979           0 :   }
    3980           0 :   case 3: {
    3981           0 :     return FD_BINCODE_SUCCESS;
    3982           0 :   }
    3983           0 :   default: return FD_BINCODE_ERR_ENCODING;
    3984           0 :   }
    3985           0 : }
    3986           0 : static int fd_cluster_type_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3987           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3988           0 :   uint discriminant = 0;
    3989           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    3990           0 :   if( FD_UNLIKELY( err ) ) return err;
    3991           0 :   return fd_cluster_type_inner_decode_footprint( discriminant, ctx, total_sz );
    3992           0 : }
    3993           0 : int fd_cluster_type_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    3994           0 :   *total_sz += sizeof(fd_cluster_type_t);
    3995           0 :   void const * start_data = ctx->data;
    3996           0 :   int err =  fd_cluster_type_decode_footprint_inner( ctx, total_sz );
    3997           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    3998           0 :   ctx->data = start_data;
    3999           0 :   return err;
    4000           0 : }
    4001           0 : static void fd_cluster_type_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4002           0 :   fd_cluster_type_t * self = (fd_cluster_type_t *)struct_mem;
    4003           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    4004           0 : }
    4005           0 : void * fd_cluster_type_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4006           0 :   fd_cluster_type_t * self = (fd_cluster_type_t *)mem;
    4007           0 :   fd_cluster_type_new( self );
    4008           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_cluster_type_t);
    4009           0 :   void * * alloc_mem = &alloc_region;
    4010           0 :   fd_cluster_type_decode_inner( mem, alloc_mem, ctx );
    4011           0 :   return self;
    4012           0 : }
    4013             : 
    4014           0 : ulong fd_cluster_type_size( fd_cluster_type_t const * self ) {
    4015           0 :   ulong size = 0;
    4016           0 :   size += sizeof(uint);
    4017           0 :   switch (self->discriminant) {
    4018           0 :   }
    4019           0 :   return size;
    4020           0 : }
    4021             : 
    4022           0 : int fd_cluster_type_encode( fd_cluster_type_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4023           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    4024           0 :   if( FD_UNLIKELY( err ) ) return err;
    4025           0 :   return err;
    4026           0 : }
    4027             : 
    4028           0 : int fd_cluster_version_encode( fd_cluster_version_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4029           0 :   int err;
    4030           0 :   err = fd_bincode_uint32_encode( self->major, ctx );
    4031           0 :   if( FD_UNLIKELY( err ) ) return err;
    4032           0 :   err = fd_bincode_uint32_encode( self->minor, ctx );
    4033           0 :   if( FD_UNLIKELY( err ) ) return err;
    4034           0 :   err = fd_bincode_uint32_encode( self->patch, ctx );
    4035           0 :   if( FD_UNLIKELY( err ) ) return err;
    4036           0 :   return FD_BINCODE_SUCCESS;
    4037           0 : }
    4038           0 : static inline int fd_cluster_version_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4039           0 :   if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4040           0 :   ctx->data = (void *)( (ulong)ctx->data + 12UL );
    4041           0 :   return 0;
    4042           0 : }
    4043           0 : static void fd_cluster_version_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4044           0 :   fd_cluster_version_t * self = (fd_cluster_version_t *)struct_mem;
    4045           0 :   fd_bincode_uint32_decode_unsafe( &self->major, ctx );
    4046           0 :   fd_bincode_uint32_decode_unsafe( &self->minor, ctx );
    4047           0 :   fd_bincode_uint32_decode_unsafe( &self->patch, ctx );
    4048           0 : }
    4049           0 : void * fd_cluster_version_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4050           0 :   fd_cluster_version_t * self = (fd_cluster_version_t *)mem;
    4051           0 :   fd_cluster_version_new( self );
    4052           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_cluster_version_t);
    4053           0 :   void * * alloc_mem = &alloc_region;
    4054           0 :   fd_cluster_version_decode_inner( mem, alloc_mem, ctx );
    4055           0 :   return self;
    4056           0 : }
    4057           0 : int fd_vote_encode( fd_vote_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4058           0 :   int err;
    4059           0 :   if( self->slots ) {
    4060           0 :     ulong slots_len = deq_ulong_cnt( self->slots );
    4061           0 :     err = fd_bincode_uint64_encode( slots_len, ctx );
    4062           0 :     if( FD_UNLIKELY( err ) ) return err;
    4063           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 ) ) {
    4064           0 :       ulong const * ele = deq_ulong_iter_ele_const( self->slots, iter );
    4065           0 :       err = fd_bincode_uint64_encode( ele[0], ctx );
    4066           0 :     }
    4067           0 :   } else {
    4068           0 :     ulong slots_len = 0;
    4069           0 :     err = fd_bincode_uint64_encode( slots_len, ctx );
    4070           0 :     if( FD_UNLIKELY( err ) ) return err;
    4071           0 :   }
    4072           0 :   err = fd_hash_encode( &self->hash, ctx );
    4073           0 :   if( FD_UNLIKELY( err ) ) return err;
    4074           0 :   err = fd_bincode_bool_encode( self->has_timestamp, ctx );
    4075           0 :   if( FD_UNLIKELY( err ) ) return err;
    4076           0 :   if( self->has_timestamp ) {
    4077           0 :     err = fd_bincode_int64_encode( self->timestamp, ctx );
    4078           0 :     if( FD_UNLIKELY( err ) ) return err;
    4079           0 :   }
    4080           0 :   return FD_BINCODE_SUCCESS;
    4081           0 : }
    4082           0 : static int fd_vote_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4083           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4084           0 :   int err = 0;
    4085           0 :   ulong slots_len;
    4086           0 :   err = fd_bincode_uint64_decode( &slots_len, ctx );
    4087           0 :   if( FD_UNLIKELY( err ) ) return err;
    4088           0 :   ulong slots_max = slots_len == 0 ? 1 : slots_len;
    4089           0 :   *total_sz += deq_ulong_align() + deq_ulong_footprint( slots_max ) ;
    4090           0 :   ulong slots_sz;
    4091           0 :   if( FD_UNLIKELY( __builtin_umull_overflow( slots_len, 8, &slots_sz ) ) ) return FD_BINCODE_ERR_UNDERFLOW;
    4092           0 :   err = fd_bincode_bytes_decode_footprint( slots_sz, ctx );
    4093           0 :   if( FD_UNLIKELY( err ) ) return err;
    4094           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    4095           0 :   if( FD_UNLIKELY( err ) ) return err;
    4096           0 :   {
    4097           0 :     uchar o;
    4098           0 :     err = fd_bincode_bool_decode( &o, ctx );
    4099           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4100           0 :     if( o ) {
    4101           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    4102           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4103           0 :     }
    4104           0 :   }
    4105           0 :   return 0;
    4106           0 : }
    4107           0 : int fd_vote_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4108           0 :   *total_sz += sizeof(fd_vote_t);
    4109           0 :   void const * start_data = ctx->data;
    4110           0 :   int err = fd_vote_decode_footprint_inner( ctx, total_sz );
    4111           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4112           0 :   ctx->data = start_data;
    4113           0 :   return err;
    4114           0 : }
    4115           0 : static void fd_vote_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4116           0 :   fd_vote_t * self = (fd_vote_t *)struct_mem;
    4117           0 :   ulong slots_len;
    4118           0 :   fd_bincode_uint64_decode_unsafe( &slots_len, ctx );
    4119           0 :   self->slots = deq_ulong_join_new( alloc_mem, slots_len );
    4120           0 :   for( ulong i=0; i < slots_len; i++ ) {
    4121           0 :     ulong * elem = deq_ulong_push_tail_nocopy( self->slots );
    4122           0 :     fd_bincode_uint64_decode_unsafe( elem, ctx );
    4123           0 :   }
    4124           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    4125           0 :   {
    4126           0 :     uchar o;
    4127           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    4128           0 :     self->has_timestamp = !!o;
    4129           0 :     if( o ) {
    4130           0 :       fd_bincode_int64_decode_unsafe( &self->timestamp, ctx );
    4131           0 :     }
    4132           0 :   }
    4133           0 : }
    4134           0 : void * fd_vote_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4135           0 :   fd_vote_t * self = (fd_vote_t *)mem;
    4136           0 :   fd_vote_new( self );
    4137           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_t);
    4138           0 :   void * * alloc_mem = &alloc_region;
    4139           0 :   fd_vote_decode_inner( mem, alloc_mem, ctx );
    4140           0 :   return self;
    4141           0 : }
    4142           0 : void fd_vote_new(fd_vote_t * self) {
    4143           0 :   fd_memset( self, 0, sizeof(fd_vote_t) );
    4144           0 :   fd_hash_new( &self->hash );
    4145           0 : }
    4146           0 : ulong fd_vote_size( fd_vote_t const * self ) {
    4147           0 :   ulong size = 0;
    4148           0 :   if( self->slots ) {
    4149           0 :     size += sizeof(ulong);
    4150           0 :     ulong slots_len = deq_ulong_cnt(self->slots);
    4151           0 :     size += slots_len * sizeof(ulong);
    4152           0 :   } else {
    4153           0 :     size += sizeof(ulong);
    4154           0 :   }
    4155           0 :   size += fd_hash_size( &self->hash );
    4156           0 :   size += sizeof(char);
    4157           0 :   if( self->has_timestamp ) {
    4158           0 :     size += sizeof(long);
    4159           0 :   }
    4160           0 :   return size;
    4161           0 : }
    4162             : 
    4163           0 : int fd_vote_init_encode( fd_vote_init_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4164           0 :   int err;
    4165           0 :   err = fd_pubkey_encode( &self->node_pubkey, ctx );
    4166           0 :   if( FD_UNLIKELY( err ) ) return err;
    4167           0 :   err = fd_pubkey_encode( &self->authorized_voter, ctx );
    4168           0 :   if( FD_UNLIKELY( err ) ) return err;
    4169           0 :   err = fd_pubkey_encode( &self->authorized_withdrawer, ctx );
    4170           0 :   if( FD_UNLIKELY( err ) ) return err;
    4171           0 :   err = fd_bincode_uint8_encode( (uchar)(self->commission), ctx );
    4172           0 :   if( FD_UNLIKELY( err ) ) return err;
    4173           0 :   return FD_BINCODE_SUCCESS;
    4174           0 : }
    4175           0 : static inline int fd_vote_init_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4176           0 :   if( (ulong)ctx->data + 97UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4177           0 :   ctx->data = (void *)( (ulong)ctx->data + 97UL );
    4178           0 :   return 0;
    4179           0 : }
    4180           0 : static void fd_vote_init_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4181           0 :   fd_vote_init_t * self = (fd_vote_init_t *)struct_mem;
    4182           0 :   fd_pubkey_decode_inner( &self->node_pubkey, alloc_mem, ctx );
    4183           0 :   fd_pubkey_decode_inner( &self->authorized_voter, alloc_mem, ctx );
    4184           0 :   fd_pubkey_decode_inner( &self->authorized_withdrawer, alloc_mem, ctx );
    4185           0 :   fd_bincode_uint8_decode_unsafe( &self->commission, ctx );
    4186           0 : }
    4187           0 : void * fd_vote_init_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4188           0 :   fd_vote_init_t * self = (fd_vote_init_t *)mem;
    4189           0 :   fd_vote_init_new( self );
    4190           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_init_t);
    4191           0 :   void * * alloc_mem = &alloc_region;
    4192           0 :   fd_vote_init_decode_inner( mem, alloc_mem, ctx );
    4193           0 :   return self;
    4194           0 : }
    4195           0 : FD_FN_PURE uchar fd_vote_authorize_is_voter(fd_vote_authorize_t const * self) {
    4196           0 :   return self->discriminant == 0;
    4197           0 : }
    4198           0 : FD_FN_PURE uchar fd_vote_authorize_is_withdrawer(fd_vote_authorize_t const * self) {
    4199           0 :   return self->discriminant == 1;
    4200           0 : }
    4201           0 : int fd_vote_authorize_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4202           0 :   int err;
    4203           0 :   switch (discriminant) {
    4204           0 :   case 0: {
    4205           0 :     return FD_BINCODE_SUCCESS;
    4206           0 :   }
    4207           0 :   case 1: {
    4208           0 :     return FD_BINCODE_SUCCESS;
    4209           0 :   }
    4210           0 :   default: return FD_BINCODE_ERR_ENCODING;
    4211           0 :   }
    4212           0 : }
    4213           0 : static int fd_vote_authorize_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4214           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4215           0 :   uint discriminant = 0;
    4216           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    4217           0 :   if( FD_UNLIKELY( err ) ) return err;
    4218           0 :   return fd_vote_authorize_inner_decode_footprint( discriminant, ctx, total_sz );
    4219           0 : }
    4220           0 : int fd_vote_authorize_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4221           0 :   *total_sz += sizeof(fd_vote_authorize_t);
    4222           0 :   void const * start_data = ctx->data;
    4223           0 :   int err =  fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4224           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4225           0 :   ctx->data = start_data;
    4226           0 :   return err;
    4227           0 : }
    4228           0 : static void fd_vote_authorize_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4229           0 :   fd_vote_authorize_t * self = (fd_vote_authorize_t *)struct_mem;
    4230           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    4231           0 : }
    4232           0 : void * fd_vote_authorize_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4233           0 :   fd_vote_authorize_t * self = (fd_vote_authorize_t *)mem;
    4234           0 :   fd_vote_authorize_new( self );
    4235           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorize_t);
    4236           0 :   void * * alloc_mem = &alloc_region;
    4237           0 :   fd_vote_authorize_decode_inner( mem, alloc_mem, ctx );
    4238           0 :   return self;
    4239           0 : }
    4240             : 
    4241           0 : ulong fd_vote_authorize_size( fd_vote_authorize_t const * self ) {
    4242           0 :   ulong size = 0;
    4243           0 :   size += sizeof(uint);
    4244           0 :   switch (self->discriminant) {
    4245           0 :   }
    4246           0 :   return size;
    4247           0 : }
    4248             : 
    4249           0 : int fd_vote_authorize_encode( fd_vote_authorize_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4250           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    4251           0 :   if( FD_UNLIKELY( err ) ) return err;
    4252           0 :   return err;
    4253           0 : }
    4254             : 
    4255           0 : int fd_vote_authorize_pubkey_encode( fd_vote_authorize_pubkey_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4256           0 :   int err;
    4257           0 :   err = fd_pubkey_encode( &self->pubkey, ctx );
    4258           0 :   if( FD_UNLIKELY( err ) ) return err;
    4259           0 :   err = fd_vote_authorize_encode( &self->vote_authorize, ctx );
    4260           0 :   if( FD_UNLIKELY( err ) ) return err;
    4261           0 :   return FD_BINCODE_SUCCESS;
    4262           0 : }
    4263           0 : static int fd_vote_authorize_pubkey_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4264           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4265           0 :   int err = 0;
    4266           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    4267           0 :   if( FD_UNLIKELY( err ) ) return err;
    4268           0 :   err = fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4269           0 :   if( FD_UNLIKELY( err ) ) return err;
    4270           0 :   return 0;
    4271           0 : }
    4272           0 : int fd_vote_authorize_pubkey_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4273           0 :   *total_sz += sizeof(fd_vote_authorize_pubkey_t);
    4274           0 :   void const * start_data = ctx->data;
    4275           0 :   int err = fd_vote_authorize_pubkey_decode_footprint_inner( ctx, total_sz );
    4276           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4277           0 :   ctx->data = start_data;
    4278           0 :   return err;
    4279           0 : }
    4280           0 : static void fd_vote_authorize_pubkey_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4281           0 :   fd_vote_authorize_pubkey_t * self = (fd_vote_authorize_pubkey_t *)struct_mem;
    4282           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
    4283           0 :   fd_vote_authorize_decode_inner( &self->vote_authorize, alloc_mem, ctx );
    4284           0 : }
    4285           0 : void * fd_vote_authorize_pubkey_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4286           0 :   fd_vote_authorize_pubkey_t * self = (fd_vote_authorize_pubkey_t *)mem;
    4287           0 :   fd_vote_authorize_pubkey_new( self );
    4288           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorize_pubkey_t);
    4289           0 :   void * * alloc_mem = &alloc_region;
    4290           0 :   fd_vote_authorize_pubkey_decode_inner( mem, alloc_mem, ctx );
    4291           0 :   return self;
    4292           0 : }
    4293           0 : void fd_vote_authorize_pubkey_new(fd_vote_authorize_pubkey_t * self) {
    4294           0 :   fd_memset( self, 0, sizeof(fd_vote_authorize_pubkey_t) );
    4295           0 :   fd_pubkey_new( &self->pubkey );
    4296           0 :   fd_vote_authorize_new( &self->vote_authorize );
    4297           0 : }
    4298           0 : int fd_vote_switch_encode( fd_vote_switch_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4299           0 :   int err;
    4300           0 :   err = fd_vote_encode( &self->vote, ctx );
    4301           0 :   if( FD_UNLIKELY( err ) ) return err;
    4302           0 :   err = fd_hash_encode( &self->hash, ctx );
    4303           0 :   if( FD_UNLIKELY( err ) ) return err;
    4304           0 :   return FD_BINCODE_SUCCESS;
    4305           0 : }
    4306           0 : static int fd_vote_switch_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4307           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4308           0 :   int err = 0;
    4309           0 :   err = fd_vote_decode_footprint_inner( ctx, total_sz );
    4310           0 :   if( FD_UNLIKELY( err ) ) return err;
    4311           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    4312           0 :   if( FD_UNLIKELY( err ) ) return err;
    4313           0 :   return 0;
    4314           0 : }
    4315           0 : int fd_vote_switch_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4316           0 :   *total_sz += sizeof(fd_vote_switch_t);
    4317           0 :   void const * start_data = ctx->data;
    4318           0 :   int err = fd_vote_switch_decode_footprint_inner( ctx, total_sz );
    4319           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4320           0 :   ctx->data = start_data;
    4321           0 :   return err;
    4322           0 : }
    4323           0 : static void fd_vote_switch_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4324           0 :   fd_vote_switch_t * self = (fd_vote_switch_t *)struct_mem;
    4325           0 :   fd_vote_decode_inner( &self->vote, alloc_mem, ctx );
    4326           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    4327           0 : }
    4328           0 : void * fd_vote_switch_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4329           0 :   fd_vote_switch_t * self = (fd_vote_switch_t *)mem;
    4330           0 :   fd_vote_switch_new( self );
    4331           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_switch_t);
    4332           0 :   void * * alloc_mem = &alloc_region;
    4333           0 :   fd_vote_switch_decode_inner( mem, alloc_mem, ctx );
    4334           0 :   return self;
    4335           0 : }
    4336           0 : void fd_vote_switch_new(fd_vote_switch_t * self) {
    4337           0 :   fd_memset( self, 0, sizeof(fd_vote_switch_t) );
    4338           0 :   fd_vote_new( &self->vote );
    4339           0 :   fd_hash_new( &self->hash );
    4340           0 : }
    4341           0 : ulong fd_vote_switch_size( fd_vote_switch_t const * self ) {
    4342           0 :   ulong size = 0;
    4343           0 :   size += fd_vote_size( &self->vote );
    4344           0 :   size += fd_hash_size( &self->hash );
    4345           0 :   return size;
    4346           0 : }
    4347             : 
    4348           0 : int fd_update_vote_state_switch_encode( fd_update_vote_state_switch_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4349           0 :   int err;
    4350           0 :   err = fd_vote_state_update_encode( &self->vote_state_update, ctx );
    4351           0 :   if( FD_UNLIKELY( err ) ) return err;
    4352           0 :   err = fd_hash_encode( &self->hash, ctx );
    4353           0 :   if( FD_UNLIKELY( err ) ) return err;
    4354           0 :   return FD_BINCODE_SUCCESS;
    4355           0 : }
    4356           0 : static int fd_update_vote_state_switch_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4357           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4358           0 :   int err = 0;
    4359           0 :   err = fd_vote_state_update_decode_footprint_inner( ctx, total_sz );
    4360           0 :   if( FD_UNLIKELY( err ) ) return err;
    4361           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    4362           0 :   if( FD_UNLIKELY( err ) ) return err;
    4363           0 :   return 0;
    4364           0 : }
    4365           0 : int fd_update_vote_state_switch_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4366           0 :   *total_sz += sizeof(fd_update_vote_state_switch_t);
    4367           0 :   void const * start_data = ctx->data;
    4368           0 :   int err = fd_update_vote_state_switch_decode_footprint_inner( ctx, total_sz );
    4369           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4370           0 :   ctx->data = start_data;
    4371           0 :   return err;
    4372           0 : }
    4373           0 : static void fd_update_vote_state_switch_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4374           0 :   fd_update_vote_state_switch_t * self = (fd_update_vote_state_switch_t *)struct_mem;
    4375           0 :   fd_vote_state_update_decode_inner( &self->vote_state_update, alloc_mem, ctx );
    4376           0 :   fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
    4377           0 : }
    4378           0 : void * fd_update_vote_state_switch_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4379           0 :   fd_update_vote_state_switch_t * self = (fd_update_vote_state_switch_t *)mem;
    4380           0 :   fd_update_vote_state_switch_new( self );
    4381           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_update_vote_state_switch_t);
    4382           0 :   void * * alloc_mem = &alloc_region;
    4383           0 :   fd_update_vote_state_switch_decode_inner( mem, alloc_mem, ctx );
    4384           0 :   return self;
    4385           0 : }
    4386           0 : void fd_update_vote_state_switch_new(fd_update_vote_state_switch_t * self) {
    4387           0 :   fd_memset( self, 0, sizeof(fd_update_vote_state_switch_t) );
    4388           0 :   fd_vote_state_update_new( &self->vote_state_update );
    4389           0 :   fd_hash_new( &self->hash );
    4390           0 : }
    4391           0 : ulong fd_update_vote_state_switch_size( fd_update_vote_state_switch_t const * self ) {
    4392           0 :   ulong size = 0;
    4393           0 :   size += fd_vote_state_update_size( &self->vote_state_update );
    4394           0 :   size += fd_hash_size( &self->hash );
    4395           0 :   return size;
    4396           0 : }
    4397             : 
    4398           0 : int fd_vote_authorize_with_seed_args_encode( fd_vote_authorize_with_seed_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    4399           0 :   int err;
    4400           0 :   err = fd_vote_authorize_encode( &self->authorization_type, ctx );
    4401           0 :   if( FD_UNLIKELY( err ) ) return err;
    4402           0 :   err = fd_pubkey_encode( &self->current_authority_derived_key_owner, ctx );
    4403           0 :   if( FD_UNLIKELY( err ) ) return err;
    4404           0 :   err = fd_bincode_uint64_encode( self->current_authority_derived_key_seed_len, ctx );
    4405           0 :   if( FD_UNLIKELY(err) ) return err;
    4406           0 :   if( self->current_authority_derived_key_seed_len ) {
    4407           0 :     err = fd_bincode_bytes_encode( self->current_authority_derived_key_seed, self->current_authority_derived_key_seed_len, ctx );
    4408           0 :     if( FD_UNLIKELY( err ) ) return err;
    4409           0 :   }
    4410           0 :   err = fd_pubkey_encode( &self->new_authority, ctx );
    4411           0 :   if( FD_UNLIKELY( err ) ) return err;
    4412           0 :   return FD_BINCODE_SUCCESS;
    4413           0 : }
    4414           0 : static int fd_vote_authorize_with_seed_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4415           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4416           0 :   int err = 0;
    4417           0 :   err = fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4418           0 :   if( FD_UNLIKELY( err ) ) return err;
    4419           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    4420           0 :   if( FD_UNLIKELY( err ) ) return err;
    4421           0 :   ulong current_authority_derived_key_seed_len;
    4422           0 :   err = fd_bincode_uint64_decode( &current_authority_derived_key_seed_len, ctx );
    4423           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4424           0 :   *total_sz += current_authority_derived_key_seed_len;
    4425           0 :   if( current_authority_derived_key_seed_len ) {
    4426           0 :     err = fd_bincode_bytes_decode_footprint( current_authority_derived_key_seed_len, ctx );
    4427           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4428           0 :     err = !fd_utf8_verify( (char const *) ctx->data - current_authority_derived_key_seed_len, current_authority_derived_key_seed_len );
    4429           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4430           0 :   }
    4431           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    4432           0 :   if( FD_UNLIKELY( err ) ) return err;
    4433           0 :   return 0;
    4434           0 : }
    4435           0 : int fd_vote_authorize_with_seed_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4436           0 :   *total_sz += sizeof(fd_vote_authorize_with_seed_args_t);
    4437           0 :   void const * start_data = ctx->data;
    4438           0 :   int err = fd_vote_authorize_with_seed_args_decode_footprint_inner( ctx, total_sz );
    4439           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4440           0 :   ctx->data = start_data;
    4441           0 :   return err;
    4442           0 : }
    4443           0 : static void fd_vote_authorize_with_seed_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4444           0 :   fd_vote_authorize_with_seed_args_t * self = (fd_vote_authorize_with_seed_args_t *)struct_mem;
    4445           0 :   fd_vote_authorize_decode_inner( &self->authorization_type, alloc_mem, ctx );
    4446           0 :   fd_pubkey_decode_inner( &self->current_authority_derived_key_owner, alloc_mem, ctx );
    4447           0 :   fd_bincode_uint64_decode_unsafe( &self->current_authority_derived_key_seed_len, ctx );
    4448           0 :   if( self->current_authority_derived_key_seed_len ) {
    4449           0 :     self->current_authority_derived_key_seed = *alloc_mem;
    4450           0 :     fd_bincode_bytes_decode_unsafe( self->current_authority_derived_key_seed, self->current_authority_derived_key_seed_len, ctx );
    4451           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->current_authority_derived_key_seed_len;
    4452           0 :   } else
    4453           0 :     self->current_authority_derived_key_seed = NULL;
    4454           0 :   fd_pubkey_decode_inner( &self->new_authority, alloc_mem, ctx );
    4455           0 : }
    4456           0 : void * fd_vote_authorize_with_seed_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4457           0 :   fd_vote_authorize_with_seed_args_t * self = (fd_vote_authorize_with_seed_args_t *)mem;
    4458           0 :   fd_vote_authorize_with_seed_args_new( self );
    4459           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorize_with_seed_args_t);
    4460           0 :   void * * alloc_mem = &alloc_region;
    4461           0 :   fd_vote_authorize_with_seed_args_decode_inner( mem, alloc_mem, ctx );
    4462           0 :   return self;
    4463           0 : }
    4464           0 : void fd_vote_authorize_with_seed_args_new(fd_vote_authorize_with_seed_args_t * self) {
    4465           0 :   fd_memset( self, 0, sizeof(fd_vote_authorize_with_seed_args_t) );
    4466           0 :   fd_vote_authorize_new( &self->authorization_type );
    4467           0 :   fd_pubkey_new( &self->current_authority_derived_key_owner );
    4468           0 :   fd_pubkey_new( &self->new_authority );
    4469           0 : }
    4470           0 : ulong fd_vote_authorize_with_seed_args_size( fd_vote_authorize_with_seed_args_t const * self ) {
    4471           0 :   ulong size = 0;
    4472           0 :   size += fd_vote_authorize_size( &self->authorization_type );
    4473           0 :   size += fd_pubkey_size( &self->current_authority_derived_key_owner );
    4474           0 :   do {
    4475           0 :     size += sizeof(ulong);
    4476           0 :     size += self->current_authority_derived_key_seed_len;
    4477           0 :   } while(0);
    4478           0 :   size += fd_pubkey_size( &self->new_authority );
    4479           0 :   return size;
    4480           0 : }
    4481             : 
    4482           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 ) {
    4483           0 :   int err;
    4484           0 :   err = fd_vote_authorize_encode( &self->authorization_type, ctx );
    4485           0 :   if( FD_UNLIKELY( err ) ) return err;
    4486           0 :   err = fd_pubkey_encode( &self->current_authority_derived_key_owner, ctx );
    4487           0 :   if( FD_UNLIKELY( err ) ) return err;
    4488           0 :   err = fd_bincode_uint64_encode( self->current_authority_derived_key_seed_len, ctx );
    4489           0 :   if( FD_UNLIKELY(err) ) return err;
    4490           0 :   if( self->current_authority_derived_key_seed_len ) {
    4491           0 :     err = fd_bincode_bytes_encode( self->current_authority_derived_key_seed, self->current_authority_derived_key_seed_len, ctx );
    4492           0 :     if( FD_UNLIKELY( err ) ) return err;
    4493           0 :   }
    4494           0 :   return FD_BINCODE_SUCCESS;
    4495           0 : }
    4496           0 : static int fd_vote_authorize_checked_with_seed_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4497           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4498           0 :   int err = 0;
    4499           0 :   err = fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4500           0 :   if( FD_UNLIKELY( err ) ) return err;
    4501           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    4502           0 :   if( FD_UNLIKELY( err ) ) return err;
    4503           0 :   ulong current_authority_derived_key_seed_len;
    4504           0 :   err = fd_bincode_uint64_decode( &current_authority_derived_key_seed_len, ctx );
    4505           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4506           0 :   *total_sz += current_authority_derived_key_seed_len;
    4507           0 :   if( current_authority_derived_key_seed_len ) {
    4508           0 :     err = fd_bincode_bytes_decode_footprint( current_authority_derived_key_seed_len, ctx );
    4509           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4510           0 :     err = !fd_utf8_verify( (char const *) ctx->data - current_authority_derived_key_seed_len, current_authority_derived_key_seed_len );
    4511           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4512           0 :   }
    4513           0 :   return 0;
    4514           0 : }
    4515           0 : int fd_vote_authorize_checked_with_seed_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4516           0 :   *total_sz += sizeof(fd_vote_authorize_checked_with_seed_args_t);
    4517           0 :   void const * start_data = ctx->data;
    4518           0 :   int err = fd_vote_authorize_checked_with_seed_args_decode_footprint_inner( ctx, total_sz );
    4519           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4520           0 :   ctx->data = start_data;
    4521           0 :   return err;
    4522           0 : }
    4523           0 : static void fd_vote_authorize_checked_with_seed_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4524           0 :   fd_vote_authorize_checked_with_seed_args_t * self = (fd_vote_authorize_checked_with_seed_args_t *)struct_mem;
    4525           0 :   fd_vote_authorize_decode_inner( &self->authorization_type, alloc_mem, ctx );
    4526           0 :   fd_pubkey_decode_inner( &self->current_authority_derived_key_owner, alloc_mem, ctx );
    4527           0 :   fd_bincode_uint64_decode_unsafe( &self->current_authority_derived_key_seed_len, ctx );
    4528           0 :   if( self->current_authority_derived_key_seed_len ) {
    4529           0 :     self->current_authority_derived_key_seed = *alloc_mem;
    4530           0 :     fd_bincode_bytes_decode_unsafe( self->current_authority_derived_key_seed, self->current_authority_derived_key_seed_len, ctx );
    4531           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->current_authority_derived_key_seed_len;
    4532           0 :   } else
    4533           0 :     self->current_authority_derived_key_seed = NULL;
    4534           0 : }
    4535           0 : void * fd_vote_authorize_checked_with_seed_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4536           0 :   fd_vote_authorize_checked_with_seed_args_t * self = (fd_vote_authorize_checked_with_seed_args_t *)mem;
    4537           0 :   fd_vote_authorize_checked_with_seed_args_new( self );
    4538           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_authorize_checked_with_seed_args_t);
    4539           0 :   void * * alloc_mem = &alloc_region;
    4540           0 :   fd_vote_authorize_checked_with_seed_args_decode_inner( mem, alloc_mem, ctx );
    4541           0 :   return self;
    4542           0 : }
    4543           0 : void fd_vote_authorize_checked_with_seed_args_new(fd_vote_authorize_checked_with_seed_args_t * self) {
    4544           0 :   fd_memset( self, 0, sizeof(fd_vote_authorize_checked_with_seed_args_t) );
    4545           0 :   fd_vote_authorize_new( &self->authorization_type );
    4546           0 :   fd_pubkey_new( &self->current_authority_derived_key_owner );
    4547           0 : }
    4548           0 : ulong fd_vote_authorize_checked_with_seed_args_size( fd_vote_authorize_checked_with_seed_args_t const * self ) {
    4549           0 :   ulong size = 0;
    4550           0 :   size += fd_vote_authorize_size( &self->authorization_type );
    4551           0 :   size += fd_pubkey_size( &self->current_authority_derived_key_owner );
    4552           0 :   do {
    4553           0 :     size += sizeof(ulong);
    4554           0 :     size += self->current_authority_derived_key_seed_len;
    4555           0 :   } while(0);
    4556           0 :   return size;
    4557           0 : }
    4558             : 
    4559           0 : FD_FN_PURE uchar fd_vote_instruction_is_initialize_account(fd_vote_instruction_t const * self) {
    4560           0 :   return self->discriminant == 0;
    4561           0 : }
    4562           0 : FD_FN_PURE uchar fd_vote_instruction_is_authorize(fd_vote_instruction_t const * self) {
    4563           0 :   return self->discriminant == 1;
    4564           0 : }
    4565           0 : FD_FN_PURE uchar fd_vote_instruction_is_vote(fd_vote_instruction_t const * self) {
    4566           0 :   return self->discriminant == 2;
    4567           0 : }
    4568           0 : FD_FN_PURE uchar fd_vote_instruction_is_withdraw(fd_vote_instruction_t const * self) {
    4569           0 :   return self->discriminant == 3;
    4570           0 : }
    4571           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_validator_identity(fd_vote_instruction_t const * self) {
    4572           0 :   return self->discriminant == 4;
    4573           0 : }
    4574           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_commission(fd_vote_instruction_t const * self) {
    4575           0 :   return self->discriminant == 5;
    4576           0 : }
    4577           0 : FD_FN_PURE uchar fd_vote_instruction_is_vote_switch(fd_vote_instruction_t const * self) {
    4578           0 :   return self->discriminant == 6;
    4579           0 : }
    4580           0 : FD_FN_PURE uchar fd_vote_instruction_is_authorize_checked(fd_vote_instruction_t const * self) {
    4581           0 :   return self->discriminant == 7;
    4582           0 : }
    4583           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_vote_state(fd_vote_instruction_t const * self) {
    4584           0 :   return self->discriminant == 8;
    4585           0 : }
    4586           0 : FD_FN_PURE uchar fd_vote_instruction_is_update_vote_state_switch(fd_vote_instruction_t const * self) {
    4587           0 :   return self->discriminant == 9;
    4588           0 : }
    4589           0 : FD_FN_PURE uchar fd_vote_instruction_is_authorize_with_seed(fd_vote_instruction_t const * self) {
    4590           0 :   return self->discriminant == 10;
    4591           0 : }
    4592           0 : FD_FN_PURE uchar fd_vote_instruction_is_authorize_checked_with_seed(fd_vote_instruction_t const * self) {
    4593           0 :   return self->discriminant == 11;
    4594           0 : }
    4595           0 : FD_FN_PURE uchar fd_vote_instruction_is_compact_update_vote_state(fd_vote_instruction_t const * self) {
    4596           0 :   return self->discriminant == 12;
    4597           0 : }
    4598           0 : FD_FN_PURE uchar fd_vote_instruction_is_compact_update_vote_state_switch(fd_vote_instruction_t const * self) {
    4599           0 :   return self->discriminant == 13;
    4600           0 : }
    4601           0 : FD_FN_PURE uchar fd_vote_instruction_is_tower_sync(fd_vote_instruction_t const * self) {
    4602           0 :   return self->discriminant == 14;
    4603           0 : }
    4604           0 : FD_FN_PURE uchar fd_vote_instruction_is_tower_sync_switch(fd_vote_instruction_t const * self) {
    4605           0 :   return self->discriminant == 15;
    4606           0 : }
    4607             : void fd_vote_instruction_inner_new( fd_vote_instruction_inner_t * self, uint discriminant );
    4608           0 : int fd_vote_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4609           0 :   int err;
    4610           0 :   switch (discriminant) {
    4611           0 :   case 0: {
    4612           0 :     err = fd_vote_init_decode_footprint_inner( ctx, total_sz );
    4613           0 :     if( FD_UNLIKELY( err ) ) return err;
    4614           0 :     return FD_BINCODE_SUCCESS;
    4615           0 :   }
    4616           0 :   case 1: {
    4617           0 :     err = fd_vote_authorize_pubkey_decode_footprint_inner( ctx, total_sz );
    4618           0 :     if( FD_UNLIKELY( err ) ) return err;
    4619           0 :     return FD_BINCODE_SUCCESS;
    4620           0 :   }
    4621           0 :   case 2: {
    4622           0 :     err = fd_vote_decode_footprint_inner( ctx, total_sz );
    4623           0 :     if( FD_UNLIKELY( err ) ) return err;
    4624           0 :     return FD_BINCODE_SUCCESS;
    4625           0 :   }
    4626           0 :   case 3: {
    4627           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    4628           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    4629           0 :     return FD_BINCODE_SUCCESS;
    4630           0 :   }
    4631           0 :   case 4: {
    4632           0 :     return FD_BINCODE_SUCCESS;
    4633           0 :   }
    4634           0 :   case 5: {
    4635           0 :     err = fd_bincode_uint8_decode_footprint( ctx );
    4636           0 :   if( FD_UNLIKELY( err ) ) return err;
    4637           0 :     return FD_BINCODE_SUCCESS;
    4638           0 :   }
    4639           0 :   case 6: {
    4640           0 :     err = fd_vote_switch_decode_footprint_inner( ctx, total_sz );
    4641           0 :     if( FD_UNLIKELY( err ) ) return err;
    4642           0 :     return FD_BINCODE_SUCCESS;
    4643           0 :   }
    4644           0 :   case 7: {
    4645           0 :     err = fd_vote_authorize_decode_footprint_inner( ctx, total_sz );
    4646           0 :     if( FD_UNLIKELY( err ) ) return err;
    4647           0 :     return FD_BINCODE_SUCCESS;
    4648           0 :   }
    4649           0 :   case 8: {
    4650           0 :     err = fd_vote_state_update_decode_footprint_inner( ctx, total_sz );
    4651           0 :     if( FD_UNLIKELY( err ) ) return err;
    4652           0 :     return FD_BINCODE_SUCCESS;
    4653           0 :   }
    4654           0 :   case 9: {
    4655           0 :     err = fd_update_vote_state_switch_decode_footprint_inner( ctx, total_sz );
    4656           0 :     if( FD_UNLIKELY( err ) ) return err;
    4657           0 :     return FD_BINCODE_SUCCESS;
    4658           0 :   }
    4659           0 :   case 10: {
    4660           0 :     err = fd_vote_authorize_with_seed_args_decode_footprint_inner( ctx, total_sz );
    4661           0 :     if( FD_UNLIKELY( err ) ) return err;
    4662           0 :     return FD_BINCODE_SUCCESS;
    4663           0 :   }
    4664           0 :   case 11: {
    4665           0 :     err = fd_vote_authorize_checked_with_seed_args_decode_footprint_inner( ctx, total_sz );
    4666           0 :     if( FD_UNLIKELY( err ) ) return err;
    4667           0 :     return FD_BINCODE_SUCCESS;
    4668           0 :   }
    4669           0 :   case 12: {
    4670           0 :     err = fd_compact_vote_state_update_decode_footprint_inner( ctx, total_sz );
    4671           0 :     if( FD_UNLIKELY( err ) ) return err;
    4672           0 :     return FD_BINCODE_SUCCESS;
    4673           0 :   }
    4674           0 :   case 13: {
    4675           0 :     err = fd_compact_vote_state_update_switch_decode_footprint_inner( ctx, total_sz );
    4676           0 :     if( FD_UNLIKELY( err ) ) return err;
    4677           0 :     return FD_BINCODE_SUCCESS;
    4678           0 :   }
    4679           0 :   case 14: {
    4680           0 :     err = fd_tower_sync_decode_footprint_inner( ctx, total_sz );
    4681           0 :     if( FD_UNLIKELY( err ) ) return err;
    4682           0 :     return FD_BINCODE_SUCCESS;
    4683           0 :   }
    4684           0 :   case 15: {
    4685           0 :     err = fd_tower_sync_switch_decode_footprint_inner( ctx, total_sz );
    4686           0 :     if( FD_UNLIKELY( err ) ) return err;
    4687           0 :     return FD_BINCODE_SUCCESS;
    4688           0 :   }
    4689           0 :   default: return FD_BINCODE_ERR_ENCODING;
    4690           0 :   }
    4691           0 : }
    4692           0 : static int fd_vote_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4693           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4694           0 :   uint discriminant = 0;
    4695           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    4696           0 :   if( FD_UNLIKELY( err ) ) return err;
    4697           0 :   return fd_vote_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    4698           0 : }
    4699           0 : int fd_vote_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    4700           0 :   *total_sz += sizeof(fd_vote_instruction_t);
    4701           0 :   void const * start_data = ctx->data;
    4702           0 :   int err =  fd_vote_instruction_decode_footprint_inner( ctx, total_sz );
    4703           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    4704           0 :   ctx->data = start_data;
    4705           0 :   return err;
    4706           0 : }
    4707           0 : 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 ) {
    4708           0 :   switch (discriminant) {
    4709           0 :   case 0: {
    4710           0 :     fd_vote_init_decode_inner( &self->initialize_account, alloc_mem, ctx );
    4711           0 :     break;
    4712           0 :   }
    4713           0 :   case 1: {
    4714           0 :     fd_vote_authorize_pubkey_decode_inner( &self->authorize, alloc_mem, ctx );
    4715           0 :     break;
    4716           0 :   }
    4717           0 :   case 2: {
    4718           0 :     fd_vote_decode_inner( &self->vote, alloc_mem, ctx );
    4719           0 :     break;
    4720           0 :   }
    4721           0 :   case 3: {
    4722           0 :     fd_bincode_uint64_decode_unsafe( &self->withdraw, ctx );
    4723           0 :     break;
    4724           0 :   }
    4725           0 :   case 4: {
    4726           0 :     break;
    4727           0 :   }
    4728           0 :   case 5: {
    4729           0 :     fd_bincode_uint8_decode_unsafe( &self->update_commission, ctx );
    4730           0 :     break;
    4731           0 :   }
    4732           0 :   case 6: {
    4733           0 :     fd_vote_switch_decode_inner( &self->vote_switch, alloc_mem, ctx );
    4734           0 :     break;
    4735           0 :   }
    4736           0 :   case 7: {
    4737           0 :     fd_vote_authorize_decode_inner( &self->authorize_checked, alloc_mem, ctx );
    4738           0 :     break;
    4739           0 :   }
    4740           0 :   case 8: {
    4741           0 :     fd_vote_state_update_decode_inner( &self->update_vote_state, alloc_mem, ctx );
    4742           0 :     break;
    4743           0 :   }
    4744           0 :   case 9: {
    4745           0 :     fd_update_vote_state_switch_decode_inner( &self->update_vote_state_switch, alloc_mem, ctx );
    4746           0 :     break;
    4747           0 :   }
    4748           0 :   case 10: {
    4749           0 :     fd_vote_authorize_with_seed_args_decode_inner( &self->authorize_with_seed, alloc_mem, ctx );
    4750           0 :     break;
    4751           0 :   }
    4752           0 :   case 11: {
    4753           0 :     fd_vote_authorize_checked_with_seed_args_decode_inner( &self->authorize_checked_with_seed, alloc_mem, ctx );
    4754           0 :     break;
    4755           0 :   }
    4756           0 :   case 12: {
    4757           0 :     fd_compact_vote_state_update_decode_inner( &self->compact_update_vote_state, alloc_mem, ctx );
    4758           0 :     break;
    4759           0 :   }
    4760           0 :   case 13: {
    4761           0 :     fd_compact_vote_state_update_switch_decode_inner( &self->compact_update_vote_state_switch, alloc_mem, ctx );
    4762           0 :     break;
    4763           0 :   }
    4764           0 :   case 14: {
    4765           0 :     fd_tower_sync_decode_inner( &self->tower_sync, alloc_mem, ctx );
    4766           0 :     break;
    4767           0 :   }
    4768           0 :   case 15: {
    4769           0 :     fd_tower_sync_switch_decode_inner( &self->tower_sync_switch, alloc_mem, ctx );
    4770           0 :     break;
    4771           0 :   }
    4772           0 :   }
    4773           0 : }
    4774           0 : static void fd_vote_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    4775           0 :   fd_vote_instruction_t * self = (fd_vote_instruction_t *)struct_mem;
    4776           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    4777           0 :   fd_vote_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    4778           0 : }
    4779           0 : void * fd_vote_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    4780           0 :   fd_vote_instruction_t * self = (fd_vote_instruction_t *)mem;
    4781           0 :   fd_vote_instruction_new( self );
    4782           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_vote_instruction_t);
    4783           0 :   void * * alloc_mem = &alloc_region;
    4784           0 :   fd_vote_instruction_decode_inner( mem, alloc_mem, ctx );
    4785           0 :   return self;
    4786           0 : }
    4787           0 : void fd_vote_instruction_inner_new( fd_vote_instruction_inner_t * self, uint discriminant ) {
    4788           0 :   switch( discriminant ) {
    4789           0 :   case 0: {
    4790           0 :     fd_vote_init_new( &self->initialize_account );
    4791           0 :     break;
    4792           0 :   }
    4793           0 :   case 1: {
    4794           0 :     fd_vote_authorize_pubkey_new( &self->authorize );
    4795           0 :     break;
    4796           0 :   }
    4797           0 :   case 2: {
    4798           0 :     fd_vote_new( &self->vote );
    4799           0 :     break;
    4800           0 :   }
    4801           0 :   case 3: {
    4802           0 :     break;
    4803           0 :   }
    4804           0 :   case 4: {
    4805           0 :     break;
    4806           0 :   }
    4807           0 :   case 5: {
    4808           0 :     break;
    4809           0 :   }
    4810           0 :   case 6: {
    4811           0 :     fd_vote_switch_new( &self->vote_switch );
    4812           0 :     break;
    4813           0 :   }
    4814           0 :   case 7: {
    4815           0 :     fd_vote_authorize_new( &self->authorize_checked );
    4816           0 :     break;
    4817           0 :   }
    4818           0 :   case 8: {
    4819           0 :     fd_vote_state_update_new( &self->update_vote_state );
    4820           0 :     break;
    4821           0 :   }
    4822           0 :   case 9: {
    4823           0 :     fd_update_vote_state_switch_new( &self->update_vote_state_switch );
    4824           0 :     break;
    4825           0 :   }
    4826           0 :   case 10: {
    4827           0 :     fd_vote_authorize_with_seed_args_new( &self->authorize_with_seed );
    4828           0 :     break;
    4829           0 :   }
    4830           0 :   case 11: {
    4831           0 :     fd_vote_authorize_checked_with_seed_args_new( &self->authorize_checked_with_seed );
    4832           0 :     break;
    4833           0 :   }
    4834           0 :   case 12: {
    4835           0 :     fd_compact_vote_state_update_new( &self->compact_update_vote_state );
    4836           0 :     break;
    4837           0 :   }
    4838           0 :   case 13: {
    4839           0 :     fd_compact_vote_state_update_switch_new( &self->compact_update_vote_state_switch );
    4840           0 :     break;
    4841           0 :   }
    4842           0 :   case 14: {
    4843           0 :     fd_tower_sync_new( &self->tower_sync );
    4844           0 :     break;
    4845           0 :   }
    4846           0 :   case 15: {
    4847           0 :     fd_tower_sync_switch_new( &self->tower_sync_switch );
    4848           0 :     break;
    4849           0 :   }
    4850           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    4851           0 :   }
    4852           0 : }
    4853           0 : void fd_vote_instruction_new_disc( fd_vote_instruction_t * self, uint discriminant ) {
    4854           0 :   self->discriminant = discriminant;
    4855           0 :   fd_vote_instruction_inner_new( &self->inner, self->discriminant );
    4856           0 : }
    4857           0 : void fd_vote_instruction_new( fd_vote_instruction_t * self ) {
    4858           0 :   fd_memset( self, 0, sizeof(fd_vote_instruction_t) );
    4859           0 :   fd_vote_instruction_new_disc( self, UINT_MAX );
    4860           0 : }
    4861             : 
    4862           0 : ulong fd_vote_instruction_size( fd_vote_instruction_t const * self ) {
    4863           0 :   ulong size = 0;
    4864           0 :   size += sizeof(uint);
    4865           0 :   switch (self->discriminant) {
    4866           0 :   case 0: {
    4867           0 :     size += fd_vote_init_size( &self->inner.initialize_account );
    4868           0 :     break;
    4869           0 :   }
    4870           0 :   case 1: {
    4871           0 :     size += fd_vote_authorize_pubkey_size( &self->inner.authorize );
    4872           0 :     break;
    4873           0 :   }
    4874           0 :   case 2: {
    4875           0 :     size += fd_vote_size( &self->inner.vote );
    4876           0 :     break;
    4877           0 :   }
    4878           0 :   case 3: {
    4879           0 :     size += sizeof(ulong);
    4880           0 :     break;
    4881           0 :   }
    4882           0 :   case 5: {
    4883           0 :     size += sizeof(char);
    4884           0 :     break;
    4885           0 :   }
    4886           0 :   case 6: {
    4887           0 :     size += fd_vote_switch_size( &self->inner.vote_switch );
    4888           0 :     break;
    4889           0 :   }
    4890           0 :   case 7: {
    4891           0 :     size += fd_vote_authorize_size( &self->inner.authorize_checked );
    4892           0 :     break;
    4893           0 :   }
    4894           0 :   case 8: {
    4895           0 :     size += fd_vote_state_update_size( &self->inner.update_vote_state );
    4896           0 :     break;
    4897           0 :   }
    4898           0 :   case 9: {
    4899           0 :     size += fd_update_vote_state_switch_size( &self->inner.update_vote_state_switch );
    4900           0 :     break;
    4901           0 :   }
    4902           0 :   case 10: {
    4903           0 :     size += fd_vote_authorize_with_seed_args_size( &self->inner.authorize_with_seed );
    4904           0 :     break;
    4905           0 :   }
    4906           0 :   case 11: {
    4907           0 :     size += fd_vote_authorize_checked_with_seed_args_size( &self->inner.authorize_checked_with_seed );
    4908           0 :     break;
    4909           0 :   }
    4910           0 :   case 12: {
    4911           0 :     size += fd_compact_vote_state_update_size( &self->inner.compact_update_vote_state );
    4912           0 :     break;
    4913           0 :   }
    4914           0 :   case 13: {
    4915           0 :     size += fd_compact_vote_state_update_switch_size( &self->inner.compact_update_vote_state_switch );
    4916           0 :     break;
    4917           0 :   }
    4918           0 :   case 14: {
    4919           0 :     size += fd_tower_sync_size( &self->inner.tower_sync );
    4920           0 :     break;
    4921           0 :   }
    4922           0 :   case 15: {
    4923           0 :     size += fd_tower_sync_switch_size( &self->inner.tower_sync_switch );
    4924           0 :     break;
    4925           0 :   }
    4926           0 :   }
    4927           0 :   return size;
    4928           0 : }
    4929             : 
    4930           0 : int fd_vote_instruction_inner_encode( fd_vote_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    4931           0 :   int err;
    4932           0 :   switch (discriminant) {
    4933           0 :   case 0: {
    4934           0 :     err = fd_vote_init_encode( &self->initialize_account, ctx );
    4935           0 :     if( FD_UNLIKELY( err ) ) return err;
    4936           0 :     break;
    4937           0 :   }
    4938           0 :   case 1: {
    4939           0 :     err = fd_vote_authorize_pubkey_encode( &self->authorize, ctx );
    4940           0 :     if( FD_UNLIKELY( err ) ) return err;
    4941           0 :     break;
    4942           0 :   }
    4943           0 :   case 2: {
    4944           0 :     err = fd_vote_encode( &self->vote, ctx );
    4945           0 :     if( FD_UNLIKELY( err ) ) return err;
    4946           0 :     break;
    4947           0 :   }
    4948           0 :   case 3: {
    4949           0 :     err = fd_bincode_uint64_encode( self->withdraw, ctx );
    4950           0 :     if( FD_UNLIKELY( err ) ) return err;
    4951           0 :     break;
    4952           0 :   }
    4953           0 :   case 5: {
    4954           0 :     err = fd_bincode_uint8_encode( (uchar)(self->update_commission), ctx );
    4955           0 :   if( FD_UNLIKELY( err ) ) return err;
    4956           0 :     break;
    4957           0 :   }
    4958           0 :   case 6: {
    4959           0 :     err = fd_vote_switch_encode( &self->vote_switch, ctx );
    4960           0 :     if( FD_UNLIKELY( err ) ) return err;
    4961           0 :     break;
    4962           0 :   }
    4963           0 :   case 7: {
    4964           0 :     err = fd_vote_authorize_encode( &self->authorize_checked, ctx );
    4965           0 :     if( FD_UNLIKELY( err ) ) return err;
    4966           0 :     break;
    4967           0 :   }
    4968           0 :   case 8: {
    4969           0 :     err = fd_vote_state_update_encode( &self->update_vote_state, ctx );
    4970           0 :     if( FD_UNLIKELY( err ) ) return err;
    4971           0 :     break;
    4972           0 :   }
    4973           0 :   case 9: {
    4974           0 :     err = fd_update_vote_state_switch_encode( &self->update_vote_state_switch, ctx );
    4975           0 :     if( FD_UNLIKELY( err ) ) return err;
    4976           0 :     break;
    4977           0 :   }
    4978           0 :   case 10: {
    4979           0 :     err = fd_vote_authorize_with_seed_args_encode( &self->authorize_with_seed, ctx );
    4980           0 :     if( FD_UNLIKELY( err ) ) return err;
    4981           0 :     break;
    4982           0 :   }
    4983           0 :   case 11: {
    4984           0 :     err = fd_vote_authorize_checked_with_seed_args_encode( &self->authorize_checked_with_seed, ctx );
    4985           0 :     if( FD_UNLIKELY( err ) ) return err;
    4986           0 :     break;
    4987           0 :   }
    4988           0 :   case 12: {
    4989           0 :     err = fd_compact_vote_state_update_encode( &self->compact_update_vote_state, ctx );
    4990           0 :     if( FD_UNLIKELY( err ) ) return err;
    4991           0 :     break;
    4992           0 :   }
    4993           0 :   case 13: {
    4994           0 :     err = fd_compact_vote_state_update_switch_encode( &self->compact_update_vote_state_switch, ctx );
    4995           0 :     if( FD_UNLIKELY( err ) ) return err;
    4996           0 :     break;
    4997           0 :   }
    4998           0 :   case 14: {
    4999           0 :     err = fd_tower_sync_encode( &self->tower_sync, ctx );
    5000           0 :     if( FD_UNLIKELY( err ) ) return err;
    5001           0 :     break;
    5002           0 :   }
    5003           0 :   case 15: {
    5004           0 :     err = fd_tower_sync_switch_encode( &self->tower_sync_switch, ctx );
    5005           0 :     if( FD_UNLIKELY( err ) ) return err;
    5006           0 :     break;
    5007           0 :   }
    5008           0 :   }
    5009           0 :   return FD_BINCODE_SUCCESS;
    5010           0 : }
    5011           0 : int fd_vote_instruction_encode( fd_vote_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5012           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    5013           0 :   if( FD_UNLIKELY( err ) ) return err;
    5014           0 :   return fd_vote_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    5015           0 : }
    5016             : 
    5017           0 : int fd_system_program_instruction_create_account_encode( fd_system_program_instruction_create_account_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5018           0 :   int err;
    5019           0 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
    5020           0 :   if( FD_UNLIKELY( err ) ) return err;
    5021           0 :   err = fd_bincode_uint64_encode( self->space, ctx );
    5022           0 :   if( FD_UNLIKELY( err ) ) return err;
    5023           0 :   err = fd_pubkey_encode( &self->owner, ctx );
    5024           0 :   if( FD_UNLIKELY( err ) ) return err;
    5025           0 :   return FD_BINCODE_SUCCESS;
    5026           0 : }
    5027           0 : static inline int fd_system_program_instruction_create_account_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5028           0 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5029           0 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
    5030           0 :   return 0;
    5031           0 : }
    5032           0 : static void fd_system_program_instruction_create_account_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5033           0 :   fd_system_program_instruction_create_account_t * self = (fd_system_program_instruction_create_account_t *)struct_mem;
    5034           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
    5035           0 :   fd_bincode_uint64_decode_unsafe( &self->space, ctx );
    5036           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
    5037           0 : }
    5038           0 : void * fd_system_program_instruction_create_account_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5039           0 :   fd_system_program_instruction_create_account_t * self = (fd_system_program_instruction_create_account_t *)mem;
    5040           0 :   fd_system_program_instruction_create_account_new( self );
    5041           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_create_account_t);
    5042           0 :   void * * alloc_mem = &alloc_region;
    5043           0 :   fd_system_program_instruction_create_account_decode_inner( mem, alloc_mem, ctx );
    5044           0 :   return self;
    5045           0 : }
    5046           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 ) {
    5047           0 :   int err;
    5048           0 :   err = fd_pubkey_encode( &self->base, ctx );
    5049           0 :   if( FD_UNLIKELY( err ) ) return err;
    5050           0 :   err = fd_bincode_uint64_encode( self->seed_len, ctx );
    5051           0 :   if( FD_UNLIKELY(err) ) return err;
    5052           0 :   if( self->seed_len ) {
    5053           0 :     err = fd_bincode_bytes_encode( self->seed, self->seed_len, ctx );
    5054           0 :     if( FD_UNLIKELY( err ) ) return err;
    5055           0 :   }
    5056           0 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
    5057           0 :   if( FD_UNLIKELY( err ) ) return err;
    5058           0 :   err = fd_bincode_uint64_encode( self->space, ctx );
    5059           0 :   if( FD_UNLIKELY( err ) ) return err;
    5060           0 :   err = fd_pubkey_encode( &self->owner, ctx );
    5061           0 :   if( FD_UNLIKELY( err ) ) return err;
    5062           0 :   return FD_BINCODE_SUCCESS;
    5063           0 : }
    5064           0 : static int fd_system_program_instruction_create_account_with_seed_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5065           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5066           0 :   int err = 0;
    5067           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5068           0 :   if( FD_UNLIKELY( err ) ) return err;
    5069           0 :   ulong seed_len;
    5070           0 :   err = fd_bincode_uint64_decode( &seed_len, ctx );
    5071           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5072           0 :   *total_sz += seed_len;
    5073           0 :   if( seed_len ) {
    5074           0 :     err = fd_bincode_bytes_decode_footprint( seed_len, ctx );
    5075           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5076           0 :     err = !fd_utf8_verify( (char const *) ctx->data - seed_len, seed_len );
    5077           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5078           0 :   }
    5079           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    5080           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5081           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    5082           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5083           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5084           0 :   if( FD_UNLIKELY( err ) ) return err;
    5085           0 :   return 0;
    5086           0 : }
    5087           0 : int fd_system_program_instruction_create_account_with_seed_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5088           0 :   *total_sz += sizeof(fd_system_program_instruction_create_account_with_seed_t);
    5089           0 :   void const * start_data = ctx->data;
    5090           0 :   int err = fd_system_program_instruction_create_account_with_seed_decode_footprint_inner( ctx, total_sz );
    5091           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5092           0 :   ctx->data = start_data;
    5093           0 :   return err;
    5094           0 : }
    5095           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 ) {
    5096           0 :   fd_system_program_instruction_create_account_with_seed_t * self = (fd_system_program_instruction_create_account_with_seed_t *)struct_mem;
    5097           0 :   fd_pubkey_decode_inner( &self->base, alloc_mem, ctx );
    5098           0 :   fd_bincode_uint64_decode_unsafe( &self->seed_len, ctx );
    5099           0 :   if( self->seed_len ) {
    5100           0 :     self->seed = *alloc_mem;
    5101           0 :     fd_bincode_bytes_decode_unsafe( self->seed, self->seed_len, ctx );
    5102           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->seed_len;
    5103           0 :   } else
    5104           0 :     self->seed = NULL;
    5105           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
    5106           0 :   fd_bincode_uint64_decode_unsafe( &self->space, ctx );
    5107           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
    5108           0 : }
    5109           0 : void * fd_system_program_instruction_create_account_with_seed_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5110           0 :   fd_system_program_instruction_create_account_with_seed_t * self = (fd_system_program_instruction_create_account_with_seed_t *)mem;
    5111           0 :   fd_system_program_instruction_create_account_with_seed_new( self );
    5112           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_create_account_with_seed_t);
    5113           0 :   void * * alloc_mem = &alloc_region;
    5114           0 :   fd_system_program_instruction_create_account_with_seed_decode_inner( mem, alloc_mem, ctx );
    5115           0 :   return self;
    5116           0 : }
    5117           0 : void fd_system_program_instruction_create_account_with_seed_new(fd_system_program_instruction_create_account_with_seed_t * self) {
    5118           0 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_create_account_with_seed_t) );
    5119           0 :   fd_pubkey_new( &self->base );
    5120           0 :   fd_pubkey_new( &self->owner );
    5121           0 : }
    5122           0 : ulong fd_system_program_instruction_create_account_with_seed_size( fd_system_program_instruction_create_account_with_seed_t const * self ) {
    5123           0 :   ulong size = 0;
    5124           0 :   size += fd_pubkey_size( &self->base );
    5125           0 :   do {
    5126           0 :     size += sizeof(ulong);
    5127           0 :     size += self->seed_len;
    5128           0 :   } while(0);
    5129           0 :   size += sizeof(ulong);
    5130           0 :   size += sizeof(ulong);
    5131           0 :   size += fd_pubkey_size( &self->owner );
    5132           0 :   return size;
    5133           0 : }
    5134             : 
    5135           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 ) {
    5136           0 :   int err;
    5137           0 :   err = fd_pubkey_encode( &self->base, ctx );
    5138           0 :   if( FD_UNLIKELY( err ) ) return err;
    5139           0 :   err = fd_bincode_uint64_encode( self->seed_len, ctx );
    5140           0 :   if( FD_UNLIKELY(err) ) return err;
    5141           0 :   if( self->seed_len ) {
    5142           0 :     err = fd_bincode_bytes_encode( self->seed, self->seed_len, ctx );
    5143           0 :     if( FD_UNLIKELY( err ) ) return err;
    5144           0 :   }
    5145           0 :   err = fd_bincode_uint64_encode( self->space, ctx );
    5146           0 :   if( FD_UNLIKELY( err ) ) return err;
    5147           0 :   err = fd_pubkey_encode( &self->owner, ctx );
    5148           0 :   if( FD_UNLIKELY( err ) ) return err;
    5149           0 :   return FD_BINCODE_SUCCESS;
    5150           0 : }
    5151           0 : static int fd_system_program_instruction_allocate_with_seed_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5152           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5153           0 :   int err = 0;
    5154           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5155           0 :   if( FD_UNLIKELY( err ) ) return err;
    5156           0 :   ulong seed_len;
    5157           0 :   err = fd_bincode_uint64_decode( &seed_len, ctx );
    5158           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5159           0 :   *total_sz += seed_len;
    5160           0 :   if( seed_len ) {
    5161           0 :     err = fd_bincode_bytes_decode_footprint( seed_len, ctx );
    5162           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5163           0 :     err = !fd_utf8_verify( (char const *) ctx->data - seed_len, seed_len );
    5164           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5165           0 :   }
    5166           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    5167           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5168           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5169           0 :   if( FD_UNLIKELY( err ) ) return err;
    5170           0 :   return 0;
    5171           0 : }
    5172           0 : int fd_system_program_instruction_allocate_with_seed_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5173           0 :   *total_sz += sizeof(fd_system_program_instruction_allocate_with_seed_t);
    5174           0 :   void const * start_data = ctx->data;
    5175           0 :   int err = fd_system_program_instruction_allocate_with_seed_decode_footprint_inner( ctx, total_sz );
    5176           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5177           0 :   ctx->data = start_data;
    5178           0 :   return err;
    5179           0 : }
    5180           0 : static void fd_system_program_instruction_allocate_with_seed_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5181           0 :   fd_system_program_instruction_allocate_with_seed_t * self = (fd_system_program_instruction_allocate_with_seed_t *)struct_mem;
    5182           0 :   fd_pubkey_decode_inner( &self->base, alloc_mem, ctx );
    5183           0 :   fd_bincode_uint64_decode_unsafe( &self->seed_len, ctx );
    5184           0 :   if( self->seed_len ) {
    5185           0 :     self->seed = *alloc_mem;
    5186           0 :     fd_bincode_bytes_decode_unsafe( self->seed, self->seed_len, ctx );
    5187           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->seed_len;
    5188           0 :   } else
    5189           0 :     self->seed = NULL;
    5190           0 :   fd_bincode_uint64_decode_unsafe( &self->space, ctx );
    5191           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
    5192           0 : }
    5193           0 : void * fd_system_program_instruction_allocate_with_seed_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5194           0 :   fd_system_program_instruction_allocate_with_seed_t * self = (fd_system_program_instruction_allocate_with_seed_t *)mem;
    5195           0 :   fd_system_program_instruction_allocate_with_seed_new( self );
    5196           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_allocate_with_seed_t);
    5197           0 :   void * * alloc_mem = &alloc_region;
    5198           0 :   fd_system_program_instruction_allocate_with_seed_decode_inner( mem, alloc_mem, ctx );
    5199           0 :   return self;
    5200           0 : }
    5201           0 : void fd_system_program_instruction_allocate_with_seed_new(fd_system_program_instruction_allocate_with_seed_t * self) {
    5202           0 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_allocate_with_seed_t) );
    5203           0 :   fd_pubkey_new( &self->base );
    5204           0 :   fd_pubkey_new( &self->owner );
    5205           0 : }
    5206           0 : ulong fd_system_program_instruction_allocate_with_seed_size( fd_system_program_instruction_allocate_with_seed_t const * self ) {
    5207           0 :   ulong size = 0;
    5208           0 :   size += fd_pubkey_size( &self->base );
    5209           0 :   do {
    5210           0 :     size += sizeof(ulong);
    5211           0 :     size += self->seed_len;
    5212           0 :   } while(0);
    5213           0 :   size += sizeof(ulong);
    5214           0 :   size += fd_pubkey_size( &self->owner );
    5215           0 :   return size;
    5216           0 : }
    5217             : 
    5218           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 ) {
    5219           0 :   int err;
    5220           0 :   err = fd_pubkey_encode( &self->base, ctx );
    5221           0 :   if( FD_UNLIKELY( err ) ) return err;
    5222           0 :   err = fd_bincode_uint64_encode( self->seed_len, ctx );
    5223           0 :   if( FD_UNLIKELY(err) ) return err;
    5224           0 :   if( self->seed_len ) {
    5225           0 :     err = fd_bincode_bytes_encode( self->seed, self->seed_len, ctx );
    5226           0 :     if( FD_UNLIKELY( err ) ) return err;
    5227           0 :   }
    5228           0 :   err = fd_pubkey_encode( &self->owner, ctx );
    5229           0 :   if( FD_UNLIKELY( err ) ) return err;
    5230           0 :   return FD_BINCODE_SUCCESS;
    5231           0 : }
    5232           0 : static int fd_system_program_instruction_assign_with_seed_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5233           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5234           0 :   int err = 0;
    5235           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5236           0 :   if( FD_UNLIKELY( err ) ) return err;
    5237           0 :   ulong seed_len;
    5238           0 :   err = fd_bincode_uint64_decode( &seed_len, ctx );
    5239           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5240           0 :   *total_sz += seed_len;
    5241           0 :   if( seed_len ) {
    5242           0 :     err = fd_bincode_bytes_decode_footprint( seed_len, ctx );
    5243           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5244           0 :     err = !fd_utf8_verify( (char const *) ctx->data - seed_len, seed_len );
    5245           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5246           0 :   }
    5247           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5248           0 :   if( FD_UNLIKELY( err ) ) return err;
    5249           0 :   return 0;
    5250           0 : }
    5251           0 : int fd_system_program_instruction_assign_with_seed_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5252           0 :   *total_sz += sizeof(fd_system_program_instruction_assign_with_seed_t);
    5253           0 :   void const * start_data = ctx->data;
    5254           0 :   int err = fd_system_program_instruction_assign_with_seed_decode_footprint_inner( ctx, total_sz );
    5255           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5256           0 :   ctx->data = start_data;
    5257           0 :   return err;
    5258           0 : }
    5259           0 : static void fd_system_program_instruction_assign_with_seed_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5260           0 :   fd_system_program_instruction_assign_with_seed_t * self = (fd_system_program_instruction_assign_with_seed_t *)struct_mem;
    5261           0 :   fd_pubkey_decode_inner( &self->base, alloc_mem, ctx );
    5262           0 :   fd_bincode_uint64_decode_unsafe( &self->seed_len, ctx );
    5263           0 :   if( self->seed_len ) {
    5264           0 :     self->seed = *alloc_mem;
    5265           0 :     fd_bincode_bytes_decode_unsafe( self->seed, self->seed_len, ctx );
    5266           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->seed_len;
    5267           0 :   } else
    5268           0 :     self->seed = NULL;
    5269           0 :   fd_pubkey_decode_inner( &self->owner, alloc_mem, ctx );
    5270           0 : }
    5271           0 : void * fd_system_program_instruction_assign_with_seed_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5272           0 :   fd_system_program_instruction_assign_with_seed_t * self = (fd_system_program_instruction_assign_with_seed_t *)mem;
    5273           0 :   fd_system_program_instruction_assign_with_seed_new( self );
    5274           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_assign_with_seed_t);
    5275           0 :   void * * alloc_mem = &alloc_region;
    5276           0 :   fd_system_program_instruction_assign_with_seed_decode_inner( mem, alloc_mem, ctx );
    5277           0 :   return self;
    5278           0 : }
    5279           0 : void fd_system_program_instruction_assign_with_seed_new(fd_system_program_instruction_assign_with_seed_t * self) {
    5280           0 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_assign_with_seed_t) );
    5281           0 :   fd_pubkey_new( &self->base );
    5282           0 :   fd_pubkey_new( &self->owner );
    5283           0 : }
    5284           0 : ulong fd_system_program_instruction_assign_with_seed_size( fd_system_program_instruction_assign_with_seed_t const * self ) {
    5285           0 :   ulong size = 0;
    5286           0 :   size += fd_pubkey_size( &self->base );
    5287           0 :   do {
    5288           0 :     size += sizeof(ulong);
    5289           0 :     size += self->seed_len;
    5290           0 :   } while(0);
    5291           0 :   size += fd_pubkey_size( &self->owner );
    5292           0 :   return size;
    5293           0 : }
    5294             : 
    5295           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 ) {
    5296           0 :   int err;
    5297           0 :   err = fd_bincode_uint64_encode( self->lamports, ctx );
    5298           0 :   if( FD_UNLIKELY( err ) ) return err;
    5299           0 :   err = fd_bincode_uint64_encode( self->from_seed_len, ctx );
    5300           0 :   if( FD_UNLIKELY(err) ) return err;
    5301           0 :   if( self->from_seed_len ) {
    5302           0 :     err = fd_bincode_bytes_encode( self->from_seed, self->from_seed_len, ctx );
    5303           0 :     if( FD_UNLIKELY( err ) ) return err;
    5304           0 :   }
    5305           0 :   err = fd_pubkey_encode( &self->from_owner, ctx );
    5306           0 :   if( FD_UNLIKELY( err ) ) return err;
    5307           0 :   return FD_BINCODE_SUCCESS;
    5308           0 : }
    5309           0 : static int fd_system_program_instruction_transfer_with_seed_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5310           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5311           0 :   int err = 0;
    5312           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    5313           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5314           0 :   ulong from_seed_len;
    5315           0 :   err = fd_bincode_uint64_decode( &from_seed_len, ctx );
    5316           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5317           0 :   *total_sz += from_seed_len;
    5318           0 :   if( from_seed_len ) {
    5319           0 :     err = fd_bincode_bytes_decode_footprint( from_seed_len, ctx );
    5320           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5321           0 :     err = !fd_utf8_verify( (char const *) ctx->data - from_seed_len, from_seed_len );
    5322           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5323           0 :   }
    5324           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5325           0 :   if( FD_UNLIKELY( err ) ) return err;
    5326           0 :   return 0;
    5327           0 : }
    5328           0 : int fd_system_program_instruction_transfer_with_seed_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5329           0 :   *total_sz += sizeof(fd_system_program_instruction_transfer_with_seed_t);
    5330           0 :   void const * start_data = ctx->data;
    5331           0 :   int err = fd_system_program_instruction_transfer_with_seed_decode_footprint_inner( ctx, total_sz );
    5332           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5333           0 :   ctx->data = start_data;
    5334           0 :   return err;
    5335           0 : }
    5336           0 : static void fd_system_program_instruction_transfer_with_seed_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5337           0 :   fd_system_program_instruction_transfer_with_seed_t * self = (fd_system_program_instruction_transfer_with_seed_t *)struct_mem;
    5338           0 :   fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
    5339           0 :   fd_bincode_uint64_decode_unsafe( &self->from_seed_len, ctx );
    5340           0 :   if( self->from_seed_len ) {
    5341           0 :     self->from_seed = *alloc_mem;
    5342           0 :     fd_bincode_bytes_decode_unsafe( self->from_seed, self->from_seed_len, ctx );
    5343           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->from_seed_len;
    5344           0 :   } else
    5345           0 :     self->from_seed = NULL;
    5346           0 :   fd_pubkey_decode_inner( &self->from_owner, alloc_mem, ctx );
    5347           0 : }
    5348           0 : void * fd_system_program_instruction_transfer_with_seed_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5349           0 :   fd_system_program_instruction_transfer_with_seed_t * self = (fd_system_program_instruction_transfer_with_seed_t *)mem;
    5350           0 :   fd_system_program_instruction_transfer_with_seed_new( self );
    5351           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_transfer_with_seed_t);
    5352           0 :   void * * alloc_mem = &alloc_region;
    5353           0 :   fd_system_program_instruction_transfer_with_seed_decode_inner( mem, alloc_mem, ctx );
    5354           0 :   return self;
    5355           0 : }
    5356           0 : void fd_system_program_instruction_transfer_with_seed_new(fd_system_program_instruction_transfer_with_seed_t * self) {
    5357           0 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_transfer_with_seed_t) );
    5358           0 :   fd_pubkey_new( &self->from_owner );
    5359           0 : }
    5360           0 : ulong fd_system_program_instruction_transfer_with_seed_size( fd_system_program_instruction_transfer_with_seed_t const * self ) {
    5361           0 :   ulong size = 0;
    5362           0 :   size += sizeof(ulong);
    5363           0 :   do {
    5364           0 :     size += sizeof(ulong);
    5365           0 :     size += self->from_seed_len;
    5366           0 :   } while(0);
    5367           0 :   size += fd_pubkey_size( &self->from_owner );
    5368           0 :   return size;
    5369           0 : }
    5370             : 
    5371           0 : FD_FN_PURE uchar fd_system_program_instruction_is_create_account(fd_system_program_instruction_t const * self) {
    5372           0 :   return self->discriminant == 0;
    5373           0 : }
    5374           0 : FD_FN_PURE uchar fd_system_program_instruction_is_assign(fd_system_program_instruction_t const * self) {
    5375           0 :   return self->discriminant == 1;
    5376           0 : }
    5377           0 : FD_FN_PURE uchar fd_system_program_instruction_is_transfer(fd_system_program_instruction_t const * self) {
    5378           0 :   return self->discriminant == 2;
    5379           0 : }
    5380           0 : FD_FN_PURE uchar fd_system_program_instruction_is_create_account_with_seed(fd_system_program_instruction_t const * self) {
    5381           0 :   return self->discriminant == 3;
    5382           0 : }
    5383           0 : FD_FN_PURE uchar fd_system_program_instruction_is_advance_nonce_account(fd_system_program_instruction_t const * self) {
    5384           0 :   return self->discriminant == 4;
    5385           0 : }
    5386           0 : FD_FN_PURE uchar fd_system_program_instruction_is_withdraw_nonce_account(fd_system_program_instruction_t const * self) {
    5387           0 :   return self->discriminant == 5;
    5388           0 : }
    5389           0 : FD_FN_PURE uchar fd_system_program_instruction_is_initialize_nonce_account(fd_system_program_instruction_t const * self) {
    5390           0 :   return self->discriminant == 6;
    5391           0 : }
    5392           0 : FD_FN_PURE uchar fd_system_program_instruction_is_authorize_nonce_account(fd_system_program_instruction_t const * self) {
    5393           0 :   return self->discriminant == 7;
    5394           0 : }
    5395           0 : FD_FN_PURE uchar fd_system_program_instruction_is_allocate(fd_system_program_instruction_t const * self) {
    5396           0 :   return self->discriminant == 8;
    5397           0 : }
    5398           0 : FD_FN_PURE uchar fd_system_program_instruction_is_allocate_with_seed(fd_system_program_instruction_t const * self) {
    5399           0 :   return self->discriminant == 9;
    5400           0 : }
    5401           0 : FD_FN_PURE uchar fd_system_program_instruction_is_assign_with_seed(fd_system_program_instruction_t const * self) {
    5402           0 :   return self->discriminant == 10;
    5403           0 : }
    5404           0 : FD_FN_PURE uchar fd_system_program_instruction_is_transfer_with_seed(fd_system_program_instruction_t const * self) {
    5405           0 :   return self->discriminant == 11;
    5406           0 : }
    5407           0 : FD_FN_PURE uchar fd_system_program_instruction_is_upgrade_nonce_account(fd_system_program_instruction_t const * self) {
    5408           0 :   return self->discriminant == 12;
    5409           0 : }
    5410             : void fd_system_program_instruction_inner_new( fd_system_program_instruction_inner_t * self, uint discriminant );
    5411          24 : int fd_system_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5412          24 :   int err;
    5413          24 :   switch (discriminant) {
    5414           0 :   case 0: {
    5415           0 :     err = fd_system_program_instruction_create_account_decode_footprint_inner( ctx, total_sz );
    5416           0 :     if( FD_UNLIKELY( err ) ) return err;
    5417           0 :     return FD_BINCODE_SUCCESS;
    5418           0 :   }
    5419           0 :   case 1: {
    5420           0 :     err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5421           0 :     if( FD_UNLIKELY( err ) ) return err;
    5422           0 :     return FD_BINCODE_SUCCESS;
    5423           0 :   }
    5424          24 :   case 2: {
    5425          24 :     err = fd_bincode_uint64_decode_footprint( ctx );
    5426          24 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5427          24 :     return FD_BINCODE_SUCCESS;
    5428          24 :   }
    5429           0 :   case 3: {
    5430           0 :     err = fd_system_program_instruction_create_account_with_seed_decode_footprint_inner( ctx, total_sz );
    5431           0 :     if( FD_UNLIKELY( err ) ) return err;
    5432           0 :     return FD_BINCODE_SUCCESS;
    5433           0 :   }
    5434           0 :   case 4: {
    5435           0 :     return FD_BINCODE_SUCCESS;
    5436           0 :   }
    5437           0 :   case 5: {
    5438           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    5439           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5440           0 :     return FD_BINCODE_SUCCESS;
    5441           0 :   }
    5442           0 :   case 6: {
    5443           0 :     err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5444           0 :     if( FD_UNLIKELY( err ) ) return err;
    5445           0 :     return FD_BINCODE_SUCCESS;
    5446           0 :   }
    5447           0 :   case 7: {
    5448           0 :     err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5449           0 :     if( FD_UNLIKELY( err ) ) return err;
    5450           0 :     return FD_BINCODE_SUCCESS;
    5451           0 :   }
    5452           0 :   case 8: {
    5453           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    5454           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5455           0 :     return FD_BINCODE_SUCCESS;
    5456           0 :   }
    5457           0 :   case 9: {
    5458           0 :     err = fd_system_program_instruction_allocate_with_seed_decode_footprint_inner( ctx, total_sz );
    5459           0 :     if( FD_UNLIKELY( err ) ) return err;
    5460           0 :     return FD_BINCODE_SUCCESS;
    5461           0 :   }
    5462           0 :   case 10: {
    5463           0 :     err = fd_system_program_instruction_assign_with_seed_decode_footprint_inner( ctx, total_sz );
    5464           0 :     if( FD_UNLIKELY( err ) ) return err;
    5465           0 :     return FD_BINCODE_SUCCESS;
    5466           0 :   }
    5467           0 :   case 11: {
    5468           0 :     err = fd_system_program_instruction_transfer_with_seed_decode_footprint_inner( ctx, total_sz );
    5469           0 :     if( FD_UNLIKELY( err ) ) return err;
    5470           0 :     return FD_BINCODE_SUCCESS;
    5471           0 :   }
    5472           0 :   case 12: {
    5473           0 :     return FD_BINCODE_SUCCESS;
    5474           0 :   }
    5475           0 :   default: return FD_BINCODE_ERR_ENCODING;
    5476          24 :   }
    5477          24 : }
    5478          24 : static int fd_system_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5479          24 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5480          24 :   uint discriminant = 0;
    5481          24 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    5482          24 :   if( FD_UNLIKELY( err ) ) return err;
    5483          24 :   return fd_system_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    5484          24 : }
    5485          24 : int fd_system_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5486          24 :   *total_sz += sizeof(fd_system_program_instruction_t);
    5487          24 :   void const * start_data = ctx->data;
    5488          24 :   int err =  fd_system_program_instruction_decode_footprint_inner( ctx, total_sz );
    5489          24 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5490          24 :   ctx->data = start_data;
    5491          24 :   return err;
    5492          24 : }
    5493          24 : 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 ) {
    5494          24 :   switch (discriminant) {
    5495           0 :   case 0: {
    5496           0 :     fd_system_program_instruction_create_account_decode_inner( &self->create_account, alloc_mem, ctx );
    5497           0 :     break;
    5498           0 :   }
    5499           0 :   case 1: {
    5500           0 :     fd_pubkey_decode_inner( &self->assign, alloc_mem, ctx );
    5501           0 :     break;
    5502           0 :   }
    5503          24 :   case 2: {
    5504          24 :     fd_bincode_uint64_decode_unsafe( &self->transfer, ctx );
    5505          24 :     break;
    5506           0 :   }
    5507           0 :   case 3: {
    5508           0 :     fd_system_program_instruction_create_account_with_seed_decode_inner( &self->create_account_with_seed, alloc_mem, ctx );
    5509           0 :     break;
    5510           0 :   }
    5511           0 :   case 4: {
    5512           0 :     break;
    5513           0 :   }
    5514           0 :   case 5: {
    5515           0 :     fd_bincode_uint64_decode_unsafe( &self->withdraw_nonce_account, ctx );
    5516           0 :     break;
    5517           0 :   }
    5518           0 :   case 6: {
    5519           0 :     fd_pubkey_decode_inner( &self->initialize_nonce_account, alloc_mem, ctx );
    5520           0 :     break;
    5521           0 :   }
    5522           0 :   case 7: {
    5523           0 :     fd_pubkey_decode_inner( &self->authorize_nonce_account, alloc_mem, ctx );
    5524           0 :     break;
    5525           0 :   }
    5526           0 :   case 8: {
    5527           0 :     fd_bincode_uint64_decode_unsafe( &self->allocate, ctx );
    5528           0 :     break;
    5529           0 :   }
    5530           0 :   case 9: {
    5531           0 :     fd_system_program_instruction_allocate_with_seed_decode_inner( &self->allocate_with_seed, alloc_mem, ctx );
    5532           0 :     break;
    5533           0 :   }
    5534           0 :   case 10: {
    5535           0 :     fd_system_program_instruction_assign_with_seed_decode_inner( &self->assign_with_seed, alloc_mem, ctx );
    5536           0 :     break;
    5537           0 :   }
    5538           0 :   case 11: {
    5539           0 :     fd_system_program_instruction_transfer_with_seed_decode_inner( &self->transfer_with_seed, alloc_mem, ctx );
    5540           0 :     break;
    5541           0 :   }
    5542           0 :   case 12: {
    5543           0 :     break;
    5544           0 :   }
    5545          24 :   }
    5546          24 : }
    5547          24 : static void fd_system_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5548          24 :   fd_system_program_instruction_t * self = (fd_system_program_instruction_t *)struct_mem;
    5549          24 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    5550          24 :   fd_system_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    5551          24 : }
    5552          24 : void * fd_system_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5553          24 :   fd_system_program_instruction_t * self = (fd_system_program_instruction_t *)mem;
    5554          24 :   fd_system_program_instruction_new( self );
    5555          24 :   void * alloc_region = (uchar *)mem + sizeof(fd_system_program_instruction_t);
    5556          24 :   void * * alloc_mem = &alloc_region;
    5557          24 :   fd_system_program_instruction_decode_inner( mem, alloc_mem, ctx );
    5558          24 :   return self;
    5559          24 : }
    5560          24 : void fd_system_program_instruction_inner_new( fd_system_program_instruction_inner_t * self, uint discriminant ) {
    5561          24 :   switch( discriminant ) {
    5562           0 :   case 0: {
    5563           0 :     fd_system_program_instruction_create_account_new( &self->create_account );
    5564           0 :     break;
    5565           0 :   }
    5566           0 :   case 1: {
    5567           0 :     fd_pubkey_new( &self->assign );
    5568           0 :     break;
    5569           0 :   }
    5570           0 :   case 2: {
    5571           0 :     break;
    5572           0 :   }
    5573           0 :   case 3: {
    5574           0 :     fd_system_program_instruction_create_account_with_seed_new( &self->create_account_with_seed );
    5575           0 :     break;
    5576           0 :   }
    5577           0 :   case 4: {
    5578           0 :     break;
    5579           0 :   }
    5580           0 :   case 5: {
    5581           0 :     break;
    5582           0 :   }
    5583           0 :   case 6: {
    5584           0 :     fd_pubkey_new( &self->initialize_nonce_account );
    5585           0 :     break;
    5586           0 :   }
    5587           0 :   case 7: {
    5588           0 :     fd_pubkey_new( &self->authorize_nonce_account );
    5589           0 :     break;
    5590           0 :   }
    5591           0 :   case 8: {
    5592           0 :     break;
    5593           0 :   }
    5594           0 :   case 9: {
    5595           0 :     fd_system_program_instruction_allocate_with_seed_new( &self->allocate_with_seed );
    5596           0 :     break;
    5597           0 :   }
    5598           0 :   case 10: {
    5599           0 :     fd_system_program_instruction_assign_with_seed_new( &self->assign_with_seed );
    5600           0 :     break;
    5601           0 :   }
    5602           0 :   case 11: {
    5603           0 :     fd_system_program_instruction_transfer_with_seed_new( &self->transfer_with_seed );
    5604           0 :     break;
    5605           0 :   }
    5606           0 :   case 12: {
    5607           0 :     break;
    5608           0 :   }
    5609          24 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    5610          24 :   }
    5611          24 : }
    5612          24 : void fd_system_program_instruction_new_disc( fd_system_program_instruction_t * self, uint discriminant ) {
    5613          24 :   self->discriminant = discriminant;
    5614          24 :   fd_system_program_instruction_inner_new( &self->inner, self->discriminant );
    5615          24 : }
    5616          24 : void fd_system_program_instruction_new( fd_system_program_instruction_t * self ) {
    5617          24 :   fd_memset( self, 0, sizeof(fd_system_program_instruction_t) );
    5618          24 :   fd_system_program_instruction_new_disc( self, UINT_MAX );
    5619          24 : }
    5620             : 
    5621           0 : ulong fd_system_program_instruction_size( fd_system_program_instruction_t const * self ) {
    5622           0 :   ulong size = 0;
    5623           0 :   size += sizeof(uint);
    5624           0 :   switch (self->discriminant) {
    5625           0 :   case 0: {
    5626           0 :     size += fd_system_program_instruction_create_account_size( &self->inner.create_account );
    5627           0 :     break;
    5628           0 :   }
    5629           0 :   case 1: {
    5630           0 :     size += fd_pubkey_size( &self->inner.assign );
    5631           0 :     break;
    5632           0 :   }
    5633           0 :   case 2: {
    5634           0 :     size += sizeof(ulong);
    5635           0 :     break;
    5636           0 :   }
    5637           0 :   case 3: {
    5638           0 :     size += fd_system_program_instruction_create_account_with_seed_size( &self->inner.create_account_with_seed );
    5639           0 :     break;
    5640           0 :   }
    5641           0 :   case 5: {
    5642           0 :     size += sizeof(ulong);
    5643           0 :     break;
    5644           0 :   }
    5645           0 :   case 6: {
    5646           0 :     size += fd_pubkey_size( &self->inner.initialize_nonce_account );
    5647           0 :     break;
    5648           0 :   }
    5649           0 :   case 7: {
    5650           0 :     size += fd_pubkey_size( &self->inner.authorize_nonce_account );
    5651           0 :     break;
    5652           0 :   }
    5653           0 :   case 8: {
    5654           0 :     size += sizeof(ulong);
    5655           0 :     break;
    5656           0 :   }
    5657           0 :   case 9: {
    5658           0 :     size += fd_system_program_instruction_allocate_with_seed_size( &self->inner.allocate_with_seed );
    5659           0 :     break;
    5660           0 :   }
    5661           0 :   case 10: {
    5662           0 :     size += fd_system_program_instruction_assign_with_seed_size( &self->inner.assign_with_seed );
    5663           0 :     break;
    5664           0 :   }
    5665           0 :   case 11: {
    5666           0 :     size += fd_system_program_instruction_transfer_with_seed_size( &self->inner.transfer_with_seed );
    5667           0 :     break;
    5668           0 :   }
    5669           0 :   }
    5670           0 :   return size;
    5671           0 : }
    5672             : 
    5673           0 : int fd_system_program_instruction_inner_encode( fd_system_program_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    5674           0 :   int err;
    5675           0 :   switch (discriminant) {
    5676           0 :   case 0: {
    5677           0 :     err = fd_system_program_instruction_create_account_encode( &self->create_account, ctx );
    5678           0 :     if( FD_UNLIKELY( err ) ) return err;
    5679           0 :     break;
    5680           0 :   }
    5681           0 :   case 1: {
    5682           0 :     err = fd_pubkey_encode( &self->assign, ctx );
    5683           0 :     if( FD_UNLIKELY( err ) ) return err;
    5684           0 :     break;
    5685           0 :   }
    5686           0 :   case 2: {
    5687           0 :     err = fd_bincode_uint64_encode( self->transfer, ctx );
    5688           0 :     if( FD_UNLIKELY( err ) ) return err;
    5689           0 :     break;
    5690           0 :   }
    5691           0 :   case 3: {
    5692           0 :     err = fd_system_program_instruction_create_account_with_seed_encode( &self->create_account_with_seed, ctx );
    5693           0 :     if( FD_UNLIKELY( err ) ) return err;
    5694           0 :     break;
    5695           0 :   }
    5696           0 :   case 5: {
    5697           0 :     err = fd_bincode_uint64_encode( self->withdraw_nonce_account, ctx );
    5698           0 :     if( FD_UNLIKELY( err ) ) return err;
    5699           0 :     break;
    5700           0 :   }
    5701           0 :   case 6: {
    5702           0 :     err = fd_pubkey_encode( &self->initialize_nonce_account, ctx );
    5703           0 :     if( FD_UNLIKELY( err ) ) return err;
    5704           0 :     break;
    5705           0 :   }
    5706           0 :   case 7: {
    5707           0 :     err = fd_pubkey_encode( &self->authorize_nonce_account, ctx );
    5708           0 :     if( FD_UNLIKELY( err ) ) return err;
    5709           0 :     break;
    5710           0 :   }
    5711           0 :   case 8: {
    5712           0 :     err = fd_bincode_uint64_encode( self->allocate, ctx );
    5713           0 :     if( FD_UNLIKELY( err ) ) return err;
    5714           0 :     break;
    5715           0 :   }
    5716           0 :   case 9: {
    5717           0 :     err = fd_system_program_instruction_allocate_with_seed_encode( &self->allocate_with_seed, ctx );
    5718           0 :     if( FD_UNLIKELY( err ) ) return err;
    5719           0 :     break;
    5720           0 :   }
    5721           0 :   case 10: {
    5722           0 :     err = fd_system_program_instruction_assign_with_seed_encode( &self->assign_with_seed, ctx );
    5723           0 :     if( FD_UNLIKELY( err ) ) return err;
    5724           0 :     break;
    5725           0 :   }
    5726           0 :   case 11: {
    5727           0 :     err = fd_system_program_instruction_transfer_with_seed_encode( &self->transfer_with_seed, ctx );
    5728           0 :     if( FD_UNLIKELY( err ) ) return err;
    5729           0 :     break;
    5730           0 :   }
    5731           0 :   }
    5732           0 :   return FD_BINCODE_SUCCESS;
    5733           0 : }
    5734           0 : int fd_system_program_instruction_encode( fd_system_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5735           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    5736           0 :   if( FD_UNLIKELY( err ) ) return err;
    5737           0 :   return fd_system_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    5738           0 : }
    5739             : 
    5740          12 : int fd_stake_authorized_encode( fd_stake_authorized_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5741          12 :   int err;
    5742          12 :   err = fd_pubkey_encode( &self->staker, ctx );
    5743          12 :   if( FD_UNLIKELY( err ) ) return err;
    5744          12 :   err = fd_pubkey_encode( &self->withdrawer, ctx );
    5745          12 :   if( FD_UNLIKELY( err ) ) return err;
    5746          12 :   return FD_BINCODE_SUCCESS;
    5747          12 : }
    5748           0 : static inline int fd_stake_authorized_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5749           0 :   if( (ulong)ctx->data + 64UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5750           0 :   ctx->data = (void *)( (ulong)ctx->data + 64UL );
    5751           0 :   return 0;
    5752           0 : }
    5753           0 : static void fd_stake_authorized_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5754           0 :   fd_stake_authorized_t * self = (fd_stake_authorized_t *)struct_mem;
    5755           0 :   fd_pubkey_decode_inner( &self->staker, alloc_mem, ctx );
    5756           0 :   fd_pubkey_decode_inner( &self->withdrawer, alloc_mem, ctx );
    5757           0 : }
    5758           0 : void * fd_stake_authorized_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5759           0 :   fd_stake_authorized_t * self = (fd_stake_authorized_t *)mem;
    5760           0 :   fd_stake_authorized_new( self );
    5761           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_authorized_t);
    5762           0 :   void * * alloc_mem = &alloc_region;
    5763           0 :   fd_stake_authorized_decode_inner( mem, alloc_mem, ctx );
    5764           0 :   return self;
    5765           0 : }
    5766          12 : int fd_stake_lockup_encode( fd_stake_lockup_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5767          12 :   int err;
    5768          12 :   err = fd_bincode_uint64_encode( (ulong)self->unix_timestamp, ctx );
    5769          12 :   if( FD_UNLIKELY( err ) ) return err;
    5770          12 :   err = fd_bincode_uint64_encode( self->epoch, ctx );
    5771          12 :   if( FD_UNLIKELY( err ) ) return err;
    5772          12 :   err = fd_pubkey_encode( &self->custodian, ctx );
    5773          12 :   if( FD_UNLIKELY( err ) ) return err;
    5774          12 :   return FD_BINCODE_SUCCESS;
    5775          12 : }
    5776           0 : static inline int fd_stake_lockup_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5777           0 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5778           0 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
    5779           0 :   return 0;
    5780           0 : }
    5781           0 : static void fd_stake_lockup_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5782           0 :   fd_stake_lockup_t * self = (fd_stake_lockup_t *)struct_mem;
    5783           0 :   fd_bincode_uint64_decode_unsafe( (ulong *) &self->unix_timestamp, ctx );
    5784           0 :   fd_bincode_uint64_decode_unsafe( &self->epoch, ctx );
    5785           0 :   fd_pubkey_decode_inner( &self->custodian, alloc_mem, ctx );
    5786           0 : }
    5787           0 : void * fd_stake_lockup_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5788           0 :   fd_stake_lockup_t * self = (fd_stake_lockup_t *)mem;
    5789           0 :   fd_stake_lockup_new( self );
    5790           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_lockup_t);
    5791           0 :   void * * alloc_mem = &alloc_region;
    5792           0 :   fd_stake_lockup_decode_inner( mem, alloc_mem, ctx );
    5793           0 :   return self;
    5794           0 : }
    5795           0 : int fd_stake_instruction_initialize_encode( fd_stake_instruction_initialize_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5796           0 :   int err;
    5797           0 :   err = fd_stake_authorized_encode( &self->authorized, ctx );
    5798           0 :   if( FD_UNLIKELY( err ) ) return err;
    5799           0 :   err = fd_stake_lockup_encode( &self->lockup, ctx );
    5800           0 :   if( FD_UNLIKELY( err ) ) return err;
    5801           0 :   return FD_BINCODE_SUCCESS;
    5802           0 : }
    5803           0 : static inline int fd_stake_instruction_initialize_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5804           0 :   if( (ulong)ctx->data + 112UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5805           0 :   ctx->data = (void *)( (ulong)ctx->data + 112UL );
    5806           0 :   return 0;
    5807           0 : }
    5808           0 : static void fd_stake_instruction_initialize_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5809           0 :   fd_stake_instruction_initialize_t * self = (fd_stake_instruction_initialize_t *)struct_mem;
    5810           0 :   fd_stake_authorized_decode_inner( &self->authorized, alloc_mem, ctx );
    5811           0 :   fd_stake_lockup_decode_inner( &self->lockup, alloc_mem, ctx );
    5812           0 : }
    5813           0 : void * fd_stake_instruction_initialize_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5814           0 :   fd_stake_instruction_initialize_t * self = (fd_stake_instruction_initialize_t *)mem;
    5815           0 :   fd_stake_instruction_initialize_new( self );
    5816           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_instruction_initialize_t);
    5817           0 :   void * * alloc_mem = &alloc_region;
    5818           0 :   fd_stake_instruction_initialize_decode_inner( mem, alloc_mem, ctx );
    5819           0 :   return self;
    5820           0 : }
    5821           0 : int fd_stake_lockup_custodian_args_encode( fd_stake_lockup_custodian_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5822           0 :   int err;
    5823           0 :   err = fd_stake_lockup_encode( &self->lockup, ctx );
    5824           0 :   if( FD_UNLIKELY( err ) ) return err;
    5825           0 :   err = fd_sol_sysvar_clock_encode( &self->clock, ctx );
    5826           0 :   if( FD_UNLIKELY( err ) ) return err;
    5827           0 :   if( self->custodian != NULL ) {
    5828           0 :     err = fd_bincode_bool_encode( 1, ctx );
    5829           0 :     if( FD_UNLIKELY( err ) ) return err;
    5830           0 :     err = fd_pubkey_encode( self->custodian, ctx );
    5831           0 :     if( FD_UNLIKELY( err ) ) return err;
    5832           0 :   } else {
    5833           0 :     err = fd_bincode_bool_encode( 0, ctx );
    5834           0 :     if( FD_UNLIKELY( err ) ) return err;
    5835           0 :   }
    5836           0 :   return FD_BINCODE_SUCCESS;
    5837           0 : }
    5838           0 : static int fd_stake_lockup_custodian_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5839           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5840           0 :   int err = 0;
    5841           0 :   err = fd_stake_lockup_decode_footprint_inner( ctx, total_sz );
    5842           0 :   if( FD_UNLIKELY( err ) ) return err;
    5843           0 :   err = fd_sol_sysvar_clock_decode_footprint_inner( ctx, total_sz );
    5844           0 :   if( FD_UNLIKELY( err ) ) return err;
    5845           0 :   {
    5846           0 :     uchar o;
    5847           0 :     err = fd_bincode_bool_decode( &o, ctx );
    5848           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5849           0 :     if( o ) {
    5850           0 :     *total_sz += FD_PUBKEY_ALIGN + sizeof(fd_pubkey_t);
    5851           0 :       err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5852           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    5853           0 :     }
    5854           0 :   }
    5855           0 :   return 0;
    5856           0 : }
    5857           0 : int fd_stake_lockup_custodian_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5858           0 :   *total_sz += sizeof(fd_stake_lockup_custodian_args_t);
    5859           0 :   void const * start_data = ctx->data;
    5860           0 :   int err = fd_stake_lockup_custodian_args_decode_footprint_inner( ctx, total_sz );
    5861           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5862           0 :   ctx->data = start_data;
    5863           0 :   return err;
    5864           0 : }
    5865           0 : static void fd_stake_lockup_custodian_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5866           0 :   fd_stake_lockup_custodian_args_t * self = (fd_stake_lockup_custodian_args_t *)struct_mem;
    5867           0 :   fd_stake_lockup_decode_inner( &self->lockup, alloc_mem, ctx );
    5868           0 :   fd_sol_sysvar_clock_decode_inner( &self->clock, alloc_mem, ctx );
    5869           0 :   {
    5870           0 :     uchar o;
    5871           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    5872           0 :     if( o ) {
    5873           0 :       *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, FD_PUBKEY_ALIGN );
    5874           0 :       self->custodian = *alloc_mem;
    5875           0 :       *alloc_mem = (uchar *)*alloc_mem + sizeof(fd_pubkey_t);
    5876           0 :       fd_pubkey_new( self->custodian );
    5877           0 :       fd_pubkey_decode_inner( self->custodian, alloc_mem, ctx );
    5878           0 :     } else {
    5879           0 :       self->custodian = NULL;
    5880           0 :     }
    5881           0 :   }
    5882           0 : }
    5883           0 : void * fd_stake_lockup_custodian_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5884           0 :   fd_stake_lockup_custodian_args_t * self = (fd_stake_lockup_custodian_args_t *)mem;
    5885           0 :   fd_stake_lockup_custodian_args_new( self );
    5886           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_lockup_custodian_args_t);
    5887           0 :   void * * alloc_mem = &alloc_region;
    5888           0 :   fd_stake_lockup_custodian_args_decode_inner( mem, alloc_mem, ctx );
    5889           0 :   return self;
    5890           0 : }
    5891           0 : void fd_stake_lockup_custodian_args_new(fd_stake_lockup_custodian_args_t * self) {
    5892           0 :   fd_memset( self, 0, sizeof(fd_stake_lockup_custodian_args_t) );
    5893           0 :   fd_stake_lockup_new( &self->lockup );
    5894           0 :   fd_sol_sysvar_clock_new( &self->clock );
    5895           0 : }
    5896           0 : ulong fd_stake_lockup_custodian_args_size( fd_stake_lockup_custodian_args_t const * self ) {
    5897           0 :   ulong size = 0;
    5898           0 :   size += fd_stake_lockup_size( &self->lockup );
    5899           0 :   size += fd_sol_sysvar_clock_size( &self->clock );
    5900           0 :   size += sizeof(char);
    5901           0 :   if( NULL != self->custodian ) {
    5902           0 :     size += fd_pubkey_size( self->custodian );
    5903           0 :   }
    5904           0 :   return size;
    5905           0 : }
    5906             : 
    5907           0 : FD_FN_PURE uchar fd_stake_authorize_is_staker(fd_stake_authorize_t const * self) {
    5908           0 :   return self->discriminant == 0;
    5909           0 : }
    5910           0 : FD_FN_PURE uchar fd_stake_authorize_is_withdrawer(fd_stake_authorize_t const * self) {
    5911           0 :   return self->discriminant == 1;
    5912           0 : }
    5913           0 : int fd_stake_authorize_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5914           0 :   int err;
    5915           0 :   switch (discriminant) {
    5916           0 :   case 0: {
    5917           0 :     return FD_BINCODE_SUCCESS;
    5918           0 :   }
    5919           0 :   case 1: {
    5920           0 :     return FD_BINCODE_SUCCESS;
    5921           0 :   }
    5922           0 :   default: return FD_BINCODE_ERR_ENCODING;
    5923           0 :   }
    5924           0 : }
    5925           0 : static int fd_stake_authorize_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5926           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5927           0 :   uint discriminant = 0;
    5928           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    5929           0 :   if( FD_UNLIKELY( err ) ) return err;
    5930           0 :   return fd_stake_authorize_inner_decode_footprint( discriminant, ctx, total_sz );
    5931           0 : }
    5932           0 : int fd_stake_authorize_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5933           0 :   *total_sz += sizeof(fd_stake_authorize_t);
    5934           0 :   void const * start_data = ctx->data;
    5935           0 :   int err =  fd_stake_authorize_decode_footprint_inner( ctx, total_sz );
    5936           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5937           0 :   ctx->data = start_data;
    5938           0 :   return err;
    5939           0 : }
    5940           0 : static void fd_stake_authorize_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5941           0 :   fd_stake_authorize_t * self = (fd_stake_authorize_t *)struct_mem;
    5942           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    5943           0 : }
    5944           0 : void * fd_stake_authorize_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5945           0 :   fd_stake_authorize_t * self = (fd_stake_authorize_t *)mem;
    5946           0 :   fd_stake_authorize_new( self );
    5947           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_authorize_t);
    5948           0 :   void * * alloc_mem = &alloc_region;
    5949           0 :   fd_stake_authorize_decode_inner( mem, alloc_mem, ctx );
    5950           0 :   return self;
    5951           0 : }
    5952             : 
    5953           0 : ulong fd_stake_authorize_size( fd_stake_authorize_t const * self ) {
    5954           0 :   ulong size = 0;
    5955           0 :   size += sizeof(uint);
    5956           0 :   switch (self->discriminant) {
    5957           0 :   }
    5958           0 :   return size;
    5959           0 : }
    5960             : 
    5961           0 : int fd_stake_authorize_encode( fd_stake_authorize_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5962           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    5963           0 :   if( FD_UNLIKELY( err ) ) return err;
    5964           0 :   return err;
    5965           0 : }
    5966             : 
    5967           0 : int fd_stake_instruction_authorize_encode( fd_stake_instruction_authorize_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    5968           0 :   int err;
    5969           0 :   err = fd_pubkey_encode( &self->pubkey, ctx );
    5970           0 :   if( FD_UNLIKELY( err ) ) return err;
    5971           0 :   err = fd_stake_authorize_encode( &self->stake_authorize, ctx );
    5972           0 :   if( FD_UNLIKELY( err ) ) return err;
    5973           0 :   return FD_BINCODE_SUCCESS;
    5974           0 : }
    5975           0 : static int fd_stake_instruction_authorize_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5976           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5977           0 :   int err = 0;
    5978           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    5979           0 :   if( FD_UNLIKELY( err ) ) return err;
    5980           0 :   err = fd_stake_authorize_decode_footprint_inner( ctx, total_sz );
    5981           0 :   if( FD_UNLIKELY( err ) ) return err;
    5982           0 :   return 0;
    5983           0 : }
    5984           0 : int fd_stake_instruction_authorize_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    5985           0 :   *total_sz += sizeof(fd_stake_instruction_authorize_t);
    5986           0 :   void const * start_data = ctx->data;
    5987           0 :   int err = fd_stake_instruction_authorize_decode_footprint_inner( ctx, total_sz );
    5988           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    5989           0 :   ctx->data = start_data;
    5990           0 :   return err;
    5991           0 : }
    5992           0 : static void fd_stake_instruction_authorize_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    5993           0 :   fd_stake_instruction_authorize_t * self = (fd_stake_instruction_authorize_t *)struct_mem;
    5994           0 :   fd_pubkey_decode_inner( &self->pubkey, alloc_mem, ctx );
    5995           0 :   fd_stake_authorize_decode_inner( &self->stake_authorize, alloc_mem, ctx );
    5996           0 : }
    5997           0 : void * fd_stake_instruction_authorize_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    5998           0 :   fd_stake_instruction_authorize_t * self = (fd_stake_instruction_authorize_t *)mem;
    5999           0 :   fd_stake_instruction_authorize_new( self );
    6000           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_instruction_authorize_t);
    6001           0 :   void * * alloc_mem = &alloc_region;
    6002           0 :   fd_stake_instruction_authorize_decode_inner( mem, alloc_mem, ctx );
    6003           0 :   return self;
    6004           0 : }
    6005           0 : void fd_stake_instruction_authorize_new(fd_stake_instruction_authorize_t * self) {
    6006           0 :   fd_memset( self, 0, sizeof(fd_stake_instruction_authorize_t) );
    6007           0 :   fd_pubkey_new( &self->pubkey );
    6008           0 :   fd_stake_authorize_new( &self->stake_authorize );
    6009           0 : }
    6010           0 : int fd_authorize_with_seed_args_encode( fd_authorize_with_seed_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6011           0 :   int err;
    6012           0 :   err = fd_pubkey_encode( &self->new_authorized_pubkey, ctx );
    6013           0 :   if( FD_UNLIKELY( err ) ) return err;
    6014           0 :   err = fd_stake_authorize_encode( &self->stake_authorize, ctx );
    6015           0 :   if( FD_UNLIKELY( err ) ) return err;
    6016           0 :   err = fd_bincode_uint64_encode( self->authority_seed_len, ctx );
    6017           0 :   if( FD_UNLIKELY(err) ) return err;
    6018           0 :   if( self->authority_seed_len ) {
    6019           0 :     err = fd_bincode_bytes_encode( self->authority_seed, self->authority_seed_len, ctx );
    6020           0 :     if( FD_UNLIKELY( err ) ) return err;
    6021           0 :   }
    6022           0 :   err = fd_pubkey_encode( &self->authority_owner, ctx );
    6023           0 :   if( FD_UNLIKELY( err ) ) return err;
    6024           0 :   return FD_BINCODE_SUCCESS;
    6025           0 : }
    6026           0 : static int fd_authorize_with_seed_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6027           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6028           0 :   int err = 0;
    6029           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    6030           0 :   if( FD_UNLIKELY( err ) ) return err;
    6031           0 :   err = fd_stake_authorize_decode_footprint_inner( ctx, total_sz );
    6032           0 :   if( FD_UNLIKELY( err ) ) return err;
    6033           0 :   ulong authority_seed_len;
    6034           0 :   err = fd_bincode_uint64_decode( &authority_seed_len, ctx );
    6035           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6036           0 :   *total_sz += authority_seed_len;
    6037           0 :   if( authority_seed_len ) {
    6038           0 :     err = fd_bincode_bytes_decode_footprint( authority_seed_len, ctx );
    6039           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6040           0 :     err = !fd_utf8_verify( (char const *) ctx->data - authority_seed_len, authority_seed_len );
    6041           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6042           0 :   }
    6043           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    6044           0 :   if( FD_UNLIKELY( err ) ) return err;
    6045           0 :   return 0;
    6046           0 : }
    6047           0 : int fd_authorize_with_seed_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6048           0 :   *total_sz += sizeof(fd_authorize_with_seed_args_t);
    6049           0 :   void const * start_data = ctx->data;
    6050           0 :   int err = fd_authorize_with_seed_args_decode_footprint_inner( ctx, total_sz );
    6051           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6052           0 :   ctx->data = start_data;
    6053           0 :   return err;
    6054           0 : }
    6055           0 : static void fd_authorize_with_seed_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6056           0 :   fd_authorize_with_seed_args_t * self = (fd_authorize_with_seed_args_t *)struct_mem;
    6057           0 :   fd_pubkey_decode_inner( &self->new_authorized_pubkey, alloc_mem, ctx );
    6058           0 :   fd_stake_authorize_decode_inner( &self->stake_authorize, alloc_mem, ctx );
    6059           0 :   fd_bincode_uint64_decode_unsafe( &self->authority_seed_len, ctx );
    6060           0 :   if( self->authority_seed_len ) {
    6061           0 :     self->authority_seed = *alloc_mem;
    6062           0 :     fd_bincode_bytes_decode_unsafe( self->authority_seed, self->authority_seed_len, ctx );
    6063           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->authority_seed_len;
    6064           0 :   } else
    6065           0 :     self->authority_seed = NULL;
    6066           0 :   fd_pubkey_decode_inner( &self->authority_owner, alloc_mem, ctx );
    6067           0 : }
    6068           0 : void * fd_authorize_with_seed_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6069           0 :   fd_authorize_with_seed_args_t * self = (fd_authorize_with_seed_args_t *)mem;
    6070           0 :   fd_authorize_with_seed_args_new( self );
    6071           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_authorize_with_seed_args_t);
    6072           0 :   void * * alloc_mem = &alloc_region;
    6073           0 :   fd_authorize_with_seed_args_decode_inner( mem, alloc_mem, ctx );
    6074           0 :   return self;
    6075           0 : }
    6076           0 : void fd_authorize_with_seed_args_new(fd_authorize_with_seed_args_t * self) {
    6077           0 :   fd_memset( self, 0, sizeof(fd_authorize_with_seed_args_t) );
    6078           0 :   fd_pubkey_new( &self->new_authorized_pubkey );
    6079           0 :   fd_stake_authorize_new( &self->stake_authorize );
    6080           0 :   fd_pubkey_new( &self->authority_owner );
    6081           0 : }
    6082           0 : ulong fd_authorize_with_seed_args_size( fd_authorize_with_seed_args_t const * self ) {
    6083           0 :   ulong size = 0;
    6084           0 :   size += fd_pubkey_size( &self->new_authorized_pubkey );
    6085           0 :   size += fd_stake_authorize_size( &self->stake_authorize );
    6086           0 :   do {
    6087           0 :     size += sizeof(ulong);
    6088           0 :     size += self->authority_seed_len;
    6089           0 :   } while(0);
    6090           0 :   size += fd_pubkey_size( &self->authority_owner );
    6091           0 :   return size;
    6092           0 : }
    6093             : 
    6094           0 : int fd_authorize_checked_with_seed_args_encode( fd_authorize_checked_with_seed_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6095           0 :   int err;
    6096           0 :   err = fd_stake_authorize_encode( &self->stake_authorize, ctx );
    6097           0 :   if( FD_UNLIKELY( err ) ) return err;
    6098           0 :   err = fd_bincode_uint64_encode( self->authority_seed_len, ctx );
    6099           0 :   if( FD_UNLIKELY(err) ) return err;
    6100           0 :   if( self->authority_seed_len ) {
    6101           0 :     err = fd_bincode_bytes_encode( self->authority_seed, self->authority_seed_len, ctx );
    6102           0 :     if( FD_UNLIKELY( err ) ) return err;
    6103           0 :   }
    6104           0 :   err = fd_pubkey_encode( &self->authority_owner, ctx );
    6105           0 :   if( FD_UNLIKELY( err ) ) return err;
    6106           0 :   return FD_BINCODE_SUCCESS;
    6107           0 : }
    6108           0 : static int fd_authorize_checked_with_seed_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6109           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6110           0 :   int err = 0;
    6111           0 :   err = fd_stake_authorize_decode_footprint_inner( ctx, total_sz );
    6112           0 :   if( FD_UNLIKELY( err ) ) return err;
    6113           0 :   ulong authority_seed_len;
    6114           0 :   err = fd_bincode_uint64_decode( &authority_seed_len, ctx );
    6115           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6116           0 :   *total_sz += authority_seed_len;
    6117           0 :   if( authority_seed_len ) {
    6118           0 :     err = fd_bincode_bytes_decode_footprint( authority_seed_len, ctx );
    6119           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6120           0 :     err = !fd_utf8_verify( (char const *) ctx->data - authority_seed_len, authority_seed_len );
    6121           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6122           0 :   }
    6123           0 :   err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    6124           0 :   if( FD_UNLIKELY( err ) ) return err;
    6125           0 :   return 0;
    6126           0 : }
    6127           0 : int fd_authorize_checked_with_seed_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6128           0 :   *total_sz += sizeof(fd_authorize_checked_with_seed_args_t);
    6129           0 :   void const * start_data = ctx->data;
    6130           0 :   int err = fd_authorize_checked_with_seed_args_decode_footprint_inner( ctx, total_sz );
    6131           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6132           0 :   ctx->data = start_data;
    6133           0 :   return err;
    6134           0 : }
    6135           0 : static void fd_authorize_checked_with_seed_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6136           0 :   fd_authorize_checked_with_seed_args_t * self = (fd_authorize_checked_with_seed_args_t *)struct_mem;
    6137           0 :   fd_stake_authorize_decode_inner( &self->stake_authorize, alloc_mem, ctx );
    6138           0 :   fd_bincode_uint64_decode_unsafe( &self->authority_seed_len, ctx );
    6139           0 :   if( self->authority_seed_len ) {
    6140           0 :     self->authority_seed = *alloc_mem;
    6141           0 :     fd_bincode_bytes_decode_unsafe( self->authority_seed, self->authority_seed_len, ctx );
    6142           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->authority_seed_len;
    6143           0 :   } else
    6144           0 :     self->authority_seed = NULL;
    6145           0 :   fd_pubkey_decode_inner( &self->authority_owner, alloc_mem, ctx );
    6146           0 : }
    6147           0 : void * fd_authorize_checked_with_seed_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6148           0 :   fd_authorize_checked_with_seed_args_t * self = (fd_authorize_checked_with_seed_args_t *)mem;
    6149           0 :   fd_authorize_checked_with_seed_args_new( self );
    6150           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_authorize_checked_with_seed_args_t);
    6151           0 :   void * * alloc_mem = &alloc_region;
    6152           0 :   fd_authorize_checked_with_seed_args_decode_inner( mem, alloc_mem, ctx );
    6153           0 :   return self;
    6154           0 : }
    6155           0 : void fd_authorize_checked_with_seed_args_new(fd_authorize_checked_with_seed_args_t * self) {
    6156           0 :   fd_memset( self, 0, sizeof(fd_authorize_checked_with_seed_args_t) );
    6157           0 :   fd_stake_authorize_new( &self->stake_authorize );
    6158           0 :   fd_pubkey_new( &self->authority_owner );
    6159           0 : }
    6160           0 : ulong fd_authorize_checked_with_seed_args_size( fd_authorize_checked_with_seed_args_t const * self ) {
    6161           0 :   ulong size = 0;
    6162           0 :   size += fd_stake_authorize_size( &self->stake_authorize );
    6163           0 :   do {
    6164           0 :     size += sizeof(ulong);
    6165           0 :     size += self->authority_seed_len;
    6166           0 :   } while(0);
    6167           0 :   size += fd_pubkey_size( &self->authority_owner );
    6168           0 :   return size;
    6169           0 : }
    6170             : 
    6171           0 : int fd_lockup_checked_args_encode( fd_lockup_checked_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6172           0 :   int err;
    6173           0 :   if( self->unix_timestamp != NULL ) {
    6174           0 :     err = fd_bincode_bool_encode( 1, ctx );
    6175           0 :     if( FD_UNLIKELY( err ) ) return err;
    6176           0 :     err = fd_bincode_int64_encode( self->unix_timestamp[0], ctx );
    6177           0 :     if( FD_UNLIKELY( err ) ) return err;
    6178           0 :   } else {
    6179           0 :     err = fd_bincode_bool_encode( 0, ctx );
    6180           0 :     if( FD_UNLIKELY( err ) ) return err;
    6181           0 :   }
    6182           0 :   if( self->epoch != NULL ) {
    6183           0 :     err = fd_bincode_bool_encode( 1, ctx );
    6184           0 :     if( FD_UNLIKELY( err ) ) return err;
    6185           0 :     err = fd_bincode_uint64_encode( self->epoch[0], ctx );
    6186           0 :     if( FD_UNLIKELY( err ) ) return err;
    6187           0 :   } else {
    6188           0 :     err = fd_bincode_bool_encode( 0, ctx );
    6189           0 :     if( FD_UNLIKELY( err ) ) return err;
    6190           0 :   }
    6191           0 :   return FD_BINCODE_SUCCESS;
    6192           0 : }
    6193           0 : static int fd_lockup_checked_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6194           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6195           0 :   int err = 0;
    6196           0 :   {
    6197           0 :     uchar o;
    6198           0 :     err = fd_bincode_bool_decode( &o, ctx );
    6199           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6200           0 :     if( o ) {
    6201           0 :     *total_sz += 8UL + sizeof(long);
    6202           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    6203           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6204           0 :     }
    6205           0 :   }
    6206           0 :   {
    6207           0 :     uchar o;
    6208           0 :     err = fd_bincode_bool_decode( &o, ctx );
    6209           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6210           0 :     if( o ) {
    6211           0 :     *total_sz += 8UL + sizeof(ulong);
    6212           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
    6213           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6214           0 :     }
    6215           0 :   }
    6216           0 :   return 0;
    6217           0 : }
    6218           0 : int fd_lockup_checked_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6219           0 :   *total_sz += sizeof(fd_lockup_checked_args_t);
    6220           0 :   void const * start_data = ctx->data;
    6221           0 :   int err = fd_lockup_checked_args_decode_footprint_inner( ctx, total_sz );
    6222           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6223           0 :   ctx->data = start_data;
    6224           0 :   return err;
    6225           0 : }
    6226           0 : static void fd_lockup_checked_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6227           0 :   fd_lockup_checked_args_t * self = (fd_lockup_checked_args_t *)struct_mem;
    6228           0 :   {
    6229           0 :     uchar o;
    6230           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    6231           0 :     if( o ) {
    6232           0 :       *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, 8UL );
    6233           0 :       self->unix_timestamp = *alloc_mem;
    6234           0 :       *alloc_mem = (uchar *)*alloc_mem + sizeof(long);
    6235           0 :       fd_bincode_int64_decode_unsafe( self->unix_timestamp, ctx );
    6236           0 :     } else {
    6237           0 :       self->unix_timestamp = NULL;
    6238           0 :     }
    6239           0 :   }
    6240           0 :   {
    6241           0 :     uchar o;
    6242           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    6243           0 :     if( o ) {
    6244           0 :       *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, 8UL );
    6245           0 :       self->epoch = *alloc_mem;
    6246           0 :       *alloc_mem = (uchar *)*alloc_mem + sizeof(ulong);
    6247           0 :       fd_bincode_uint64_decode_unsafe( self->epoch, ctx );
    6248           0 :     } else {
    6249           0 :       self->epoch = NULL;
    6250           0 :     }
    6251           0 :   }
    6252           0 : }
    6253           0 : void * fd_lockup_checked_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6254           0 :   fd_lockup_checked_args_t * self = (fd_lockup_checked_args_t *)mem;
    6255           0 :   fd_lockup_checked_args_new( self );
    6256           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_lockup_checked_args_t);
    6257           0 :   void * * alloc_mem = &alloc_region;
    6258           0 :   fd_lockup_checked_args_decode_inner( mem, alloc_mem, ctx );
    6259           0 :   return self;
    6260           0 : }
    6261           0 : void fd_lockup_checked_args_new(fd_lockup_checked_args_t * self) {
    6262           0 :   fd_memset( self, 0, sizeof(fd_lockup_checked_args_t) );
    6263           0 : }
    6264           0 : ulong fd_lockup_checked_args_size( fd_lockup_checked_args_t const * self ) {
    6265           0 :   ulong size = 0;
    6266           0 :   size += sizeof(char);
    6267           0 :   if( NULL != self->unix_timestamp ) {
    6268           0 :     size += sizeof(long);
    6269           0 :   }
    6270           0 :   size += sizeof(char);
    6271           0 :   if( NULL != self->epoch ) {
    6272           0 :     size += sizeof(ulong);
    6273           0 :   }
    6274           0 :   return size;
    6275           0 : }
    6276             : 
    6277           0 : int fd_lockup_args_encode( fd_lockup_args_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6278           0 :   int err;
    6279           0 :   if( self->unix_timestamp != NULL ) {
    6280           0 :     err = fd_bincode_bool_encode( 1, ctx );
    6281           0 :     if( FD_UNLIKELY( err ) ) return err;
    6282           0 :     err = fd_bincode_int64_encode( self->unix_timestamp[0], ctx );
    6283           0 :     if( FD_UNLIKELY( err ) ) return err;
    6284           0 :   } else {
    6285           0 :     err = fd_bincode_bool_encode( 0, ctx );
    6286           0 :     if( FD_UNLIKELY( err ) ) return err;
    6287           0 :   }
    6288           0 :   if( self->epoch != NULL ) {
    6289           0 :     err = fd_bincode_bool_encode( 1, ctx );
    6290           0 :     if( FD_UNLIKELY( err ) ) return err;
    6291           0 :     err = fd_bincode_uint64_encode( self->epoch[0], ctx );
    6292           0 :     if( FD_UNLIKELY( err ) ) return err;
    6293           0 :   } else {
    6294           0 :     err = fd_bincode_bool_encode( 0, ctx );
    6295           0 :     if( FD_UNLIKELY( err ) ) return err;
    6296           0 :   }
    6297           0 :   if( self->custodian != NULL ) {
    6298           0 :     err = fd_bincode_bool_encode( 1, ctx );
    6299           0 :     if( FD_UNLIKELY( err ) ) return err;
    6300           0 :     err = fd_pubkey_encode( self->custodian, ctx );
    6301           0 :     if( FD_UNLIKELY( err ) ) return err;
    6302           0 :   } else {
    6303           0 :     err = fd_bincode_bool_encode( 0, ctx );
    6304           0 :     if( FD_UNLIKELY( err ) ) return err;
    6305           0 :   }
    6306           0 :   return FD_BINCODE_SUCCESS;
    6307           0 : }
    6308           0 : static int fd_lockup_args_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6309           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6310           0 :   int err = 0;
    6311           0 :   {
    6312           0 :     uchar o;
    6313           0 :     err = fd_bincode_bool_decode( &o, ctx );
    6314           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6315           0 :     if( o ) {
    6316           0 :     *total_sz += 8UL + sizeof(long);
    6317           0 :       err = fd_bincode_int64_decode_footprint( ctx );
    6318           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6319           0 :     }
    6320           0 :   }
    6321           0 :   {
    6322           0 :     uchar o;
    6323           0 :     err = fd_bincode_bool_decode( &o, ctx );
    6324           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6325           0 :     if( o ) {
    6326           0 :     *total_sz += 8UL + sizeof(ulong);
    6327           0 :       err = fd_bincode_uint64_decode_footprint( ctx );
    6328           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6329           0 :     }
    6330           0 :   }
    6331           0 :   {
    6332           0 :     uchar o;
    6333           0 :     err = fd_bincode_bool_decode( &o, ctx );
    6334           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6335           0 :     if( o ) {
    6336           0 :     *total_sz += FD_PUBKEY_ALIGN + sizeof(fd_pubkey_t);
    6337           0 :       err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    6338           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6339           0 :     }
    6340           0 :   }
    6341           0 :   return 0;
    6342           0 : }
    6343           0 : int fd_lockup_args_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6344           0 :   *total_sz += sizeof(fd_lockup_args_t);
    6345           0 :   void const * start_data = ctx->data;
    6346           0 :   int err = fd_lockup_args_decode_footprint_inner( ctx, total_sz );
    6347           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6348           0 :   ctx->data = start_data;
    6349           0 :   return err;
    6350           0 : }
    6351           0 : static void fd_lockup_args_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6352           0 :   fd_lockup_args_t * self = (fd_lockup_args_t *)struct_mem;
    6353           0 :   {
    6354           0 :     uchar o;
    6355           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    6356           0 :     if( o ) {
    6357           0 :       *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, 8UL );
    6358           0 :       self->unix_timestamp = *alloc_mem;
    6359           0 :       *alloc_mem = (uchar *)*alloc_mem + sizeof(long);
    6360           0 :       fd_bincode_int64_decode_unsafe( self->unix_timestamp, ctx );
    6361           0 :     } else {
    6362           0 :       self->unix_timestamp = NULL;
    6363           0 :     }
    6364           0 :   }
    6365           0 :   {
    6366           0 :     uchar o;
    6367           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    6368           0 :     if( o ) {
    6369           0 :       *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, 8UL );
    6370           0 :       self->epoch = *alloc_mem;
    6371           0 :       *alloc_mem = (uchar *)*alloc_mem + sizeof(ulong);
    6372           0 :       fd_bincode_uint64_decode_unsafe( self->epoch, ctx );
    6373           0 :     } else {
    6374           0 :       self->epoch = NULL;
    6375           0 :     }
    6376           0 :   }
    6377           0 :   {
    6378           0 :     uchar o;
    6379           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    6380           0 :     if( o ) {
    6381           0 :       *alloc_mem = (void*)fd_ulong_align_up( (ulong)*alloc_mem, FD_PUBKEY_ALIGN );
    6382           0 :       self->custodian = *alloc_mem;
    6383           0 :       *alloc_mem = (uchar *)*alloc_mem + sizeof(fd_pubkey_t);
    6384           0 :       fd_pubkey_new( self->custodian );
    6385           0 :       fd_pubkey_decode_inner( self->custodian, alloc_mem, ctx );
    6386           0 :     } else {
    6387           0 :       self->custodian = NULL;
    6388           0 :     }
    6389           0 :   }
    6390           0 : }
    6391           0 : void * fd_lockup_args_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6392           0 :   fd_lockup_args_t * self = (fd_lockup_args_t *)mem;
    6393           0 :   fd_lockup_args_new( self );
    6394           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_lockup_args_t);
    6395           0 :   void * * alloc_mem = &alloc_region;
    6396           0 :   fd_lockup_args_decode_inner( mem, alloc_mem, ctx );
    6397           0 :   return self;
    6398           0 : }
    6399           0 : void fd_lockup_args_new(fd_lockup_args_t * self) {
    6400           0 :   fd_memset( self, 0, sizeof(fd_lockup_args_t) );
    6401           0 : }
    6402           0 : ulong fd_lockup_args_size( fd_lockup_args_t const * self ) {
    6403           0 :   ulong size = 0;
    6404           0 :   size += sizeof(char);
    6405           0 :   if( NULL != self->unix_timestamp ) {
    6406           0 :     size += sizeof(long);
    6407           0 :   }
    6408           0 :   size += sizeof(char);
    6409           0 :   if( NULL != self->epoch ) {
    6410           0 :     size += sizeof(ulong);
    6411           0 :   }
    6412           0 :   size += sizeof(char);
    6413           0 :   if( NULL != self->custodian ) {
    6414           0 :     size += fd_pubkey_size( self->custodian );
    6415           0 :   }
    6416           0 :   return size;
    6417           0 : }
    6418             : 
    6419           0 : FD_FN_PURE uchar fd_stake_instruction_is_initialize(fd_stake_instruction_t const * self) {
    6420           0 :   return self->discriminant == 0;
    6421           0 : }
    6422           0 : FD_FN_PURE uchar fd_stake_instruction_is_authorize(fd_stake_instruction_t const * self) {
    6423           0 :   return self->discriminant == 1;
    6424           0 : }
    6425           0 : FD_FN_PURE uchar fd_stake_instruction_is_delegate_stake(fd_stake_instruction_t const * self) {
    6426           0 :   return self->discriminant == 2;
    6427           0 : }
    6428           0 : FD_FN_PURE uchar fd_stake_instruction_is_split(fd_stake_instruction_t const * self) {
    6429           0 :   return self->discriminant == 3;
    6430           0 : }
    6431           0 : FD_FN_PURE uchar fd_stake_instruction_is_withdraw(fd_stake_instruction_t const * self) {
    6432           0 :   return self->discriminant == 4;
    6433           0 : }
    6434           0 : FD_FN_PURE uchar fd_stake_instruction_is_deactivate(fd_stake_instruction_t const * self) {
    6435           0 :   return self->discriminant == 5;
    6436           0 : }
    6437           0 : FD_FN_PURE uchar fd_stake_instruction_is_set_lockup(fd_stake_instruction_t const * self) {
    6438           0 :   return self->discriminant == 6;
    6439           0 : }
    6440           0 : FD_FN_PURE uchar fd_stake_instruction_is_merge(fd_stake_instruction_t const * self) {
    6441           0 :   return self->discriminant == 7;
    6442           0 : }
    6443           0 : FD_FN_PURE uchar fd_stake_instruction_is_authorize_with_seed(fd_stake_instruction_t const * self) {
    6444           0 :   return self->discriminant == 8;
    6445           0 : }
    6446           0 : FD_FN_PURE uchar fd_stake_instruction_is_initialize_checked(fd_stake_instruction_t const * self) {
    6447           0 :   return self->discriminant == 9;
    6448           0 : }
    6449           0 : FD_FN_PURE uchar fd_stake_instruction_is_authorize_checked(fd_stake_instruction_t const * self) {
    6450           0 :   return self->discriminant == 10;
    6451           0 : }
    6452           0 : FD_FN_PURE uchar fd_stake_instruction_is_authorize_checked_with_seed(fd_stake_instruction_t const * self) {
    6453           0 :   return self->discriminant == 11;
    6454           0 : }
    6455           0 : FD_FN_PURE uchar fd_stake_instruction_is_set_lockup_checked(fd_stake_instruction_t const * self) {
    6456           0 :   return self->discriminant == 12;
    6457           0 : }
    6458           0 : FD_FN_PURE uchar fd_stake_instruction_is_get_minimum_delegation(fd_stake_instruction_t const * self) {
    6459           0 :   return self->discriminant == 13;
    6460           0 : }
    6461           0 : FD_FN_PURE uchar fd_stake_instruction_is_deactivate_delinquent(fd_stake_instruction_t const * self) {
    6462           0 :   return self->discriminant == 14;
    6463           0 : }
    6464           0 : FD_FN_PURE uchar fd_stake_instruction_is_redelegate(fd_stake_instruction_t const * self) {
    6465           0 :   return self->discriminant == 15;
    6466           0 : }
    6467           0 : FD_FN_PURE uchar fd_stake_instruction_is_move_stake(fd_stake_instruction_t const * self) {
    6468           0 :   return self->discriminant == 16;
    6469           0 : }
    6470           0 : FD_FN_PURE uchar fd_stake_instruction_is_move_lamports(fd_stake_instruction_t const * self) {
    6471           0 :   return self->discriminant == 17;
    6472           0 : }
    6473             : void fd_stake_instruction_inner_new( fd_stake_instruction_inner_t * self, uint discriminant );
    6474           0 : int fd_stake_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6475           0 :   int err;
    6476           0 :   switch (discriminant) {
    6477           0 :   case 0: {
    6478           0 :     err = fd_stake_instruction_initialize_decode_footprint_inner( ctx, total_sz );
    6479           0 :     if( FD_UNLIKELY( err ) ) return err;
    6480           0 :     return FD_BINCODE_SUCCESS;
    6481           0 :   }
    6482           0 :   case 1: {
    6483           0 :     err = fd_stake_instruction_authorize_decode_footprint_inner( ctx, total_sz );
    6484           0 :     if( FD_UNLIKELY( err ) ) return err;
    6485           0 :     return FD_BINCODE_SUCCESS;
    6486           0 :   }
    6487           0 :   case 2: {
    6488           0 :     return FD_BINCODE_SUCCESS;
    6489           0 :   }
    6490           0 :   case 3: {
    6491           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    6492           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6493           0 :     return FD_BINCODE_SUCCESS;
    6494           0 :   }
    6495           0 :   case 4: {
    6496           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    6497           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6498           0 :     return FD_BINCODE_SUCCESS;
    6499           0 :   }
    6500           0 :   case 5: {
    6501           0 :     return FD_BINCODE_SUCCESS;
    6502           0 :   }
    6503           0 :   case 6: {
    6504           0 :     err = fd_lockup_args_decode_footprint_inner( ctx, total_sz );
    6505           0 :     if( FD_UNLIKELY( err ) ) return err;
    6506           0 :     return FD_BINCODE_SUCCESS;
    6507           0 :   }
    6508           0 :   case 7: {
    6509           0 :     return FD_BINCODE_SUCCESS;
    6510           0 :   }
    6511           0 :   case 8: {
    6512           0 :     err = fd_authorize_with_seed_args_decode_footprint_inner( ctx, total_sz );
    6513           0 :     if( FD_UNLIKELY( err ) ) return err;
    6514           0 :     return FD_BINCODE_SUCCESS;
    6515           0 :   }
    6516           0 :   case 9: {
    6517           0 :     return FD_BINCODE_SUCCESS;
    6518           0 :   }
    6519           0 :   case 10: {
    6520           0 :     err = fd_stake_authorize_decode_footprint_inner( ctx, total_sz );
    6521           0 :     if( FD_UNLIKELY( err ) ) return err;
    6522           0 :     return FD_BINCODE_SUCCESS;
    6523           0 :   }
    6524           0 :   case 11: {
    6525           0 :     err = fd_authorize_checked_with_seed_args_decode_footprint_inner( ctx, total_sz );
    6526           0 :     if( FD_UNLIKELY( err ) ) return err;
    6527           0 :     return FD_BINCODE_SUCCESS;
    6528           0 :   }
    6529           0 :   case 12: {
    6530           0 :     err = fd_lockup_checked_args_decode_footprint_inner( ctx, total_sz );
    6531           0 :     if( FD_UNLIKELY( err ) ) return err;
    6532           0 :     return FD_BINCODE_SUCCESS;
    6533           0 :   }
    6534           0 :   case 13: {
    6535           0 :     return FD_BINCODE_SUCCESS;
    6536           0 :   }
    6537           0 :   case 14: {
    6538           0 :     return FD_BINCODE_SUCCESS;
    6539           0 :   }
    6540           0 :   case 15: {
    6541           0 :     return FD_BINCODE_SUCCESS;
    6542           0 :   }
    6543           0 :   case 16: {
    6544           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    6545           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6546           0 :     return FD_BINCODE_SUCCESS;
    6547           0 :   }
    6548           0 :   case 17: {
    6549           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    6550           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    6551           0 :     return FD_BINCODE_SUCCESS;
    6552           0 :   }
    6553           0 :   default: return FD_BINCODE_ERR_ENCODING;
    6554           0 :   }
    6555           0 : }
    6556           0 : static int fd_stake_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6557           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6558           0 :   uint discriminant = 0;
    6559           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    6560           0 :   if( FD_UNLIKELY( err ) ) return err;
    6561           0 :   return fd_stake_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    6562           0 : }
    6563           0 : int fd_stake_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6564           0 :   *total_sz += sizeof(fd_stake_instruction_t);
    6565           0 :   void const * start_data = ctx->data;
    6566           0 :   int err =  fd_stake_instruction_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_stake_instruction_inner_decode_inner( fd_stake_instruction_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    6572           0 :   switch (discriminant) {
    6573           0 :   case 0: {
    6574           0 :     fd_stake_instruction_initialize_decode_inner( &self->initialize, alloc_mem, ctx );
    6575           0 :     break;
    6576           0 :   }
    6577           0 :   case 1: {
    6578           0 :     fd_stake_instruction_authorize_decode_inner( &self->authorize, alloc_mem, ctx );
    6579           0 :     break;
    6580           0 :   }
    6581           0 :   case 2: {
    6582           0 :     break;
    6583           0 :   }
    6584           0 :   case 3: {
    6585           0 :     fd_bincode_uint64_decode_unsafe( &self->split, ctx );
    6586           0 :     break;
    6587           0 :   }
    6588           0 :   case 4: {
    6589           0 :     fd_bincode_uint64_decode_unsafe( &self->withdraw, ctx );
    6590           0 :     break;
    6591           0 :   }
    6592           0 :   case 5: {
    6593           0 :     break;
    6594           0 :   }
    6595           0 :   case 6: {
    6596           0 :     fd_lockup_args_decode_inner( &self->set_lockup, alloc_mem, ctx );
    6597           0 :     break;
    6598           0 :   }
    6599           0 :   case 7: {
    6600           0 :     break;
    6601           0 :   }
    6602           0 :   case 8: {
    6603           0 :     fd_authorize_with_seed_args_decode_inner( &self->authorize_with_seed, alloc_mem, ctx );
    6604           0 :     break;
    6605           0 :   }
    6606           0 :   case 9: {
    6607           0 :     break;
    6608           0 :   }
    6609           0 :   case 10: {
    6610           0 :     fd_stake_authorize_decode_inner( &self->authorize_checked, alloc_mem, ctx );
    6611           0 :     break;
    6612           0 :   }
    6613           0 :   case 11: {
    6614           0 :     fd_authorize_checked_with_seed_args_decode_inner( &self->authorize_checked_with_seed, alloc_mem, ctx );
    6615           0 :     break;
    6616           0 :   }
    6617           0 :   case 12: {
    6618           0 :     fd_lockup_checked_args_decode_inner( &self->set_lockup_checked, alloc_mem, ctx );
    6619           0 :     break;
    6620           0 :   }
    6621           0 :   case 13: {
    6622           0 :     break;
    6623           0 :   }
    6624           0 :   case 14: {
    6625           0 :     break;
    6626           0 :   }
    6627           0 :   case 15: {
    6628           0 :     break;
    6629           0 :   }
    6630           0 :   case 16: {
    6631           0 :     fd_bincode_uint64_decode_unsafe( &self->move_stake, ctx );
    6632           0 :     break;
    6633           0 :   }
    6634           0 :   case 17: {
    6635           0 :     fd_bincode_uint64_decode_unsafe( &self->move_lamports, ctx );
    6636           0 :     break;
    6637           0 :   }
    6638           0 :   }
    6639           0 : }
    6640           0 : static void fd_stake_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6641           0 :   fd_stake_instruction_t * self = (fd_stake_instruction_t *)struct_mem;
    6642           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    6643           0 :   fd_stake_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    6644           0 : }
    6645           0 : void * fd_stake_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6646           0 :   fd_stake_instruction_t * self = (fd_stake_instruction_t *)mem;
    6647           0 :   fd_stake_instruction_new( self );
    6648           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_instruction_t);
    6649           0 :   void * * alloc_mem = &alloc_region;
    6650           0 :   fd_stake_instruction_decode_inner( mem, alloc_mem, ctx );
    6651           0 :   return self;
    6652           0 : }
    6653           0 : void fd_stake_instruction_inner_new( fd_stake_instruction_inner_t * self, uint discriminant ) {
    6654           0 :   switch( discriminant ) {
    6655           0 :   case 0: {
    6656           0 :     fd_stake_instruction_initialize_new( &self->initialize );
    6657           0 :     break;
    6658           0 :   }
    6659           0 :   case 1: {
    6660           0 :     fd_stake_instruction_authorize_new( &self->authorize );
    6661           0 :     break;
    6662           0 :   }
    6663           0 :   case 2: {
    6664           0 :     break;
    6665           0 :   }
    6666           0 :   case 3: {
    6667           0 :     break;
    6668           0 :   }
    6669           0 :   case 4: {
    6670           0 :     break;
    6671           0 :   }
    6672           0 :   case 5: {
    6673           0 :     break;
    6674           0 :   }
    6675           0 :   case 6: {
    6676           0 :     fd_lockup_args_new( &self->set_lockup );
    6677           0 :     break;
    6678           0 :   }
    6679           0 :   case 7: {
    6680           0 :     break;
    6681           0 :   }
    6682           0 :   case 8: {
    6683           0 :     fd_authorize_with_seed_args_new( &self->authorize_with_seed );
    6684           0 :     break;
    6685           0 :   }
    6686           0 :   case 9: {
    6687           0 :     break;
    6688           0 :   }
    6689           0 :   case 10: {
    6690           0 :     fd_stake_authorize_new( &self->authorize_checked );
    6691           0 :     break;
    6692           0 :   }
    6693           0 :   case 11: {
    6694           0 :     fd_authorize_checked_with_seed_args_new( &self->authorize_checked_with_seed );
    6695           0 :     break;
    6696           0 :   }
    6697           0 :   case 12: {
    6698           0 :     fd_lockup_checked_args_new( &self->set_lockup_checked );
    6699           0 :     break;
    6700           0 :   }
    6701           0 :   case 13: {
    6702           0 :     break;
    6703           0 :   }
    6704           0 :   case 14: {
    6705           0 :     break;
    6706           0 :   }
    6707           0 :   case 15: {
    6708           0 :     break;
    6709           0 :   }
    6710           0 :   case 16: {
    6711           0 :     break;
    6712           0 :   }
    6713           0 :   case 17: {
    6714           0 :     break;
    6715           0 :   }
    6716           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    6717           0 :   }
    6718           0 : }
    6719           0 : void fd_stake_instruction_new_disc( fd_stake_instruction_t * self, uint discriminant ) {
    6720           0 :   self->discriminant = discriminant;
    6721           0 :   fd_stake_instruction_inner_new( &self->inner, self->discriminant );
    6722           0 : }
    6723           0 : void fd_stake_instruction_new( fd_stake_instruction_t * self ) {
    6724           0 :   fd_memset( self, 0, sizeof(fd_stake_instruction_t) );
    6725           0 :   fd_stake_instruction_new_disc( self, UINT_MAX );
    6726           0 : }
    6727             : 
    6728           0 : ulong fd_stake_instruction_size( fd_stake_instruction_t const * self ) {
    6729           0 :   ulong size = 0;
    6730           0 :   size += sizeof(uint);
    6731           0 :   switch (self->discriminant) {
    6732           0 :   case 0: {
    6733           0 :     size += fd_stake_instruction_initialize_size( &self->inner.initialize );
    6734           0 :     break;
    6735           0 :   }
    6736           0 :   case 1: {
    6737           0 :     size += fd_stake_instruction_authorize_size( &self->inner.authorize );
    6738           0 :     break;
    6739           0 :   }
    6740           0 :   case 3: {
    6741           0 :     size += sizeof(ulong);
    6742           0 :     break;
    6743           0 :   }
    6744           0 :   case 4: {
    6745           0 :     size += sizeof(ulong);
    6746           0 :     break;
    6747           0 :   }
    6748           0 :   case 6: {
    6749           0 :     size += fd_lockup_args_size( &self->inner.set_lockup );
    6750           0 :     break;
    6751           0 :   }
    6752           0 :   case 8: {
    6753           0 :     size += fd_authorize_with_seed_args_size( &self->inner.authorize_with_seed );
    6754           0 :     break;
    6755           0 :   }
    6756           0 :   case 10: {
    6757           0 :     size += fd_stake_authorize_size( &self->inner.authorize_checked );
    6758           0 :     break;
    6759           0 :   }
    6760           0 :   case 11: {
    6761           0 :     size += fd_authorize_checked_with_seed_args_size( &self->inner.authorize_checked_with_seed );
    6762           0 :     break;
    6763           0 :   }
    6764           0 :   case 12: {
    6765           0 :     size += fd_lockup_checked_args_size( &self->inner.set_lockup_checked );
    6766           0 :     break;
    6767           0 :   }
    6768           0 :   case 16: {
    6769           0 :     size += sizeof(ulong);
    6770           0 :     break;
    6771           0 :   }
    6772           0 :   case 17: {
    6773           0 :     size += sizeof(ulong);
    6774           0 :     break;
    6775           0 :   }
    6776           0 :   }
    6777           0 :   return size;
    6778           0 : }
    6779             : 
    6780           0 : int fd_stake_instruction_inner_encode( fd_stake_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    6781           0 :   int err;
    6782           0 :   switch (discriminant) {
    6783           0 :   case 0: {
    6784           0 :     err = fd_stake_instruction_initialize_encode( &self->initialize, ctx );
    6785           0 :     if( FD_UNLIKELY( err ) ) return err;
    6786           0 :     break;
    6787           0 :   }
    6788           0 :   case 1: {
    6789           0 :     err = fd_stake_instruction_authorize_encode( &self->authorize, ctx );
    6790           0 :     if( FD_UNLIKELY( err ) ) return err;
    6791           0 :     break;
    6792           0 :   }
    6793           0 :   case 3: {
    6794           0 :     err = fd_bincode_uint64_encode( self->split, ctx );
    6795           0 :     if( FD_UNLIKELY( err ) ) return err;
    6796           0 :     break;
    6797           0 :   }
    6798           0 :   case 4: {
    6799           0 :     err = fd_bincode_uint64_encode( self->withdraw, ctx );
    6800           0 :     if( FD_UNLIKELY( err ) ) return err;
    6801           0 :     break;
    6802           0 :   }
    6803           0 :   case 6: {
    6804           0 :     err = fd_lockup_args_encode( &self->set_lockup, ctx );
    6805           0 :     if( FD_UNLIKELY( err ) ) return err;
    6806           0 :     break;
    6807           0 :   }
    6808           0 :   case 8: {
    6809           0 :     err = fd_authorize_with_seed_args_encode( &self->authorize_with_seed, ctx );
    6810           0 :     if( FD_UNLIKELY( err ) ) return err;
    6811           0 :     break;
    6812           0 :   }
    6813           0 :   case 10: {
    6814           0 :     err = fd_stake_authorize_encode( &self->authorize_checked, ctx );
    6815           0 :     if( FD_UNLIKELY( err ) ) return err;
    6816           0 :     break;
    6817           0 :   }
    6818           0 :   case 11: {
    6819           0 :     err = fd_authorize_checked_with_seed_args_encode( &self->authorize_checked_with_seed, ctx );
    6820           0 :     if( FD_UNLIKELY( err ) ) return err;
    6821           0 :     break;
    6822           0 :   }
    6823           0 :   case 12: {
    6824           0 :     err = fd_lockup_checked_args_encode( &self->set_lockup_checked, ctx );
    6825           0 :     if( FD_UNLIKELY( err ) ) return err;
    6826           0 :     break;
    6827           0 :   }
    6828           0 :   case 16: {
    6829           0 :     err = fd_bincode_uint64_encode( self->move_stake, ctx );
    6830           0 :     if( FD_UNLIKELY( err ) ) return err;
    6831           0 :     break;
    6832           0 :   }
    6833           0 :   case 17: {
    6834           0 :     err = fd_bincode_uint64_encode( self->move_lamports, ctx );
    6835           0 :     if( FD_UNLIKELY( err ) ) return err;
    6836           0 :     break;
    6837           0 :   }
    6838           0 :   }
    6839           0 :   return FD_BINCODE_SUCCESS;
    6840           0 : }
    6841           0 : int fd_stake_instruction_encode( fd_stake_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6842           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    6843           0 :   if( FD_UNLIKELY( err ) ) return err;
    6844           0 :   return fd_stake_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    6845           0 : }
    6846             : 
    6847          12 : int fd_stake_meta_encode( fd_stake_meta_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6848          12 :   int err;
    6849          12 :   err = fd_bincode_uint64_encode( self->rent_exempt_reserve, ctx );
    6850          12 :   if( FD_UNLIKELY( err ) ) return err;
    6851          12 :   err = fd_stake_authorized_encode( &self->authorized, ctx );
    6852          12 :   if( FD_UNLIKELY( err ) ) return err;
    6853          12 :   err = fd_stake_lockup_encode( &self->lockup, ctx );
    6854          12 :   if( FD_UNLIKELY( err ) ) return err;
    6855          12 :   return FD_BINCODE_SUCCESS;
    6856          12 : }
    6857           0 : static inline int fd_stake_meta_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6858           0 :   if( (ulong)ctx->data + 120UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6859           0 :   ctx->data = (void *)( (ulong)ctx->data + 120UL );
    6860           0 :   return 0;
    6861           0 : }
    6862           0 : static void fd_stake_meta_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6863           0 :   fd_stake_meta_t * self = (fd_stake_meta_t *)struct_mem;
    6864           0 :   fd_bincode_uint64_decode_unsafe( &self->rent_exempt_reserve, ctx );
    6865           0 :   fd_stake_authorized_decode_inner( &self->authorized, alloc_mem, ctx );
    6866           0 :   fd_stake_lockup_decode_inner( &self->lockup, alloc_mem, ctx );
    6867           0 : }
    6868           0 : void * fd_stake_meta_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6869           0 :   fd_stake_meta_t * self = (fd_stake_meta_t *)mem;
    6870           0 :   fd_stake_meta_new( self );
    6871           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_meta_t);
    6872           0 :   void * * alloc_mem = &alloc_region;
    6873           0 :   fd_stake_meta_decode_inner( mem, alloc_mem, ctx );
    6874           0 :   return self;
    6875           0 : }
    6876          12 : int fd_stake_flags_encode( fd_stake_flags_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6877          12 :   int err;
    6878          12 :   err = fd_bincode_uint8_encode( (uchar)(self->bits), ctx );
    6879          12 :   if( FD_UNLIKELY( err ) ) return err;
    6880          12 :   return FD_BINCODE_SUCCESS;
    6881          12 : }
    6882           0 : static inline int fd_stake_flags_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6883           0 :   if( (ulong)ctx->data + 1UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6884           0 :   ctx->data = (void *)( (ulong)ctx->data + 1UL );
    6885           0 :   return 0;
    6886           0 : }
    6887           0 : static void fd_stake_flags_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6888           0 :   fd_stake_flags_t * self = (fd_stake_flags_t *)struct_mem;
    6889           0 :   fd_bincode_uint8_decode_unsafe( &self->bits, ctx );
    6890           0 : }
    6891           0 : void * fd_stake_flags_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6892           0 :   fd_stake_flags_t * self = (fd_stake_flags_t *)mem;
    6893           0 :   fd_stake_flags_new( self );
    6894           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_flags_t);
    6895           0 :   void * * alloc_mem = &alloc_region;
    6896           0 :   fd_stake_flags_decode_inner( mem, alloc_mem, ctx );
    6897           0 :   return self;
    6898           0 : }
    6899           0 : int fd_stake_state_v2_initialized_encode( fd_stake_state_v2_initialized_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6900           0 :   int err;
    6901           0 :   err = fd_stake_meta_encode( &self->meta, ctx );
    6902           0 :   if( FD_UNLIKELY( err ) ) return err;
    6903           0 :   return FD_BINCODE_SUCCESS;
    6904           0 : }
    6905           0 : static inline int fd_stake_state_v2_initialized_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6906           0 :   if( (ulong)ctx->data + 120UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6907           0 :   ctx->data = (void *)( (ulong)ctx->data + 120UL );
    6908           0 :   return 0;
    6909           0 : }
    6910           0 : static void fd_stake_state_v2_initialized_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6911           0 :   fd_stake_state_v2_initialized_t * self = (fd_stake_state_v2_initialized_t *)struct_mem;
    6912           0 :   fd_stake_meta_decode_inner( &self->meta, alloc_mem, ctx );
    6913           0 : }
    6914           0 : void * fd_stake_state_v2_initialized_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6915           0 :   fd_stake_state_v2_initialized_t * self = (fd_stake_state_v2_initialized_t *)mem;
    6916           0 :   fd_stake_state_v2_initialized_new( self );
    6917           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_state_v2_initialized_t);
    6918           0 :   void * * alloc_mem = &alloc_region;
    6919           0 :   fd_stake_state_v2_initialized_decode_inner( mem, alloc_mem, ctx );
    6920           0 :   return self;
    6921           0 : }
    6922          12 : int fd_stake_state_v2_stake_encode( fd_stake_state_v2_stake_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    6923          12 :   int err;
    6924          12 :   err = fd_stake_meta_encode( &self->meta, ctx );
    6925          12 :   if( FD_UNLIKELY( err ) ) return err;
    6926          12 :   err = fd_stake_encode( &self->stake, ctx );
    6927          12 :   if( FD_UNLIKELY( err ) ) return err;
    6928          12 :   err = fd_stake_flags_encode( &self->stake_flags, ctx );
    6929          12 :   if( FD_UNLIKELY( err ) ) return err;
    6930          12 :   return FD_BINCODE_SUCCESS;
    6931          12 : }
    6932           0 : static inline int fd_stake_state_v2_stake_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6933           0 :   if( (ulong)ctx->data + 193UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6934           0 :   ctx->data = (void *)( (ulong)ctx->data + 193UL );
    6935           0 :   return 0;
    6936           0 : }
    6937           0 : static void fd_stake_state_v2_stake_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    6938           0 :   fd_stake_state_v2_stake_t * self = (fd_stake_state_v2_stake_t *)struct_mem;
    6939           0 :   fd_stake_meta_decode_inner( &self->meta, alloc_mem, ctx );
    6940           0 :   fd_stake_decode_inner( &self->stake, alloc_mem, ctx );
    6941           0 :   fd_stake_flags_decode_inner( &self->stake_flags, alloc_mem, ctx );
    6942           0 : }
    6943           0 : void * fd_stake_state_v2_stake_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    6944           0 :   fd_stake_state_v2_stake_t * self = (fd_stake_state_v2_stake_t *)mem;
    6945           0 :   fd_stake_state_v2_stake_new( self );
    6946           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_state_v2_stake_t);
    6947           0 :   void * * alloc_mem = &alloc_region;
    6948           0 :   fd_stake_state_v2_stake_decode_inner( mem, alloc_mem, ctx );
    6949           0 :   return self;
    6950           0 : }
    6951           0 : FD_FN_PURE uchar fd_stake_state_v2_is_uninitialized(fd_stake_state_v2_t const * self) {
    6952           0 :   return self->discriminant == 0;
    6953           0 : }
    6954           0 : FD_FN_PURE uchar fd_stake_state_v2_is_initialized(fd_stake_state_v2_t const * self) {
    6955           0 :   return self->discriminant == 1;
    6956           0 : }
    6957           0 : FD_FN_PURE uchar fd_stake_state_v2_is_stake(fd_stake_state_v2_t const * self) {
    6958           0 :   return self->discriminant == 2;
    6959           0 : }
    6960           0 : FD_FN_PURE uchar fd_stake_state_v2_is_rewards_pool(fd_stake_state_v2_t const * self) {
    6961           0 :   return self->discriminant == 3;
    6962           0 : }
    6963             : void fd_stake_state_v2_inner_new( fd_stake_state_v2_inner_t * self, uint discriminant );
    6964           0 : int fd_stake_state_v2_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6965           0 :   int err;
    6966           0 :   switch (discriminant) {
    6967           0 :   case 0: {
    6968           0 :     return FD_BINCODE_SUCCESS;
    6969           0 :   }
    6970           0 :   case 1: {
    6971           0 :     err = fd_stake_state_v2_initialized_decode_footprint_inner( ctx, total_sz );
    6972           0 :     if( FD_UNLIKELY( err ) ) return err;
    6973           0 :     return FD_BINCODE_SUCCESS;
    6974           0 :   }
    6975           0 :   case 2: {
    6976           0 :     err = fd_stake_state_v2_stake_decode_footprint_inner( ctx, total_sz );
    6977           0 :     if( FD_UNLIKELY( err ) ) return err;
    6978           0 :     return FD_BINCODE_SUCCESS;
    6979           0 :   }
    6980           0 :   case 3: {
    6981           0 :     return FD_BINCODE_SUCCESS;
    6982           0 :   }
    6983           0 :   default: return FD_BINCODE_ERR_ENCODING;
    6984           0 :   }
    6985           0 : }
    6986           0 : static int fd_stake_state_v2_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6987           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6988           0 :   uint discriminant = 0;
    6989           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    6990           0 :   if( FD_UNLIKELY( err ) ) return err;
    6991           0 :   return fd_stake_state_v2_inner_decode_footprint( discriminant, ctx, total_sz );
    6992           0 : }
    6993           0 : int fd_stake_state_v2_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    6994           0 :   *total_sz += sizeof(fd_stake_state_v2_t);
    6995           0 :   void const * start_data = ctx->data;
    6996           0 :   int err =  fd_stake_state_v2_decode_footprint_inner( ctx, total_sz );
    6997           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    6998           0 :   ctx->data = start_data;
    6999           0 :   return err;
    7000           0 : }
    7001           0 : static void fd_stake_state_v2_inner_decode_inner( fd_stake_state_v2_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    7002           0 :   switch (discriminant) {
    7003           0 :   case 0: {
    7004           0 :     break;
    7005           0 :   }
    7006           0 :   case 1: {
    7007           0 :     fd_stake_state_v2_initialized_decode_inner( &self->initialized, alloc_mem, ctx );
    7008           0 :     break;
    7009           0 :   }
    7010           0 :   case 2: {
    7011           0 :     fd_stake_state_v2_stake_decode_inner( &self->stake, alloc_mem, ctx );
    7012           0 :     break;
    7013           0 :   }
    7014           0 :   case 3: {
    7015           0 :     break;
    7016           0 :   }
    7017           0 :   }
    7018           0 : }
    7019           0 : static void fd_stake_state_v2_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7020           0 :   fd_stake_state_v2_t * self = (fd_stake_state_v2_t *)struct_mem;
    7021           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    7022           0 :   fd_stake_state_v2_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    7023           0 : }
    7024           0 : void * fd_stake_state_v2_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7025           0 :   fd_stake_state_v2_t * self = (fd_stake_state_v2_t *)mem;
    7026           0 :   fd_stake_state_v2_new( self );
    7027           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_stake_state_v2_t);
    7028           0 :   void * * alloc_mem = &alloc_region;
    7029           0 :   fd_stake_state_v2_decode_inner( mem, alloc_mem, ctx );
    7030           0 :   return self;
    7031           0 : }
    7032          12 : void fd_stake_state_v2_inner_new( fd_stake_state_v2_inner_t * self, uint discriminant ) {
    7033          12 :   switch( discriminant ) {
    7034           0 :   case 0: {
    7035           0 :     break;
    7036           0 :   }
    7037           0 :   case 1: {
    7038           0 :     fd_stake_state_v2_initialized_new( &self->initialized );
    7039           0 :     break;
    7040           0 :   }
    7041          12 :   case 2: {
    7042          12 :     fd_stake_state_v2_stake_new( &self->stake );
    7043          12 :     break;
    7044           0 :   }
    7045           0 :   case 3: {
    7046           0 :     break;
    7047           0 :   }
    7048           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    7049          12 :   }
    7050          12 : }
    7051          12 : void fd_stake_state_v2_new_disc( fd_stake_state_v2_t * self, uint discriminant ) {
    7052          12 :   self->discriminant = discriminant;
    7053          12 :   fd_stake_state_v2_inner_new( &self->inner, self->discriminant );
    7054          12 : }
    7055           0 : void fd_stake_state_v2_new( fd_stake_state_v2_t * self ) {
    7056           0 :   fd_memset( self, 0, sizeof(fd_stake_state_v2_t) );
    7057           0 :   fd_stake_state_v2_new_disc( self, UINT_MAX );
    7058           0 : }
    7059             : 
    7060           0 : ulong fd_stake_state_v2_size( fd_stake_state_v2_t const * self ) {
    7061           0 :   ulong size = 0;
    7062           0 :   size += sizeof(uint);
    7063           0 :   switch (self->discriminant) {
    7064           0 :   case 1: {
    7065           0 :     size += fd_stake_state_v2_initialized_size( &self->inner.initialized );
    7066           0 :     break;
    7067           0 :   }
    7068           0 :   case 2: {
    7069           0 :     size += fd_stake_state_v2_stake_size( &self->inner.stake );
    7070           0 :     break;
    7071           0 :   }
    7072           0 :   }
    7073           0 :   return size;
    7074           0 : }
    7075             : 
    7076          12 : int fd_stake_state_v2_inner_encode( fd_stake_state_v2_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    7077          12 :   int err;
    7078          12 :   switch (discriminant) {
    7079           0 :   case 1: {
    7080           0 :     err = fd_stake_state_v2_initialized_encode( &self->initialized, ctx );
    7081           0 :     if( FD_UNLIKELY( err ) ) return err;
    7082           0 :     break;
    7083           0 :   }
    7084          12 :   case 2: {
    7085          12 :     err = fd_stake_state_v2_stake_encode( &self->stake, ctx );
    7086          12 :     if( FD_UNLIKELY( err ) ) return err;
    7087          12 :     break;
    7088          12 :   }
    7089          12 :   }
    7090          12 :   return FD_BINCODE_SUCCESS;
    7091          12 : }
    7092          12 : int fd_stake_state_v2_encode( fd_stake_state_v2_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7093          12 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    7094          12 :   if( FD_UNLIKELY( err ) ) return err;
    7095          12 :   return fd_stake_state_v2_inner_encode( &self->inner, self->discriminant, ctx );
    7096          12 : }
    7097             : 
    7098           0 : int fd_nonce_data_encode( fd_nonce_data_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7099           0 :   int err;
    7100           0 :   err = fd_pubkey_encode( &self->authority, ctx );
    7101           0 :   if( FD_UNLIKELY( err ) ) return err;
    7102           0 :   err = fd_hash_encode( &self->durable_nonce, ctx );
    7103           0 :   if( FD_UNLIKELY( err ) ) return err;
    7104           0 :   err = fd_fee_calculator_encode( &self->fee_calculator, ctx );
    7105           0 :   if( FD_UNLIKELY( err ) ) return err;
    7106           0 :   return FD_BINCODE_SUCCESS;
    7107           0 : }
    7108           0 : static inline int fd_nonce_data_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7109           0 :   if( (ulong)ctx->data + 72UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7110           0 :   ctx->data = (void *)( (ulong)ctx->data + 72UL );
    7111           0 :   return 0;
    7112           0 : }
    7113           0 : static void fd_nonce_data_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7114           0 :   fd_nonce_data_t * self = (fd_nonce_data_t *)struct_mem;
    7115           0 :   fd_pubkey_decode_inner( &self->authority, alloc_mem, ctx );
    7116           0 :   fd_hash_decode_inner( &self->durable_nonce, alloc_mem, ctx );
    7117           0 :   fd_fee_calculator_decode_inner( &self->fee_calculator, alloc_mem, ctx );
    7118           0 : }
    7119           0 : void * fd_nonce_data_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7120           0 :   fd_nonce_data_t * self = (fd_nonce_data_t *)mem;
    7121           0 :   fd_nonce_data_new( self );
    7122           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_nonce_data_t);
    7123           0 :   void * * alloc_mem = &alloc_region;
    7124           0 :   fd_nonce_data_decode_inner( mem, alloc_mem, ctx );
    7125           0 :   return self;
    7126           0 : }
    7127           0 : FD_FN_PURE uchar fd_nonce_state_is_uninitialized(fd_nonce_state_t const * self) {
    7128           0 :   return self->discriminant == 0;
    7129           0 : }
    7130           0 : FD_FN_PURE uchar fd_nonce_state_is_initialized(fd_nonce_state_t const * self) {
    7131           0 :   return self->discriminant == 1;
    7132           0 : }
    7133             : void fd_nonce_state_inner_new( fd_nonce_state_inner_t * self, uint discriminant );
    7134           0 : int fd_nonce_state_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7135           0 :   int err;
    7136           0 :   switch (discriminant) {
    7137           0 :   case 0: {
    7138           0 :     return FD_BINCODE_SUCCESS;
    7139           0 :   }
    7140           0 :   case 1: {
    7141           0 :     err = fd_nonce_data_decode_footprint_inner( ctx, total_sz );
    7142           0 :     if( FD_UNLIKELY( err ) ) return err;
    7143           0 :     return FD_BINCODE_SUCCESS;
    7144           0 :   }
    7145           0 :   default: return FD_BINCODE_ERR_ENCODING;
    7146           0 :   }
    7147           0 : }
    7148           0 : static int fd_nonce_state_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7149           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7150           0 :   uint discriminant = 0;
    7151           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    7152           0 :   if( FD_UNLIKELY( err ) ) return err;
    7153           0 :   return fd_nonce_state_inner_decode_footprint( discriminant, ctx, total_sz );
    7154           0 : }
    7155           0 : int fd_nonce_state_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7156           0 :   *total_sz += sizeof(fd_nonce_state_t);
    7157           0 :   void const * start_data = ctx->data;
    7158           0 :   int err =  fd_nonce_state_decode_footprint_inner( ctx, total_sz );
    7159           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7160           0 :   ctx->data = start_data;
    7161           0 :   return err;
    7162           0 : }
    7163           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 ) {
    7164           0 :   switch (discriminant) {
    7165           0 :   case 0: {
    7166           0 :     break;
    7167           0 :   }
    7168           0 :   case 1: {
    7169           0 :     fd_nonce_data_decode_inner( &self->initialized, alloc_mem, ctx );
    7170           0 :     break;
    7171           0 :   }
    7172           0 :   }
    7173           0 : }
    7174           0 : static void fd_nonce_state_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7175           0 :   fd_nonce_state_t * self = (fd_nonce_state_t *)struct_mem;
    7176           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    7177           0 :   fd_nonce_state_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    7178           0 : }
    7179           0 : void * fd_nonce_state_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7180           0 :   fd_nonce_state_t * self = (fd_nonce_state_t *)mem;
    7181           0 :   fd_nonce_state_new( self );
    7182           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_nonce_state_t);
    7183           0 :   void * * alloc_mem = &alloc_region;
    7184           0 :   fd_nonce_state_decode_inner( mem, alloc_mem, ctx );
    7185           0 :   return self;
    7186           0 : }
    7187           0 : void fd_nonce_state_inner_new( fd_nonce_state_inner_t * self, uint discriminant ) {
    7188           0 :   switch( discriminant ) {
    7189           0 :   case 0: {
    7190           0 :     break;
    7191           0 :   }
    7192           0 :   case 1: {
    7193           0 :     fd_nonce_data_new( &self->initialized );
    7194           0 :     break;
    7195           0 :   }
    7196           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    7197           0 :   }
    7198           0 : }
    7199           0 : void fd_nonce_state_new_disc( fd_nonce_state_t * self, uint discriminant ) {
    7200           0 :   self->discriminant = discriminant;
    7201           0 :   fd_nonce_state_inner_new( &self->inner, self->discriminant );
    7202           0 : }
    7203           0 : void fd_nonce_state_new( fd_nonce_state_t * self ) {
    7204           0 :   fd_memset( self, 0, sizeof(fd_nonce_state_t) );
    7205           0 :   fd_nonce_state_new_disc( self, UINT_MAX );
    7206           0 : }
    7207             : 
    7208           0 : ulong fd_nonce_state_size( fd_nonce_state_t const * self ) {
    7209           0 :   ulong size = 0;
    7210           0 :   size += sizeof(uint);
    7211           0 :   switch (self->discriminant) {
    7212           0 :   case 1: {
    7213           0 :     size += fd_nonce_data_size( &self->inner.initialized );
    7214           0 :     break;
    7215           0 :   }
    7216           0 :   }
    7217           0 :   return size;
    7218           0 : }
    7219             : 
    7220           0 : int fd_nonce_state_inner_encode( fd_nonce_state_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    7221           0 :   int err;
    7222           0 :   switch (discriminant) {
    7223           0 :   case 1: {
    7224           0 :     err = fd_nonce_data_encode( &self->initialized, ctx );
    7225           0 :     if( FD_UNLIKELY( err ) ) return err;
    7226           0 :     break;
    7227           0 :   }
    7228           0 :   }
    7229           0 :   return FD_BINCODE_SUCCESS;
    7230           0 : }
    7231           0 : int fd_nonce_state_encode( fd_nonce_state_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7232           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    7233           0 :   if( FD_UNLIKELY( err ) ) return err;
    7234           0 :   return fd_nonce_state_inner_encode( &self->inner, self->discriminant, ctx );
    7235           0 : }
    7236             : 
    7237           0 : FD_FN_PURE uchar fd_nonce_state_versions_is_legacy(fd_nonce_state_versions_t const * self) {
    7238           0 :   return self->discriminant == 0;
    7239           0 : }
    7240           0 : FD_FN_PURE uchar fd_nonce_state_versions_is_current(fd_nonce_state_versions_t const * self) {
    7241           0 :   return self->discriminant == 1;
    7242           0 : }
    7243             : void fd_nonce_state_versions_inner_new( fd_nonce_state_versions_inner_t * self, uint discriminant );
    7244           0 : int fd_nonce_state_versions_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7245           0 :   int err;
    7246           0 :   switch (discriminant) {
    7247           0 :   case 0: {
    7248           0 :     err = fd_nonce_state_decode_footprint_inner( ctx, total_sz );
    7249           0 :     if( FD_UNLIKELY( err ) ) return err;
    7250           0 :     return FD_BINCODE_SUCCESS;
    7251           0 :   }
    7252           0 :   case 1: {
    7253           0 :     err = fd_nonce_state_decode_footprint_inner( ctx, total_sz );
    7254           0 :     if( FD_UNLIKELY( err ) ) return err;
    7255           0 :     return FD_BINCODE_SUCCESS;
    7256           0 :   }
    7257           0 :   default: return FD_BINCODE_ERR_ENCODING;
    7258           0 :   }
    7259           0 : }
    7260           0 : static int fd_nonce_state_versions_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7261           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7262           0 :   uint discriminant = 0;
    7263           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    7264           0 :   if( FD_UNLIKELY( err ) ) return err;
    7265           0 :   return fd_nonce_state_versions_inner_decode_footprint( discriminant, ctx, total_sz );
    7266           0 : }
    7267           0 : int fd_nonce_state_versions_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7268           0 :   *total_sz += sizeof(fd_nonce_state_versions_t);
    7269           0 :   void const * start_data = ctx->data;
    7270           0 :   int err =  fd_nonce_state_versions_decode_footprint_inner( ctx, total_sz );
    7271           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7272           0 :   ctx->data = start_data;
    7273           0 :   return err;
    7274           0 : }
    7275           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 ) {
    7276           0 :   switch (discriminant) {
    7277           0 :   case 0: {
    7278           0 :     fd_nonce_state_decode_inner( &self->legacy, alloc_mem, ctx );
    7279           0 :     break;
    7280           0 :   }
    7281           0 :   case 1: {
    7282           0 :     fd_nonce_state_decode_inner( &self->current, alloc_mem, ctx );
    7283           0 :     break;
    7284           0 :   }
    7285           0 :   }
    7286           0 : }
    7287           0 : static void fd_nonce_state_versions_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7288           0 :   fd_nonce_state_versions_t * self = (fd_nonce_state_versions_t *)struct_mem;
    7289           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    7290           0 :   fd_nonce_state_versions_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    7291           0 : }
    7292           0 : void * fd_nonce_state_versions_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7293           0 :   fd_nonce_state_versions_t * self = (fd_nonce_state_versions_t *)mem;
    7294           0 :   fd_nonce_state_versions_new( self );
    7295           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_nonce_state_versions_t);
    7296           0 :   void * * alloc_mem = &alloc_region;
    7297           0 :   fd_nonce_state_versions_decode_inner( mem, alloc_mem, ctx );
    7298           0 :   return self;
    7299           0 : }
    7300           0 : void fd_nonce_state_versions_inner_new( fd_nonce_state_versions_inner_t * self, uint discriminant ) {
    7301           0 :   switch( discriminant ) {
    7302           0 :   case 0: {
    7303           0 :     fd_nonce_state_new( &self->legacy );
    7304           0 :     break;
    7305           0 :   }
    7306           0 :   case 1: {
    7307           0 :     fd_nonce_state_new( &self->current );
    7308           0 :     break;
    7309           0 :   }
    7310           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    7311           0 :   }
    7312           0 : }
    7313           0 : void fd_nonce_state_versions_new_disc( fd_nonce_state_versions_t * self, uint discriminant ) {
    7314           0 :   self->discriminant = discriminant;
    7315           0 :   fd_nonce_state_versions_inner_new( &self->inner, self->discriminant );
    7316           0 : }
    7317           0 : void fd_nonce_state_versions_new( fd_nonce_state_versions_t * self ) {
    7318           0 :   fd_memset( self, 0, sizeof(fd_nonce_state_versions_t) );
    7319           0 :   fd_nonce_state_versions_new_disc( self, UINT_MAX );
    7320           0 : }
    7321             : 
    7322           0 : ulong fd_nonce_state_versions_size( fd_nonce_state_versions_t const * self ) {
    7323           0 :   ulong size = 0;
    7324           0 :   size += sizeof(uint);
    7325           0 :   switch (self->discriminant) {
    7326           0 :   case 0: {
    7327           0 :     size += fd_nonce_state_size( &self->inner.legacy );
    7328           0 :     break;
    7329           0 :   }
    7330           0 :   case 1: {
    7331           0 :     size += fd_nonce_state_size( &self->inner.current );
    7332           0 :     break;
    7333           0 :   }
    7334           0 :   }
    7335           0 :   return size;
    7336           0 : }
    7337             : 
    7338           0 : int fd_nonce_state_versions_inner_encode( fd_nonce_state_versions_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    7339           0 :   int err;
    7340           0 :   switch (discriminant) {
    7341           0 :   case 0: {
    7342           0 :     err = fd_nonce_state_encode( &self->legacy, ctx );
    7343           0 :     if( FD_UNLIKELY( err ) ) return err;
    7344           0 :     break;
    7345           0 :   }
    7346           0 :   case 1: {
    7347           0 :     err = fd_nonce_state_encode( &self->current, ctx );
    7348           0 :     if( FD_UNLIKELY( err ) ) return err;
    7349           0 :     break;
    7350           0 :   }
    7351           0 :   }
    7352           0 :   return FD_BINCODE_SUCCESS;
    7353           0 : }
    7354           0 : int fd_nonce_state_versions_encode( fd_nonce_state_versions_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7355           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    7356           0 :   if( FD_UNLIKELY( err ) ) return err;
    7357           0 :   return fd_nonce_state_versions_inner_encode( &self->inner, self->discriminant, ctx );
    7358           0 : }
    7359             : 
    7360           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 ) {
    7361           0 :   int err;
    7362           0 :   err = fd_bincode_uint32_encode( self->units, ctx );
    7363           0 :   if( FD_UNLIKELY( err ) ) return err;
    7364           0 :   err = fd_bincode_uint32_encode( self->additional_fee, ctx );
    7365           0 :   if( FD_UNLIKELY( err ) ) return err;
    7366           0 :   return FD_BINCODE_SUCCESS;
    7367           0 : }
    7368           0 : static inline int fd_compute_budget_program_instruction_request_units_deprecated_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7369           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7370           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
    7371           0 :   return 0;
    7372           0 : }
    7373           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 ) {
    7374           0 :   fd_compute_budget_program_instruction_request_units_deprecated_t * self = (fd_compute_budget_program_instruction_request_units_deprecated_t *)struct_mem;
    7375           0 :   fd_bincode_uint32_decode_unsafe( &self->units, ctx );
    7376           0 :   fd_bincode_uint32_decode_unsafe( &self->additional_fee, ctx );
    7377           0 : }
    7378           0 : void * fd_compute_budget_program_instruction_request_units_deprecated_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7379           0 :   fd_compute_budget_program_instruction_request_units_deprecated_t * self = (fd_compute_budget_program_instruction_request_units_deprecated_t *)mem;
    7380           0 :   fd_compute_budget_program_instruction_request_units_deprecated_new( self );
    7381           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_compute_budget_program_instruction_request_units_deprecated_t);
    7382           0 :   void * * alloc_mem = &alloc_region;
    7383           0 :   fd_compute_budget_program_instruction_request_units_deprecated_decode_inner( mem, alloc_mem, ctx );
    7384           0 :   return self;
    7385           0 : }
    7386           0 : FD_FN_PURE uchar fd_compute_budget_program_instruction_is_request_units_deprecated(fd_compute_budget_program_instruction_t const * self) {
    7387           0 :   return self->discriminant == 0;
    7388           0 : }
    7389           0 : FD_FN_PURE uchar fd_compute_budget_program_instruction_is_request_heap_frame(fd_compute_budget_program_instruction_t const * self) {
    7390           0 :   return self->discriminant == 1;
    7391           0 : }
    7392           0 : FD_FN_PURE uchar fd_compute_budget_program_instruction_is_set_compute_unit_limit(fd_compute_budget_program_instruction_t const * self) {
    7393           0 :   return self->discriminant == 2;
    7394           0 : }
    7395           0 : FD_FN_PURE uchar fd_compute_budget_program_instruction_is_set_compute_unit_price(fd_compute_budget_program_instruction_t const * self) {
    7396           0 :   return self->discriminant == 3;
    7397           0 : }
    7398           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) {
    7399           0 :   return self->discriminant == 4;
    7400           0 : }
    7401             : void fd_compute_budget_program_instruction_inner_new( fd_compute_budget_program_instruction_inner_t * self, uint discriminant );
    7402           0 : int fd_compute_budget_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7403           0 :   int err;
    7404           0 :   switch (discriminant) {
    7405           0 :   case 0: {
    7406           0 :     err = fd_compute_budget_program_instruction_request_units_deprecated_decode_footprint_inner( ctx, total_sz );
    7407           0 :     if( FD_UNLIKELY( err ) ) return err;
    7408           0 :     return FD_BINCODE_SUCCESS;
    7409           0 :   }
    7410           0 :   case 1: {
    7411           0 :     err = fd_bincode_uint32_decode_footprint( ctx );
    7412           0 :   if( FD_UNLIKELY( err ) ) return err;
    7413           0 :     return FD_BINCODE_SUCCESS;
    7414           0 :   }
    7415           0 :   case 2: {
    7416           0 :     err = fd_bincode_uint32_decode_footprint( ctx );
    7417           0 :   if( FD_UNLIKELY( err ) ) return err;
    7418           0 :     return FD_BINCODE_SUCCESS;
    7419           0 :   }
    7420           0 :   case 3: {
    7421           0 :     err = fd_bincode_uint64_decode_footprint( ctx );
    7422           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7423           0 :     return FD_BINCODE_SUCCESS;
    7424           0 :   }
    7425           0 :   case 4: {
    7426           0 :     err = fd_bincode_uint32_decode_footprint( ctx );
    7427           0 :   if( FD_UNLIKELY( err ) ) return err;
    7428           0 :     return FD_BINCODE_SUCCESS;
    7429           0 :   }
    7430           0 :   default: return FD_BINCODE_ERR_ENCODING;
    7431           0 :   }
    7432           0 : }
    7433           0 : static int fd_compute_budget_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7434           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7435           0 :   ushort discriminant = 0;
    7436           0 :   int err = fd_bincode_compact_u16_decode( &discriminant, ctx );
    7437           0 :   if( FD_UNLIKELY( err ) ) return err;
    7438           0 :   return fd_compute_budget_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    7439           0 : }
    7440           0 : int fd_compute_budget_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7441           0 :   *total_sz += sizeof(fd_compute_budget_program_instruction_t);
    7442           0 :   void const * start_data = ctx->data;
    7443           0 :   int err =  fd_compute_budget_program_instruction_decode_footprint_inner( ctx, total_sz );
    7444           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7445           0 :   ctx->data = start_data;
    7446           0 :   return err;
    7447           0 : }
    7448           0 : 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 ) {
    7449           0 :   switch (discriminant) {
    7450           0 :   case 0: {
    7451           0 :     fd_compute_budget_program_instruction_request_units_deprecated_decode_inner( &self->request_units_deprecated, alloc_mem, ctx );
    7452           0 :     break;
    7453           0 :   }
    7454           0 :   case 1: {
    7455           0 :     fd_bincode_uint32_decode_unsafe( &self->request_heap_frame, ctx );
    7456           0 :     break;
    7457           0 :   }
    7458           0 :   case 2: {
    7459           0 :     fd_bincode_uint32_decode_unsafe( &self->set_compute_unit_limit, ctx );
    7460           0 :     break;
    7461           0 :   }
    7462           0 :   case 3: {
    7463           0 :     fd_bincode_uint64_decode_unsafe( &self->set_compute_unit_price, ctx );
    7464           0 :     break;
    7465           0 :   }
    7466           0 :   case 4: {
    7467           0 :     fd_bincode_uint32_decode_unsafe( &self->set_loaded_accounts_data_size_limit, ctx );
    7468           0 :     break;
    7469           0 :   }
    7470           0 :   }
    7471           0 : }
    7472           0 : static void fd_compute_budget_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7473           0 :   fd_compute_budget_program_instruction_t * self = (fd_compute_budget_program_instruction_t *)struct_mem;
    7474           0 :   ushort tmp = 0;
    7475           0 :   fd_bincode_compact_u16_decode_unsafe( &tmp, ctx );
    7476           0 :   self->discriminant = tmp;
    7477           0 :   fd_compute_budget_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    7478           0 : }
    7479           0 : void * fd_compute_budget_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7480           0 :   fd_compute_budget_program_instruction_t * self = (fd_compute_budget_program_instruction_t *)mem;
    7481           0 :   fd_compute_budget_program_instruction_new( self );
    7482           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_compute_budget_program_instruction_t);
    7483           0 :   void * * alloc_mem = &alloc_region;
    7484           0 :   fd_compute_budget_program_instruction_decode_inner( mem, alloc_mem, ctx );
    7485           0 :   return self;
    7486           0 : }
    7487           0 : void fd_compute_budget_program_instruction_inner_new( fd_compute_budget_program_instruction_inner_t * self, uint discriminant ) {
    7488           0 :   switch( discriminant ) {
    7489           0 :   case 0: {
    7490           0 :     fd_compute_budget_program_instruction_request_units_deprecated_new( &self->request_units_deprecated );
    7491           0 :     break;
    7492           0 :   }
    7493           0 :   case 1: {
    7494           0 :     break;
    7495           0 :   }
    7496           0 :   case 2: {
    7497           0 :     break;
    7498           0 :   }
    7499           0 :   case 3: {
    7500           0 :     break;
    7501           0 :   }
    7502           0 :   case 4: {
    7503           0 :     break;
    7504           0 :   }
    7505           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    7506           0 :   }
    7507           0 : }
    7508           0 : void fd_compute_budget_program_instruction_new_disc( fd_compute_budget_program_instruction_t * self, uint discriminant ) {
    7509           0 :   self->discriminant = discriminant;
    7510           0 :   fd_compute_budget_program_instruction_inner_new( &self->inner, self->discriminant );
    7511           0 : }
    7512           0 : void fd_compute_budget_program_instruction_new( fd_compute_budget_program_instruction_t * self ) {
    7513           0 :   fd_memset( self, 0, sizeof(fd_compute_budget_program_instruction_t) );
    7514           0 :   fd_compute_budget_program_instruction_new_disc( self, UINT_MAX );
    7515           0 : }
    7516             : 
    7517           0 : ulong fd_compute_budget_program_instruction_size( fd_compute_budget_program_instruction_t const * self ) {
    7518           0 :   ulong size = 0;
    7519           0 :   size += sizeof(uint);
    7520           0 :   switch (self->discriminant) {
    7521           0 :   case 0: {
    7522           0 :     size += fd_compute_budget_program_instruction_request_units_deprecated_size( &self->inner.request_units_deprecated );
    7523           0 :     break;
    7524           0 :   }
    7525           0 :   case 1: {
    7526           0 :     size += sizeof(uint);
    7527           0 :     break;
    7528           0 :   }
    7529           0 :   case 2: {
    7530           0 :     size += sizeof(uint);
    7531           0 :     break;
    7532           0 :   }
    7533           0 :   case 3: {
    7534           0 :     size += sizeof(ulong);
    7535           0 :     break;
    7536           0 :   }
    7537           0 :   case 4: {
    7538           0 :     size += sizeof(uint);
    7539           0 :     break;
    7540           0 :   }
    7541           0 :   }
    7542           0 :   return size;
    7543           0 : }
    7544             : 
    7545           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 ) {
    7546           0 :   int err;
    7547           0 :   switch (discriminant) {
    7548           0 :   case 0: {
    7549           0 :     err = fd_compute_budget_program_instruction_request_units_deprecated_encode( &self->request_units_deprecated, ctx );
    7550           0 :     if( FD_UNLIKELY( err ) ) return err;
    7551           0 :     break;
    7552           0 :   }
    7553           0 :   case 1: {
    7554           0 :     err = fd_bincode_uint32_encode( self->request_heap_frame, ctx );
    7555           0 :   if( FD_UNLIKELY( err ) ) return err;
    7556           0 :     break;
    7557           0 :   }
    7558           0 :   case 2: {
    7559           0 :     err = fd_bincode_uint32_encode( self->set_compute_unit_limit, ctx );
    7560           0 :   if( FD_UNLIKELY( err ) ) return err;
    7561           0 :     break;
    7562           0 :   }
    7563           0 :   case 3: {
    7564           0 :     err = fd_bincode_uint64_encode( self->set_compute_unit_price, ctx );
    7565           0 :     if( FD_UNLIKELY( err ) ) return err;
    7566           0 :     break;
    7567           0 :   }
    7568           0 :   case 4: {
    7569           0 :     err = fd_bincode_uint32_encode( self->set_loaded_accounts_data_size_limit, ctx );
    7570           0 :   if( FD_UNLIKELY( err ) ) return err;
    7571           0 :     break;
    7572           0 :   }
    7573           0 :   }
    7574           0 :   return FD_BINCODE_SUCCESS;
    7575           0 : }
    7576           0 : int fd_compute_budget_program_instruction_encode( fd_compute_budget_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7577           0 :   ushort discriminant = (ushort) self->discriminant;
    7578           0 :   int err = fd_bincode_compact_u16_encode( &discriminant, ctx );
    7579           0 :   if( FD_UNLIKELY( err ) ) return err;
    7580           0 :   return fd_compute_budget_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    7581           0 : }
    7582             : 
    7583           0 : int fd_config_keys_encode( fd_config_keys_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7584           0 :   int err;
    7585           0 :   err = fd_bincode_compact_u16_encode( &self->keys_len, ctx );
    7586           0 :   if( FD_UNLIKELY(err) ) return err;
    7587           0 :   if( self->keys_len ) {
    7588           0 :     for( ulong i=0; i < self->keys_len; i++ ) {
    7589           0 :       err = fd_config_keys_pair_encode( self->keys + i, ctx );
    7590           0 :       if( FD_UNLIKELY( err ) ) return err;
    7591           0 :     }
    7592           0 :   }
    7593           0 :   return FD_BINCODE_SUCCESS;
    7594           0 : }
    7595           0 : static int fd_config_keys_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7596           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7597           0 :   int err = 0;
    7598           0 :   ushort keys_len;
    7599           0 :   err = fd_bincode_compact_u16_decode( &keys_len, ctx );
    7600           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7601           0 :   if( keys_len ) {
    7602           0 :     *total_sz += FD_CONFIG_KEYS_PAIR_ALIGN + sizeof(fd_config_keys_pair_t)*keys_len;
    7603           0 :     for( ulong i=0; i < keys_len; i++ ) {
    7604           0 :       err = fd_config_keys_pair_decode_footprint_inner( ctx, total_sz );
    7605           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7606           0 :     }
    7607           0 :   }
    7608           0 :   return 0;
    7609           0 : }
    7610           0 : int fd_config_keys_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7611           0 :   *total_sz += sizeof(fd_config_keys_t);
    7612           0 :   void const * start_data = ctx->data;
    7613           0 :   int err = fd_config_keys_decode_footprint_inner( ctx, total_sz );
    7614           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7615           0 :   ctx->data = start_data;
    7616           0 :   return err;
    7617           0 : }
    7618           0 : static void fd_config_keys_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7619           0 :   fd_config_keys_t * self = (fd_config_keys_t *)struct_mem;
    7620           0 :   fd_bincode_compact_u16_decode_unsafe( &self->keys_len, ctx );
    7621           0 :   if( self->keys_len ) {
    7622           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_CONFIG_KEYS_PAIR_ALIGN );
    7623           0 :     self->keys = *alloc_mem;
    7624           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_config_keys_pair_t)*self->keys_len;
    7625           0 :     for( ulong i=0; i < self->keys_len; i++ ) {
    7626           0 :       fd_config_keys_pair_new( self->keys + i );
    7627           0 :       fd_config_keys_pair_decode_inner( self->keys + i, alloc_mem, ctx );
    7628           0 :     }
    7629           0 :   } else
    7630           0 :     self->keys = NULL;
    7631           0 : }
    7632           0 : void * fd_config_keys_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7633           0 :   fd_config_keys_t * self = (fd_config_keys_t *)mem;
    7634           0 :   fd_config_keys_new( self );
    7635           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_config_keys_t);
    7636           0 :   void * * alloc_mem = &alloc_region;
    7637           0 :   fd_config_keys_decode_inner( mem, alloc_mem, ctx );
    7638           0 :   return self;
    7639           0 : }
    7640           0 : void fd_config_keys_new(fd_config_keys_t * self) {
    7641           0 :   fd_memset( self, 0, sizeof(fd_config_keys_t) );
    7642           0 : }
    7643           0 : ulong fd_config_keys_size( fd_config_keys_t const * self ) {
    7644           0 :   ulong size = 0;
    7645           0 :   do {
    7646           0 :     ushort tmp = (ushort)self->keys_len;
    7647           0 :     size += fd_bincode_compact_u16_size( &tmp );
    7648           0 :     for( ulong i=0; i < self->keys_len; i++ )
    7649           0 :       size += fd_config_keys_pair_size( self->keys + i );
    7650           0 :   } while(0);
    7651           0 :   return size;
    7652           0 : }
    7653             : 
    7654           0 : int fd_bpf_loader_program_instruction_write_encode( fd_bpf_loader_program_instruction_write_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7655           0 :   int err;
    7656           0 :   err = fd_bincode_uint32_encode( self->offset, ctx );
    7657           0 :   if( FD_UNLIKELY( err ) ) return err;
    7658           0 :   err = fd_bincode_uint64_encode( self->bytes_len, ctx );
    7659           0 :   if( FD_UNLIKELY(err) ) return err;
    7660           0 :   if( self->bytes_len ) {
    7661           0 :     err = fd_bincode_bytes_encode( self->bytes, self->bytes_len, ctx );
    7662           0 :     if( FD_UNLIKELY( err ) ) return err;
    7663           0 :   }
    7664           0 :   return FD_BINCODE_SUCCESS;
    7665           0 : }
    7666           0 : static int fd_bpf_loader_program_instruction_write_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7667           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7668           0 :   int err = 0;
    7669           0 :   err = fd_bincode_uint32_decode_footprint( ctx );
    7670           0 :   if( FD_UNLIKELY( err ) ) return err;
    7671           0 :   ulong bytes_len;
    7672           0 :   err = fd_bincode_uint64_decode( &bytes_len, ctx );
    7673           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7674           0 :   if( bytes_len ) {
    7675           0 :     *total_sz += 8UL + bytes_len;
    7676           0 :     err = fd_bincode_bytes_decode_footprint( bytes_len, ctx );
    7677           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7678           0 :   }
    7679           0 :   return 0;
    7680           0 : }
    7681           0 : int fd_bpf_loader_program_instruction_write_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7682           0 :   *total_sz += sizeof(fd_bpf_loader_program_instruction_write_t);
    7683           0 :   void const * start_data = ctx->data;
    7684           0 :   int err = fd_bpf_loader_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    7685           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7686           0 :   ctx->data = start_data;
    7687           0 :   return err;
    7688           0 : }
    7689           0 : static void fd_bpf_loader_program_instruction_write_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7690           0 :   fd_bpf_loader_program_instruction_write_t * self = (fd_bpf_loader_program_instruction_write_t *)struct_mem;
    7691           0 :   fd_bincode_uint32_decode_unsafe( &self->offset, ctx );
    7692           0 :   fd_bincode_uint64_decode_unsafe( &self->bytes_len, ctx );
    7693           0 :   if( self->bytes_len ) {
    7694           0 :     self->bytes = *alloc_mem;
    7695           0 :     fd_bincode_bytes_decode_unsafe( self->bytes, self->bytes_len, ctx );
    7696           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->bytes_len;
    7697           0 :   } else
    7698           0 :     self->bytes = NULL;
    7699           0 : }
    7700           0 : void * fd_bpf_loader_program_instruction_write_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7701           0 :   fd_bpf_loader_program_instruction_write_t * self = (fd_bpf_loader_program_instruction_write_t *)mem;
    7702           0 :   fd_bpf_loader_program_instruction_write_new( self );
    7703           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_loader_program_instruction_write_t);
    7704           0 :   void * * alloc_mem = &alloc_region;
    7705           0 :   fd_bpf_loader_program_instruction_write_decode_inner( mem, alloc_mem, ctx );
    7706           0 :   return self;
    7707           0 : }
    7708           0 : void fd_bpf_loader_program_instruction_write_new(fd_bpf_loader_program_instruction_write_t * self) {
    7709           0 :   fd_memset( self, 0, sizeof(fd_bpf_loader_program_instruction_write_t) );
    7710           0 : }
    7711           0 : ulong fd_bpf_loader_program_instruction_write_size( fd_bpf_loader_program_instruction_write_t const * self ) {
    7712           0 :   ulong size = 0;
    7713           0 :   size += sizeof(uint);
    7714           0 :   do {
    7715           0 :     size += sizeof(ulong);
    7716           0 :     size += self->bytes_len;
    7717           0 :   } while(0);
    7718           0 :   return size;
    7719           0 : }
    7720             : 
    7721           0 : FD_FN_PURE uchar fd_bpf_loader_program_instruction_is_write(fd_bpf_loader_program_instruction_t const * self) {
    7722           0 :   return self->discriminant == 0;
    7723           0 : }
    7724           0 : FD_FN_PURE uchar fd_bpf_loader_program_instruction_is_finalize(fd_bpf_loader_program_instruction_t const * self) {
    7725           0 :   return self->discriminant == 1;
    7726           0 : }
    7727             : void fd_bpf_loader_program_instruction_inner_new( fd_bpf_loader_program_instruction_inner_t * self, uint discriminant );
    7728           0 : int fd_bpf_loader_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7729           0 :   int err;
    7730           0 :   switch (discriminant) {
    7731           0 :   case 0: {
    7732           0 :     err = fd_bpf_loader_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    7733           0 :     if( FD_UNLIKELY( err ) ) return err;
    7734           0 :     return FD_BINCODE_SUCCESS;
    7735           0 :   }
    7736           0 :   case 1: {
    7737           0 :     return FD_BINCODE_SUCCESS;
    7738           0 :   }
    7739           0 :   default: return FD_BINCODE_ERR_ENCODING;
    7740           0 :   }
    7741           0 : }
    7742           0 : static int fd_bpf_loader_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7743           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7744           0 :   uint discriminant = 0;
    7745           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    7746           0 :   if( FD_UNLIKELY( err ) ) return err;
    7747           0 :   return fd_bpf_loader_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    7748           0 : }
    7749           0 : int fd_bpf_loader_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7750           0 :   *total_sz += sizeof(fd_bpf_loader_program_instruction_t);
    7751           0 :   void const * start_data = ctx->data;
    7752           0 :   int err =  fd_bpf_loader_program_instruction_decode_footprint_inner( ctx, total_sz );
    7753           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7754           0 :   ctx->data = start_data;
    7755           0 :   return err;
    7756           0 : }
    7757           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 ) {
    7758           0 :   switch (discriminant) {
    7759           0 :   case 0: {
    7760           0 :     fd_bpf_loader_program_instruction_write_decode_inner( &self->write, alloc_mem, ctx );
    7761           0 :     break;
    7762           0 :   }
    7763           0 :   case 1: {
    7764           0 :     break;
    7765           0 :   }
    7766           0 :   }
    7767           0 : }
    7768           0 : static void fd_bpf_loader_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7769           0 :   fd_bpf_loader_program_instruction_t * self = (fd_bpf_loader_program_instruction_t *)struct_mem;
    7770           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    7771           0 :   fd_bpf_loader_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    7772           0 : }
    7773           0 : void * fd_bpf_loader_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7774           0 :   fd_bpf_loader_program_instruction_t * self = (fd_bpf_loader_program_instruction_t *)mem;
    7775           0 :   fd_bpf_loader_program_instruction_new( self );
    7776           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_loader_program_instruction_t);
    7777           0 :   void * * alloc_mem = &alloc_region;
    7778           0 :   fd_bpf_loader_program_instruction_decode_inner( mem, alloc_mem, ctx );
    7779           0 :   return self;
    7780           0 : }
    7781           0 : void fd_bpf_loader_program_instruction_inner_new( fd_bpf_loader_program_instruction_inner_t * self, uint discriminant ) {
    7782           0 :   switch( discriminant ) {
    7783           0 :   case 0: {
    7784           0 :     fd_bpf_loader_program_instruction_write_new( &self->write );
    7785           0 :     break;
    7786           0 :   }
    7787           0 :   case 1: {
    7788           0 :     break;
    7789           0 :   }
    7790           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    7791           0 :   }
    7792           0 : }
    7793           0 : void fd_bpf_loader_program_instruction_new_disc( fd_bpf_loader_program_instruction_t * self, uint discriminant ) {
    7794           0 :   self->discriminant = discriminant;
    7795           0 :   fd_bpf_loader_program_instruction_inner_new( &self->inner, self->discriminant );
    7796           0 : }
    7797           0 : void fd_bpf_loader_program_instruction_new( fd_bpf_loader_program_instruction_t * self ) {
    7798           0 :   fd_memset( self, 0, sizeof(fd_bpf_loader_program_instruction_t) );
    7799           0 :   fd_bpf_loader_program_instruction_new_disc( self, UINT_MAX );
    7800           0 : }
    7801             : 
    7802           0 : ulong fd_bpf_loader_program_instruction_size( fd_bpf_loader_program_instruction_t const * self ) {
    7803           0 :   ulong size = 0;
    7804           0 :   size += sizeof(uint);
    7805           0 :   switch (self->discriminant) {
    7806           0 :   case 0: {
    7807           0 :     size += fd_bpf_loader_program_instruction_write_size( &self->inner.write );
    7808           0 :     break;
    7809           0 :   }
    7810           0 :   }
    7811           0 :   return size;
    7812           0 : }
    7813             : 
    7814           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 ) {
    7815           0 :   int err;
    7816           0 :   switch (discriminant) {
    7817           0 :   case 0: {
    7818           0 :     err = fd_bpf_loader_program_instruction_write_encode( &self->write, ctx );
    7819           0 :     if( FD_UNLIKELY( err ) ) return err;
    7820           0 :     break;
    7821           0 :   }
    7822           0 :   }
    7823           0 :   return FD_BINCODE_SUCCESS;
    7824           0 : }
    7825           0 : int fd_bpf_loader_program_instruction_encode( fd_bpf_loader_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7826           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    7827           0 :   if( FD_UNLIKELY( err ) ) return err;
    7828           0 :   return fd_bpf_loader_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    7829           0 : }
    7830             : 
    7831           0 : int fd_loader_v4_program_instruction_write_encode( fd_loader_v4_program_instruction_write_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7832           0 :   int err;
    7833           0 :   err = fd_bincode_uint32_encode( self->offset, ctx );
    7834           0 :   if( FD_UNLIKELY( err ) ) return err;
    7835           0 :   err = fd_bincode_uint64_encode( self->bytes_len, ctx );
    7836           0 :   if( FD_UNLIKELY(err) ) return err;
    7837           0 :   if( self->bytes_len ) {
    7838           0 :     err = fd_bincode_bytes_encode( self->bytes, self->bytes_len, ctx );
    7839           0 :     if( FD_UNLIKELY( err ) ) return err;
    7840           0 :   }
    7841           0 :   return FD_BINCODE_SUCCESS;
    7842           0 : }
    7843           0 : static int fd_loader_v4_program_instruction_write_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7844           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7845           0 :   int err = 0;
    7846           0 :   err = fd_bincode_uint32_decode_footprint( ctx );
    7847           0 :   if( FD_UNLIKELY( err ) ) return err;
    7848           0 :   ulong bytes_len;
    7849           0 :   err = fd_bincode_uint64_decode( &bytes_len, ctx );
    7850           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7851           0 :   if( bytes_len ) {
    7852           0 :     *total_sz += 8UL + bytes_len;
    7853           0 :     err = fd_bincode_bytes_decode_footprint( bytes_len, ctx );
    7854           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    7855           0 :   }
    7856           0 :   return 0;
    7857           0 : }
    7858           0 : int fd_loader_v4_program_instruction_write_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7859           0 :   *total_sz += sizeof(fd_loader_v4_program_instruction_write_t);
    7860           0 :   void const * start_data = ctx->data;
    7861           0 :   int err = fd_loader_v4_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    7862           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7863           0 :   ctx->data = start_data;
    7864           0 :   return err;
    7865           0 : }
    7866           0 : static void fd_loader_v4_program_instruction_write_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7867           0 :   fd_loader_v4_program_instruction_write_t * self = (fd_loader_v4_program_instruction_write_t *)struct_mem;
    7868           0 :   fd_bincode_uint32_decode_unsafe( &self->offset, ctx );
    7869           0 :   fd_bincode_uint64_decode_unsafe( &self->bytes_len, ctx );
    7870           0 :   if( self->bytes_len ) {
    7871           0 :     self->bytes = *alloc_mem;
    7872           0 :     fd_bincode_bytes_decode_unsafe( self->bytes, self->bytes_len, ctx );
    7873           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->bytes_len;
    7874           0 :   } else
    7875           0 :     self->bytes = NULL;
    7876           0 : }
    7877           0 : void * fd_loader_v4_program_instruction_write_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7878           0 :   fd_loader_v4_program_instruction_write_t * self = (fd_loader_v4_program_instruction_write_t *)mem;
    7879           0 :   fd_loader_v4_program_instruction_write_new( self );
    7880           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_program_instruction_write_t);
    7881           0 :   void * * alloc_mem = &alloc_region;
    7882           0 :   fd_loader_v4_program_instruction_write_decode_inner( mem, alloc_mem, ctx );
    7883           0 :   return self;
    7884           0 : }
    7885           0 : void fd_loader_v4_program_instruction_write_new(fd_loader_v4_program_instruction_write_t * self) {
    7886           0 :   fd_memset( self, 0, sizeof(fd_loader_v4_program_instruction_write_t) );
    7887           0 : }
    7888           0 : ulong fd_loader_v4_program_instruction_write_size( fd_loader_v4_program_instruction_write_t const * self ) {
    7889           0 :   ulong size = 0;
    7890           0 :   size += sizeof(uint);
    7891           0 :   do {
    7892           0 :     size += sizeof(ulong);
    7893           0 :     size += self->bytes_len;
    7894           0 :   } while(0);
    7895           0 :   return size;
    7896           0 : }
    7897             : 
    7898           0 : int fd_loader_v4_program_instruction_copy_encode( fd_loader_v4_program_instruction_copy_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    7899           0 :   int err;
    7900           0 :   err = fd_bincode_uint32_encode( self->destination_offset, ctx );
    7901           0 :   if( FD_UNLIKELY( err ) ) return err;
    7902           0 :   err = fd_bincode_uint32_encode( self->source_offset, ctx );
    7903           0 :   if( FD_UNLIKELY( err ) ) return err;
    7904           0 :   err = fd_bincode_uint32_encode( self->length, ctx );
    7905           0 :   if( FD_UNLIKELY( err ) ) return err;
    7906           0 :   return FD_BINCODE_SUCCESS;
    7907           0 : }
    7908           0 : static inline int fd_loader_v4_program_instruction_copy_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7909           0 :   if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7910           0 :   ctx->data = (void *)( (ulong)ctx->data + 12UL );
    7911           0 :   return 0;
    7912           0 : }
    7913           0 : static void fd_loader_v4_program_instruction_copy_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7914           0 :   fd_loader_v4_program_instruction_copy_t * self = (fd_loader_v4_program_instruction_copy_t *)struct_mem;
    7915           0 :   fd_bincode_uint32_decode_unsafe( &self->destination_offset, ctx );
    7916           0 :   fd_bincode_uint32_decode_unsafe( &self->source_offset, ctx );
    7917           0 :   fd_bincode_uint32_decode_unsafe( &self->length, ctx );
    7918           0 : }
    7919           0 : void * fd_loader_v4_program_instruction_copy_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7920           0 :   fd_loader_v4_program_instruction_copy_t * self = (fd_loader_v4_program_instruction_copy_t *)mem;
    7921           0 :   fd_loader_v4_program_instruction_copy_new( self );
    7922           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_program_instruction_copy_t);
    7923           0 :   void * * alloc_mem = &alloc_region;
    7924           0 :   fd_loader_v4_program_instruction_copy_decode_inner( mem, alloc_mem, ctx );
    7925           0 :   return self;
    7926           0 : }
    7927           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 ) {
    7928           0 :   int err;
    7929           0 :   err = fd_bincode_uint32_encode( self->new_size, ctx );
    7930           0 :   if( FD_UNLIKELY( err ) ) return err;
    7931           0 :   return FD_BINCODE_SUCCESS;
    7932           0 : }
    7933           0 : static inline int fd_loader_v4_program_instruction_set_program_length_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7934           0 :   if( (ulong)ctx->data + 4UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    7935           0 :   ctx->data = (void *)( (ulong)ctx->data + 4UL );
    7936           0 :   return 0;
    7937           0 : }
    7938           0 : static void fd_loader_v4_program_instruction_set_program_length_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    7939           0 :   fd_loader_v4_program_instruction_set_program_length_t * self = (fd_loader_v4_program_instruction_set_program_length_t *)struct_mem;
    7940           0 :   fd_bincode_uint32_decode_unsafe( &self->new_size, ctx );
    7941           0 : }
    7942           0 : void * fd_loader_v4_program_instruction_set_program_length_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    7943           0 :   fd_loader_v4_program_instruction_set_program_length_t * self = (fd_loader_v4_program_instruction_set_program_length_t *)mem;
    7944           0 :   fd_loader_v4_program_instruction_set_program_length_new( self );
    7945           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_program_instruction_set_program_length_t);
    7946           0 :   void * * alloc_mem = &alloc_region;
    7947           0 :   fd_loader_v4_program_instruction_set_program_length_decode_inner( mem, alloc_mem, ctx );
    7948           0 :   return self;
    7949           0 : }
    7950           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_write(fd_loader_v4_program_instruction_t const * self) {
    7951           0 :   return self->discriminant == 0;
    7952           0 : }
    7953           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_copy(fd_loader_v4_program_instruction_t const * self) {
    7954           0 :   return self->discriminant == 1;
    7955           0 : }
    7956           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_set_program_length(fd_loader_v4_program_instruction_t const * self) {
    7957           0 :   return self->discriminant == 2;
    7958           0 : }
    7959           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_deploy(fd_loader_v4_program_instruction_t const * self) {
    7960           0 :   return self->discriminant == 3;
    7961           0 : }
    7962           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_retract(fd_loader_v4_program_instruction_t const * self) {
    7963           0 :   return self->discriminant == 4;
    7964           0 : }
    7965           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_transfer_authority(fd_loader_v4_program_instruction_t const * self) {
    7966           0 :   return self->discriminant == 5;
    7967           0 : }
    7968           0 : FD_FN_PURE uchar fd_loader_v4_program_instruction_is_finalize(fd_loader_v4_program_instruction_t const * self) {
    7969           0 :   return self->discriminant == 6;
    7970           0 : }
    7971             : void fd_loader_v4_program_instruction_inner_new( fd_loader_v4_program_instruction_inner_t * self, uint discriminant );
    7972           0 : int fd_loader_v4_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    7973           0 :   int err;
    7974           0 :   switch (discriminant) {
    7975           0 :   case 0: {
    7976           0 :     err = fd_loader_v4_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    7977           0 :     if( FD_UNLIKELY( err ) ) return err;
    7978           0 :     return FD_BINCODE_SUCCESS;
    7979           0 :   }
    7980           0 :   case 1: {
    7981           0 :     err = fd_loader_v4_program_instruction_copy_decode_footprint_inner( ctx, total_sz );
    7982           0 :     if( FD_UNLIKELY( err ) ) return err;
    7983           0 :     return FD_BINCODE_SUCCESS;
    7984           0 :   }
    7985           0 :   case 2: {
    7986           0 :     err = fd_loader_v4_program_instruction_set_program_length_decode_footprint_inner( ctx, total_sz );
    7987           0 :     if( FD_UNLIKELY( err ) ) return err;
    7988           0 :     return FD_BINCODE_SUCCESS;
    7989           0 :   }
    7990           0 :   case 3: {
    7991           0 :     return FD_BINCODE_SUCCESS;
    7992           0 :   }
    7993           0 :   case 4: {
    7994           0 :     return FD_BINCODE_SUCCESS;
    7995           0 :   }
    7996           0 :   case 5: {
    7997           0 :     return FD_BINCODE_SUCCESS;
    7998           0 :   }
    7999           0 :   case 6: {
    8000           0 :     return FD_BINCODE_SUCCESS;
    8001           0 :   }
    8002           0 :   default: return FD_BINCODE_ERR_ENCODING;
    8003           0 :   }
    8004           0 : }
    8005           0 : static int fd_loader_v4_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8006           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8007           0 :   uint discriminant = 0;
    8008           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    8009           0 :   if( FD_UNLIKELY( err ) ) return err;
    8010           0 :   return fd_loader_v4_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    8011           0 : }
    8012           0 : int fd_loader_v4_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8013           0 :   *total_sz += sizeof(fd_loader_v4_program_instruction_t);
    8014           0 :   void const * start_data = ctx->data;
    8015           0 :   int err =  fd_loader_v4_program_instruction_decode_footprint_inner( ctx, total_sz );
    8016           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8017           0 :   ctx->data = start_data;
    8018           0 :   return err;
    8019           0 : }
    8020           0 : 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 ) {
    8021           0 :   switch (discriminant) {
    8022           0 :   case 0: {
    8023           0 :     fd_loader_v4_program_instruction_write_decode_inner( &self->write, alloc_mem, ctx );
    8024           0 :     break;
    8025           0 :   }
    8026           0 :   case 1: {
    8027           0 :     fd_loader_v4_program_instruction_copy_decode_inner( &self->copy, alloc_mem, ctx );
    8028           0 :     break;
    8029           0 :   }
    8030           0 :   case 2: {
    8031           0 :     fd_loader_v4_program_instruction_set_program_length_decode_inner( &self->set_program_length, alloc_mem, ctx );
    8032           0 :     break;
    8033           0 :   }
    8034           0 :   case 3: {
    8035           0 :     break;
    8036           0 :   }
    8037           0 :   case 4: {
    8038           0 :     break;
    8039           0 :   }
    8040           0 :   case 5: {
    8041           0 :     break;
    8042           0 :   }
    8043           0 :   case 6: {
    8044           0 :     break;
    8045           0 :   }
    8046           0 :   }
    8047           0 : }
    8048           0 : static void fd_loader_v4_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8049           0 :   fd_loader_v4_program_instruction_t * self = (fd_loader_v4_program_instruction_t *)struct_mem;
    8050           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    8051           0 :   fd_loader_v4_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    8052           0 : }
    8053           0 : void * fd_loader_v4_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8054           0 :   fd_loader_v4_program_instruction_t * self = (fd_loader_v4_program_instruction_t *)mem;
    8055           0 :   fd_loader_v4_program_instruction_new( self );
    8056           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_program_instruction_t);
    8057           0 :   void * * alloc_mem = &alloc_region;
    8058           0 :   fd_loader_v4_program_instruction_decode_inner( mem, alloc_mem, ctx );
    8059           0 :   return self;
    8060           0 : }
    8061           0 : void fd_loader_v4_program_instruction_inner_new( fd_loader_v4_program_instruction_inner_t * self, uint discriminant ) {
    8062           0 :   switch( discriminant ) {
    8063           0 :   case 0: {
    8064           0 :     fd_loader_v4_program_instruction_write_new( &self->write );
    8065           0 :     break;
    8066           0 :   }
    8067           0 :   case 1: {
    8068           0 :     fd_loader_v4_program_instruction_copy_new( &self->copy );
    8069           0 :     break;
    8070           0 :   }
    8071           0 :   case 2: {
    8072           0 :     fd_loader_v4_program_instruction_set_program_length_new( &self->set_program_length );
    8073           0 :     break;
    8074           0 :   }
    8075           0 :   case 3: {
    8076           0 :     break;
    8077           0 :   }
    8078           0 :   case 4: {
    8079           0 :     break;
    8080           0 :   }
    8081           0 :   case 5: {
    8082           0 :     break;
    8083           0 :   }
    8084           0 :   case 6: {
    8085           0 :     break;
    8086           0 :   }
    8087           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    8088           0 :   }
    8089           0 : }
    8090           0 : void fd_loader_v4_program_instruction_new_disc( fd_loader_v4_program_instruction_t * self, uint discriminant ) {
    8091           0 :   self->discriminant = discriminant;
    8092           0 :   fd_loader_v4_program_instruction_inner_new( &self->inner, self->discriminant );
    8093           0 : }
    8094           0 : void fd_loader_v4_program_instruction_new( fd_loader_v4_program_instruction_t * self ) {
    8095           0 :   fd_memset( self, 0, sizeof(fd_loader_v4_program_instruction_t) );
    8096           0 :   fd_loader_v4_program_instruction_new_disc( self, UINT_MAX );
    8097           0 : }
    8098             : 
    8099           0 : ulong fd_loader_v4_program_instruction_size( fd_loader_v4_program_instruction_t const * self ) {
    8100           0 :   ulong size = 0;
    8101           0 :   size += sizeof(uint);
    8102           0 :   switch (self->discriminant) {
    8103           0 :   case 0: {
    8104           0 :     size += fd_loader_v4_program_instruction_write_size( &self->inner.write );
    8105           0 :     break;
    8106           0 :   }
    8107           0 :   case 1: {
    8108           0 :     size += fd_loader_v4_program_instruction_copy_size( &self->inner.copy );
    8109           0 :     break;
    8110           0 :   }
    8111           0 :   case 2: {
    8112           0 :     size += fd_loader_v4_program_instruction_set_program_length_size( &self->inner.set_program_length );
    8113           0 :     break;
    8114           0 :   }
    8115           0 :   }
    8116           0 :   return size;
    8117           0 : }
    8118             : 
    8119           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 ) {
    8120           0 :   int err;
    8121           0 :   switch (discriminant) {
    8122           0 :   case 0: {
    8123           0 :     err = fd_loader_v4_program_instruction_write_encode( &self->write, ctx );
    8124           0 :     if( FD_UNLIKELY( err ) ) return err;
    8125           0 :     break;
    8126           0 :   }
    8127           0 :   case 1: {
    8128           0 :     err = fd_loader_v4_program_instruction_copy_encode( &self->copy, ctx );
    8129           0 :     if( FD_UNLIKELY( err ) ) return err;
    8130           0 :     break;
    8131           0 :   }
    8132           0 :   case 2: {
    8133           0 :     err = fd_loader_v4_program_instruction_set_program_length_encode( &self->set_program_length, ctx );
    8134           0 :     if( FD_UNLIKELY( err ) ) return err;
    8135           0 :     break;
    8136           0 :   }
    8137           0 :   }
    8138           0 :   return FD_BINCODE_SUCCESS;
    8139           0 : }
    8140           0 : int fd_loader_v4_program_instruction_encode( fd_loader_v4_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    8141           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    8142           0 :   if( FD_UNLIKELY( err ) ) return err;
    8143           0 :   return fd_loader_v4_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    8144           0 : }
    8145             : 
    8146           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 ) {
    8147           0 :   int err;
    8148           0 :   err = fd_bincode_uint32_encode( self->offset, ctx );
    8149           0 :   if( FD_UNLIKELY( err ) ) return err;
    8150           0 :   err = fd_bincode_uint64_encode( self->bytes_len, ctx );
    8151           0 :   if( FD_UNLIKELY(err) ) return err;
    8152           0 :   if( self->bytes_len ) {
    8153           0 :     err = fd_bincode_bytes_encode( self->bytes, self->bytes_len, ctx );
    8154           0 :     if( FD_UNLIKELY( err ) ) return err;
    8155           0 :   }
    8156           0 :   return FD_BINCODE_SUCCESS;
    8157           0 : }
    8158           0 : static int fd_bpf_upgradeable_loader_program_instruction_write_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8159           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8160           0 :   int err = 0;
    8161           0 :   err = fd_bincode_uint32_decode_footprint( ctx );
    8162           0 :   if( FD_UNLIKELY( err ) ) return err;
    8163           0 :   ulong bytes_len;
    8164           0 :   err = fd_bincode_uint64_decode( &bytes_len, ctx );
    8165           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    8166           0 :   if( bytes_len ) {
    8167           0 :     *total_sz += 8UL + bytes_len;
    8168           0 :     err = fd_bincode_bytes_decode_footprint( bytes_len, ctx );
    8169           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    8170           0 :   }
    8171           0 :   return 0;
    8172           0 : }
    8173           0 : int fd_bpf_upgradeable_loader_program_instruction_write_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8174           0 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_program_instruction_write_t);
    8175           0 :   void const * start_data = ctx->data;
    8176           0 :   int err = fd_bpf_upgradeable_loader_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    8177           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8178           0 :   ctx->data = start_data;
    8179           0 :   return err;
    8180           0 : }
    8181           0 : static void fd_bpf_upgradeable_loader_program_instruction_write_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8182           0 :   fd_bpf_upgradeable_loader_program_instruction_write_t * self = (fd_bpf_upgradeable_loader_program_instruction_write_t *)struct_mem;
    8183           0 :   fd_bincode_uint32_decode_unsafe( &self->offset, ctx );
    8184           0 :   fd_bincode_uint64_decode_unsafe( &self->bytes_len, ctx );
    8185           0 :   if( self->bytes_len ) {
    8186           0 :     self->bytes = *alloc_mem;
    8187           0 :     fd_bincode_bytes_decode_unsafe( self->bytes, self->bytes_len, ctx );
    8188           0 :     *alloc_mem = (uchar *)(*alloc_mem) + self->bytes_len;
    8189           0 :   } else
    8190           0 :     self->bytes = NULL;
    8191           0 : }
    8192           0 : void * fd_bpf_upgradeable_loader_program_instruction_write_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8193           0 :   fd_bpf_upgradeable_loader_program_instruction_write_t * self = (fd_bpf_upgradeable_loader_program_instruction_write_t *)mem;
    8194           0 :   fd_bpf_upgradeable_loader_program_instruction_write_new( self );
    8195           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_write_t);
    8196           0 :   void * * alloc_mem = &alloc_region;
    8197           0 :   fd_bpf_upgradeable_loader_program_instruction_write_decode_inner( mem, alloc_mem, ctx );
    8198           0 :   return self;
    8199           0 : }
    8200           0 : void fd_bpf_upgradeable_loader_program_instruction_write_new(fd_bpf_upgradeable_loader_program_instruction_write_t * self) {
    8201           0 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_program_instruction_write_t) );
    8202           0 : }
    8203           0 : ulong fd_bpf_upgradeable_loader_program_instruction_write_size( fd_bpf_upgradeable_loader_program_instruction_write_t const * self ) {
    8204           0 :   ulong size = 0;
    8205           0 :   size += sizeof(uint);
    8206           0 :   do {
    8207           0 :     size += sizeof(ulong);
    8208           0 :     size += self->bytes_len;
    8209           0 :   } while(0);
    8210           0 :   return size;
    8211           0 : }
    8212             : 
    8213           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 ) {
    8214           0 :   int err;
    8215           0 :   err = fd_bincode_uint64_encode( self->max_data_len, ctx );
    8216           0 :   if( FD_UNLIKELY( err ) ) return err;
    8217           0 :   return FD_BINCODE_SUCCESS;
    8218           0 : }
    8219           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 ) {
    8220           0 :   if( (ulong)ctx->data + 8UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8221           0 :   ctx->data = (void *)( (ulong)ctx->data + 8UL );
    8222           0 :   return 0;
    8223           0 : }
    8224           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 ) {
    8225           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;
    8226           0 :   fd_bincode_uint64_decode_unsafe( &self->max_data_len, ctx );
    8227           0 : }
    8228           0 : void * fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8229           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;
    8230           0 :   fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_new( self );
    8231           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_t);
    8232           0 :   void * * alloc_mem = &alloc_region;
    8233           0 :   fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode_inner( mem, alloc_mem, ctx );
    8234           0 :   return self;
    8235           0 : }
    8236           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 ) {
    8237           0 :   int err;
    8238           0 :   err = fd_bincode_uint32_encode( self->additional_bytes, ctx );
    8239           0 :   if( FD_UNLIKELY( err ) ) return err;
    8240           0 :   return FD_BINCODE_SUCCESS;
    8241           0 : }
    8242           0 : static inline int fd_bpf_upgradeable_loader_program_instruction_extend_program_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8243           0 :   if( (ulong)ctx->data + 4UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8244           0 :   ctx->data = (void *)( (ulong)ctx->data + 4UL );
    8245           0 :   return 0;
    8246           0 : }
    8247           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 ) {
    8248           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_t * self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_t *)struct_mem;
    8249           0 :   fd_bincode_uint32_decode_unsafe( &self->additional_bytes, ctx );
    8250           0 : }
    8251           0 : void * fd_bpf_upgradeable_loader_program_instruction_extend_program_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8252           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_t * self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_t *)mem;
    8253           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_new( self );
    8254           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_extend_program_t);
    8255           0 :   void * * alloc_mem = &alloc_region;
    8256           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_decode_inner( mem, alloc_mem, ctx );
    8257           0 :   return self;
    8258           0 : }
    8259           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 ) {
    8260           0 :   int err;
    8261           0 :   err = fd_bincode_uint32_encode( self->additional_bytes, ctx );
    8262           0 :   if( FD_UNLIKELY( err ) ) return err;
    8263           0 :   return FD_BINCODE_SUCCESS;
    8264           0 : }
    8265           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 ) {
    8266           0 :   if( (ulong)ctx->data + 4UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8267           0 :   ctx->data = (void *)( (ulong)ctx->data + 4UL );
    8268           0 :   return 0;
    8269           0 : }
    8270           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 ) {
    8271           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t * self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t *)struct_mem;
    8272           0 :   fd_bincode_uint32_decode_unsafe( &self->additional_bytes, ctx );
    8273           0 : }
    8274           0 : void * fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8275           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t * self = (fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t *)mem;
    8276           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_new( self );
    8277           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_t);
    8278           0 :   void * * alloc_mem = &alloc_region;
    8279           0 :   fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode_inner( mem, alloc_mem, ctx );
    8280           0 :   return self;
    8281           0 : }
    8282           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_initialize_buffer(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    8283           0 :   return self->discriminant == 0;
    8284           0 : }
    8285           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_write(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    8286           0 :   return self->discriminant == 1;
    8287           0 : }
    8288           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) {
    8289           0 :   return self->discriminant == 2;
    8290           0 : }
    8291           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_upgrade(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    8292           0 :   return self->discriminant == 3;
    8293           0 : }
    8294           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_set_authority(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    8295           0 :   return self->discriminant == 4;
    8296           0 : }
    8297           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_close(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    8298           0 :   return self->discriminant == 5;
    8299           0 : }
    8300           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_extend_program(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    8301           0 :   return self->discriminant == 6;
    8302           0 : }
    8303           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_set_authority_checked(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    8304           0 :   return self->discriminant == 7;
    8305           0 : }
    8306           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_migrate(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    8307           0 :   return self->discriminant == 8;
    8308           0 : }
    8309           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_program_instruction_is_extend_program_checked(fd_bpf_upgradeable_loader_program_instruction_t const * self) {
    8310           0 :   return self->discriminant == 9;
    8311           0 : }
    8312             : void fd_bpf_upgradeable_loader_program_instruction_inner_new( fd_bpf_upgradeable_loader_program_instruction_inner_t * self, uint discriminant );
    8313           0 : int fd_bpf_upgradeable_loader_program_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8314           0 :   int err;
    8315           0 :   switch (discriminant) {
    8316           0 :   case 0: {
    8317           0 :     return FD_BINCODE_SUCCESS;
    8318           0 :   }
    8319           0 :   case 1: {
    8320           0 :     err = fd_bpf_upgradeable_loader_program_instruction_write_decode_footprint_inner( ctx, total_sz );
    8321           0 :     if( FD_UNLIKELY( err ) ) return err;
    8322           0 :     return FD_BINCODE_SUCCESS;
    8323           0 :   }
    8324           0 :   case 2: {
    8325           0 :     err = fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode_footprint_inner( ctx, total_sz );
    8326           0 :     if( FD_UNLIKELY( err ) ) return err;
    8327           0 :     return FD_BINCODE_SUCCESS;
    8328           0 :   }
    8329           0 :   case 3: {
    8330           0 :     return FD_BINCODE_SUCCESS;
    8331           0 :   }
    8332           0 :   case 4: {
    8333           0 :     return FD_BINCODE_SUCCESS;
    8334           0 :   }
    8335           0 :   case 5: {
    8336           0 :     return FD_BINCODE_SUCCESS;
    8337           0 :   }
    8338           0 :   case 6: {
    8339           0 :     err = fd_bpf_upgradeable_loader_program_instruction_extend_program_decode_footprint_inner( ctx, total_sz );
    8340           0 :     if( FD_UNLIKELY( err ) ) return err;
    8341           0 :     return FD_BINCODE_SUCCESS;
    8342           0 :   }
    8343           0 :   case 7: {
    8344           0 :     return FD_BINCODE_SUCCESS;
    8345           0 :   }
    8346           0 :   case 8: {
    8347           0 :     return FD_BINCODE_SUCCESS;
    8348           0 :   }
    8349           0 :   case 9: {
    8350           0 :     err = fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode_footprint_inner( ctx, total_sz );
    8351           0 :     if( FD_UNLIKELY( err ) ) return err;
    8352           0 :     return FD_BINCODE_SUCCESS;
    8353           0 :   }
    8354           0 :   default: return FD_BINCODE_ERR_ENCODING;
    8355           0 :   }
    8356           0 : }
    8357           0 : static int fd_bpf_upgradeable_loader_program_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8358           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8359           0 :   uint discriminant = 0;
    8360           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    8361           0 :   if( FD_UNLIKELY( err ) ) return err;
    8362           0 :   return fd_bpf_upgradeable_loader_program_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    8363           0 : }
    8364           0 : int fd_bpf_upgradeable_loader_program_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8365           0 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_program_instruction_t);
    8366           0 :   void const * start_data = ctx->data;
    8367           0 :   int err =  fd_bpf_upgradeable_loader_program_instruction_decode_footprint_inner( ctx, total_sz );
    8368           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8369           0 :   ctx->data = start_data;
    8370           0 :   return err;
    8371           0 : }
    8372           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 ) {
    8373           0 :   switch (discriminant) {
    8374           0 :   case 0: {
    8375           0 :     break;
    8376           0 :   }
    8377           0 :   case 1: {
    8378           0 :     fd_bpf_upgradeable_loader_program_instruction_write_decode_inner( &self->write, alloc_mem, ctx );
    8379           0 :     break;
    8380           0 :   }
    8381           0 :   case 2: {
    8382           0 :     fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_decode_inner( &self->deploy_with_max_data_len, alloc_mem, ctx );
    8383           0 :     break;
    8384           0 :   }
    8385           0 :   case 3: {
    8386           0 :     break;
    8387           0 :   }
    8388           0 :   case 4: {
    8389           0 :     break;
    8390           0 :   }
    8391           0 :   case 5: {
    8392           0 :     break;
    8393           0 :   }
    8394           0 :   case 6: {
    8395           0 :     fd_bpf_upgradeable_loader_program_instruction_extend_program_decode_inner( &self->extend_program, alloc_mem, ctx );
    8396           0 :     break;
    8397           0 :   }
    8398           0 :   case 7: {
    8399           0 :     break;
    8400           0 :   }
    8401           0 :   case 8: {
    8402           0 :     break;
    8403           0 :   }
    8404           0 :   case 9: {
    8405           0 :     fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_decode_inner( &self->extend_program_checked, alloc_mem, ctx );
    8406           0 :     break;
    8407           0 :   }
    8408           0 :   }
    8409           0 : }
    8410           0 : static void fd_bpf_upgradeable_loader_program_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8411           0 :   fd_bpf_upgradeable_loader_program_instruction_t * self = (fd_bpf_upgradeable_loader_program_instruction_t *)struct_mem;
    8412           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    8413           0 :   fd_bpf_upgradeable_loader_program_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    8414           0 : }
    8415           0 : void * fd_bpf_upgradeable_loader_program_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8416           0 :   fd_bpf_upgradeable_loader_program_instruction_t * self = (fd_bpf_upgradeable_loader_program_instruction_t *)mem;
    8417           0 :   fd_bpf_upgradeable_loader_program_instruction_new( self );
    8418           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_program_instruction_t);
    8419           0 :   void * * alloc_mem = &alloc_region;
    8420           0 :   fd_bpf_upgradeable_loader_program_instruction_decode_inner( mem, alloc_mem, ctx );
    8421           0 :   return self;
    8422           0 : }
    8423           0 : void fd_bpf_upgradeable_loader_program_instruction_inner_new( fd_bpf_upgradeable_loader_program_instruction_inner_t * self, uint discriminant ) {
    8424           0 :   switch( discriminant ) {
    8425           0 :   case 0: {
    8426           0 :     break;
    8427           0 :   }
    8428           0 :   case 1: {
    8429           0 :     fd_bpf_upgradeable_loader_program_instruction_write_new( &self->write );
    8430           0 :     break;
    8431           0 :   }
    8432           0 :   case 2: {
    8433           0 :     fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_new( &self->deploy_with_max_data_len );
    8434           0 :     break;
    8435           0 :   }
    8436           0 :   case 3: {
    8437           0 :     break;
    8438           0 :   }
    8439           0 :   case 4: {
    8440           0 :     break;
    8441           0 :   }
    8442           0 :   case 5: {
    8443           0 :     break;
    8444           0 :   }
    8445           0 :   case 6: {
    8446           0 :     fd_bpf_upgradeable_loader_program_instruction_extend_program_new( &self->extend_program );
    8447           0 :     break;
    8448           0 :   }
    8449           0 :   case 7: {
    8450           0 :     break;
    8451           0 :   }
    8452           0 :   case 8: {
    8453           0 :     break;
    8454           0 :   }
    8455           0 :   case 9: {
    8456           0 :     fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_new( &self->extend_program_checked );
    8457           0 :     break;
    8458           0 :   }
    8459           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    8460           0 :   }
    8461           0 : }
    8462           0 : void fd_bpf_upgradeable_loader_program_instruction_new_disc( fd_bpf_upgradeable_loader_program_instruction_t * self, uint discriminant ) {
    8463           0 :   self->discriminant = discriminant;
    8464           0 :   fd_bpf_upgradeable_loader_program_instruction_inner_new( &self->inner, self->discriminant );
    8465           0 : }
    8466           0 : void fd_bpf_upgradeable_loader_program_instruction_new( fd_bpf_upgradeable_loader_program_instruction_t * self ) {
    8467           0 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_program_instruction_t) );
    8468           0 :   fd_bpf_upgradeable_loader_program_instruction_new_disc( self, UINT_MAX );
    8469           0 : }
    8470             : 
    8471           0 : ulong fd_bpf_upgradeable_loader_program_instruction_size( fd_bpf_upgradeable_loader_program_instruction_t const * self ) {
    8472           0 :   ulong size = 0;
    8473           0 :   size += sizeof(uint);
    8474           0 :   switch (self->discriminant) {
    8475           0 :   case 1: {
    8476           0 :     size += fd_bpf_upgradeable_loader_program_instruction_write_size( &self->inner.write );
    8477           0 :     break;
    8478           0 :   }
    8479           0 :   case 2: {
    8480           0 :     size += fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_size( &self->inner.deploy_with_max_data_len );
    8481           0 :     break;
    8482           0 :   }
    8483           0 :   case 6: {
    8484           0 :     size += fd_bpf_upgradeable_loader_program_instruction_extend_program_size( &self->inner.extend_program );
    8485           0 :     break;
    8486           0 :   }
    8487           0 :   case 9: {
    8488           0 :     size += fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_size( &self->inner.extend_program_checked );
    8489           0 :     break;
    8490           0 :   }
    8491           0 :   }
    8492           0 :   return size;
    8493           0 : }
    8494             : 
    8495           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 ) {
    8496           0 :   int err;
    8497           0 :   switch (discriminant) {
    8498           0 :   case 1: {
    8499           0 :     err = fd_bpf_upgradeable_loader_program_instruction_write_encode( &self->write, ctx );
    8500           0 :     if( FD_UNLIKELY( err ) ) return err;
    8501           0 :     break;
    8502           0 :   }
    8503           0 :   case 2: {
    8504           0 :     err = fd_bpf_upgradeable_loader_program_instruction_deploy_with_max_data_len_encode( &self->deploy_with_max_data_len, ctx );
    8505           0 :     if( FD_UNLIKELY( err ) ) return err;
    8506           0 :     break;
    8507           0 :   }
    8508           0 :   case 6: {
    8509           0 :     err = fd_bpf_upgradeable_loader_program_instruction_extend_program_encode( &self->extend_program, ctx );
    8510           0 :     if( FD_UNLIKELY( err ) ) return err;
    8511           0 :     break;
    8512           0 :   }
    8513           0 :   case 9: {
    8514           0 :     err = fd_bpf_upgradeable_loader_program_instruction_extend_program_checked_encode( &self->extend_program_checked, ctx );
    8515           0 :     if( FD_UNLIKELY( err ) ) return err;
    8516           0 :     break;
    8517           0 :   }
    8518           0 :   }
    8519           0 :   return FD_BINCODE_SUCCESS;
    8520           0 : }
    8521           0 : int fd_bpf_upgradeable_loader_program_instruction_encode( fd_bpf_upgradeable_loader_program_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    8522           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    8523           0 :   if( FD_UNLIKELY( err ) ) return err;
    8524           0 :   return fd_bpf_upgradeable_loader_program_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    8525           0 : }
    8526             : 
    8527           0 : int fd_bpf_upgradeable_loader_state_buffer_encode( fd_bpf_upgradeable_loader_state_buffer_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    8528           0 :   int err;
    8529           0 :   err = fd_bincode_bool_encode( self->has_authority_address, ctx );
    8530           0 :   if( FD_UNLIKELY( err ) ) return err;
    8531           0 :   if( self->has_authority_address ) {
    8532           0 :     err = fd_pubkey_encode( &self->authority_address, ctx );
    8533           0 :     if( FD_UNLIKELY( err ) ) return err;
    8534           0 :   }
    8535           0 :   return FD_BINCODE_SUCCESS;
    8536           0 : }
    8537           0 : static int fd_bpf_upgradeable_loader_state_buffer_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8538           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8539           0 :   int err = 0;
    8540           0 :   {
    8541           0 :     uchar o;
    8542           0 :     err = fd_bincode_bool_decode( &o, ctx );
    8543           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    8544           0 :     if( o ) {
    8545           0 :       err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    8546           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    8547           0 :     }
    8548           0 :   }
    8549           0 :   return 0;
    8550           0 : }
    8551           0 : int fd_bpf_upgradeable_loader_state_buffer_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8552           0 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_state_buffer_t);
    8553           0 :   void const * start_data = ctx->data;
    8554           0 :   int err = fd_bpf_upgradeable_loader_state_buffer_decode_footprint_inner( ctx, total_sz );
    8555           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8556           0 :   ctx->data = start_data;
    8557           0 :   return err;
    8558           0 : }
    8559           0 : static void fd_bpf_upgradeable_loader_state_buffer_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8560           0 :   fd_bpf_upgradeable_loader_state_buffer_t * self = (fd_bpf_upgradeable_loader_state_buffer_t *)struct_mem;
    8561           0 :   {
    8562           0 :     uchar o;
    8563           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    8564           0 :     self->has_authority_address = !!o;
    8565           0 :     if( o ) {
    8566           0 :       fd_pubkey_new( &self->authority_address );
    8567           0 :       fd_pubkey_decode_inner( &self->authority_address, alloc_mem, ctx );
    8568           0 :     }
    8569           0 :   }
    8570           0 : }
    8571           0 : void * fd_bpf_upgradeable_loader_state_buffer_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8572           0 :   fd_bpf_upgradeable_loader_state_buffer_t * self = (fd_bpf_upgradeable_loader_state_buffer_t *)mem;
    8573           0 :   fd_bpf_upgradeable_loader_state_buffer_new( self );
    8574           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_state_buffer_t);
    8575           0 :   void * * alloc_mem = &alloc_region;
    8576           0 :   fd_bpf_upgradeable_loader_state_buffer_decode_inner( mem, alloc_mem, ctx );
    8577           0 :   return self;
    8578           0 : }
    8579           0 : void fd_bpf_upgradeable_loader_state_buffer_new(fd_bpf_upgradeable_loader_state_buffer_t * self) {
    8580           0 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_state_buffer_t) );
    8581           0 : }
    8582           0 : ulong fd_bpf_upgradeable_loader_state_buffer_size( fd_bpf_upgradeable_loader_state_buffer_t const * self ) {
    8583           0 :   ulong size = 0;
    8584           0 :   size += sizeof(char);
    8585           0 :   if( self->has_authority_address ) {
    8586           0 :     size += fd_pubkey_size( &self->authority_address );
    8587           0 :   }
    8588           0 :   return size;
    8589           0 : }
    8590             : 
    8591           0 : int fd_bpf_upgradeable_loader_state_program_encode( fd_bpf_upgradeable_loader_state_program_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    8592           0 :   int err;
    8593           0 :   err = fd_pubkey_encode( &self->programdata_address, ctx );
    8594           0 :   if( FD_UNLIKELY( err ) ) return err;
    8595           0 :   return FD_BINCODE_SUCCESS;
    8596           0 : }
    8597           0 : static inline int fd_bpf_upgradeable_loader_state_program_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8598           0 :   if( (ulong)ctx->data + 32UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8599           0 :   ctx->data = (void *)( (ulong)ctx->data + 32UL );
    8600           0 :   return 0;
    8601           0 : }
    8602           0 : static void fd_bpf_upgradeable_loader_state_program_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8603           0 :   fd_bpf_upgradeable_loader_state_program_t * self = (fd_bpf_upgradeable_loader_state_program_t *)struct_mem;
    8604           0 :   fd_pubkey_decode_inner( &self->programdata_address, alloc_mem, ctx );
    8605           0 : }
    8606           0 : void * fd_bpf_upgradeable_loader_state_program_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8607           0 :   fd_bpf_upgradeable_loader_state_program_t * self = (fd_bpf_upgradeable_loader_state_program_t *)mem;
    8608           0 :   fd_bpf_upgradeable_loader_state_program_new( self );
    8609           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_state_program_t);
    8610           0 :   void * * alloc_mem = &alloc_region;
    8611           0 :   fd_bpf_upgradeable_loader_state_program_decode_inner( mem, alloc_mem, ctx );
    8612           0 :   return self;
    8613           0 : }
    8614           0 : 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 ) {
    8615           0 :   int err;
    8616           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    8617           0 :   if( FD_UNLIKELY( err ) ) return err;
    8618           0 :   err = fd_bincode_bool_encode( self->has_upgrade_authority_address, ctx );
    8619           0 :   if( FD_UNLIKELY( err ) ) return err;
    8620           0 :   if( self->has_upgrade_authority_address ) {
    8621           0 :     err = fd_pubkey_encode( &self->upgrade_authority_address, ctx );
    8622           0 :     if( FD_UNLIKELY( err ) ) return err;
    8623           0 :   }
    8624           0 :   return FD_BINCODE_SUCCESS;
    8625           0 : }
    8626           0 : static int fd_bpf_upgradeable_loader_state_program_data_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8627           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8628           0 :   int err = 0;
    8629           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    8630           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    8631           0 :   {
    8632           0 :     uchar o;
    8633           0 :     err = fd_bincode_bool_decode( &o, ctx );
    8634           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    8635           0 :     if( o ) {
    8636           0 :       err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    8637           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    8638           0 :     }
    8639           0 :   }
    8640           0 :   return 0;
    8641           0 : }
    8642           0 : int fd_bpf_upgradeable_loader_state_program_data_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8643           0 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_state_program_data_t);
    8644           0 :   void const * start_data = ctx->data;
    8645           0 :   int err = fd_bpf_upgradeable_loader_state_program_data_decode_footprint_inner( ctx, total_sz );
    8646           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8647           0 :   ctx->data = start_data;
    8648           0 :   return err;
    8649           0 : }
    8650           0 : static void fd_bpf_upgradeable_loader_state_program_data_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8651           0 :   fd_bpf_upgradeable_loader_state_program_data_t * self = (fd_bpf_upgradeable_loader_state_program_data_t *)struct_mem;
    8652           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    8653           0 :   {
    8654           0 :     uchar o;
    8655           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    8656           0 :     self->has_upgrade_authority_address = !!o;
    8657           0 :     if( o ) {
    8658           0 :       fd_pubkey_new( &self->upgrade_authority_address );
    8659           0 :       fd_pubkey_decode_inner( &self->upgrade_authority_address, alloc_mem, ctx );
    8660           0 :     }
    8661           0 :   }
    8662           0 : }
    8663           0 : void * fd_bpf_upgradeable_loader_state_program_data_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8664           0 :   fd_bpf_upgradeable_loader_state_program_data_t * self = (fd_bpf_upgradeable_loader_state_program_data_t *)mem;
    8665           0 :   fd_bpf_upgradeable_loader_state_program_data_new( self );
    8666           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_state_program_data_t);
    8667           0 :   void * * alloc_mem = &alloc_region;
    8668           0 :   fd_bpf_upgradeable_loader_state_program_data_decode_inner( mem, alloc_mem, ctx );
    8669           0 :   return self;
    8670           0 : }
    8671           0 : void fd_bpf_upgradeable_loader_state_program_data_new(fd_bpf_upgradeable_loader_state_program_data_t * self) {
    8672           0 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_state_program_data_t) );
    8673           0 : }
    8674           0 : ulong fd_bpf_upgradeable_loader_state_program_data_size( fd_bpf_upgradeable_loader_state_program_data_t const * self ) {
    8675           0 :   ulong size = 0;
    8676           0 :   size += sizeof(ulong);
    8677           0 :   size += sizeof(char);
    8678           0 :   if( self->has_upgrade_authority_address ) {
    8679           0 :     size += fd_pubkey_size( &self->upgrade_authority_address );
    8680           0 :   }
    8681           0 :   return size;
    8682           0 : }
    8683             : 
    8684           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_state_is_uninitialized(fd_bpf_upgradeable_loader_state_t const * self) {
    8685           0 :   return self->discriminant == 0;
    8686           0 : }
    8687           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_state_is_buffer(fd_bpf_upgradeable_loader_state_t const * self) {
    8688           0 :   return self->discriminant == 1;
    8689           0 : }
    8690           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_state_is_program(fd_bpf_upgradeable_loader_state_t const * self) {
    8691           0 :   return self->discriminant == 2;
    8692           0 : }
    8693           0 : FD_FN_PURE uchar fd_bpf_upgradeable_loader_state_is_program_data(fd_bpf_upgradeable_loader_state_t const * self) {
    8694           0 :   return self->discriminant == 3;
    8695           0 : }
    8696             : void fd_bpf_upgradeable_loader_state_inner_new( fd_bpf_upgradeable_loader_state_inner_t * self, uint discriminant );
    8697           0 : int fd_bpf_upgradeable_loader_state_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8698           0 :   int err;
    8699           0 :   switch (discriminant) {
    8700           0 :   case 0: {
    8701           0 :     return FD_BINCODE_SUCCESS;
    8702           0 :   }
    8703           0 :   case 1: {
    8704           0 :     err = fd_bpf_upgradeable_loader_state_buffer_decode_footprint_inner( ctx, total_sz );
    8705           0 :     if( FD_UNLIKELY( err ) ) return err;
    8706           0 :     return FD_BINCODE_SUCCESS;
    8707           0 :   }
    8708           0 :   case 2: {
    8709           0 :     err = fd_bpf_upgradeable_loader_state_program_decode_footprint_inner( ctx, total_sz );
    8710           0 :     if( FD_UNLIKELY( err ) ) return err;
    8711           0 :     return FD_BINCODE_SUCCESS;
    8712           0 :   }
    8713           0 :   case 3: {
    8714           0 :     err = fd_bpf_upgradeable_loader_state_program_data_decode_footprint_inner( ctx, total_sz );
    8715           0 :     if( FD_UNLIKELY( err ) ) return err;
    8716           0 :     return FD_BINCODE_SUCCESS;
    8717           0 :   }
    8718           0 :   default: return FD_BINCODE_ERR_ENCODING;
    8719           0 :   }
    8720           0 : }
    8721           0 : static int fd_bpf_upgradeable_loader_state_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8722           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8723           0 :   uint discriminant = 0;
    8724           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    8725           0 :   if( FD_UNLIKELY( err ) ) return err;
    8726           0 :   return fd_bpf_upgradeable_loader_state_inner_decode_footprint( discriminant, ctx, total_sz );
    8727           0 : }
    8728           0 : int fd_bpf_upgradeable_loader_state_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8729           0 :   *total_sz += sizeof(fd_bpf_upgradeable_loader_state_t);
    8730           0 :   void const * start_data = ctx->data;
    8731           0 :   int err =  fd_bpf_upgradeable_loader_state_decode_footprint_inner( ctx, total_sz );
    8732           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8733           0 :   ctx->data = start_data;
    8734           0 :   return err;
    8735           0 : }
    8736           0 : 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 ) {
    8737           0 :   switch (discriminant) {
    8738           0 :   case 0: {
    8739           0 :     break;
    8740           0 :   }
    8741           0 :   case 1: {
    8742           0 :     fd_bpf_upgradeable_loader_state_buffer_decode_inner( &self->buffer, alloc_mem, ctx );
    8743           0 :     break;
    8744           0 :   }
    8745           0 :   case 2: {
    8746           0 :     fd_bpf_upgradeable_loader_state_program_decode_inner( &self->program, alloc_mem, ctx );
    8747           0 :     break;
    8748           0 :   }
    8749           0 :   case 3: {
    8750           0 :     fd_bpf_upgradeable_loader_state_program_data_decode_inner( &self->program_data, alloc_mem, ctx );
    8751           0 :     break;
    8752           0 :   }
    8753           0 :   }
    8754           0 : }
    8755           0 : static void fd_bpf_upgradeable_loader_state_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8756           0 :   fd_bpf_upgradeable_loader_state_t * self = (fd_bpf_upgradeable_loader_state_t *)struct_mem;
    8757           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    8758           0 :   fd_bpf_upgradeable_loader_state_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    8759           0 : }
    8760           0 : void * fd_bpf_upgradeable_loader_state_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8761           0 :   fd_bpf_upgradeable_loader_state_t * self = (fd_bpf_upgradeable_loader_state_t *)mem;
    8762           0 :   fd_bpf_upgradeable_loader_state_new( self );
    8763           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_bpf_upgradeable_loader_state_t);
    8764           0 :   void * * alloc_mem = &alloc_region;
    8765           0 :   fd_bpf_upgradeable_loader_state_decode_inner( mem, alloc_mem, ctx );
    8766           0 :   return self;
    8767           0 : }
    8768           0 : void fd_bpf_upgradeable_loader_state_inner_new( fd_bpf_upgradeable_loader_state_inner_t * self, uint discriminant ) {
    8769           0 :   switch( discriminant ) {
    8770           0 :   case 0: {
    8771           0 :     break;
    8772           0 :   }
    8773           0 :   case 1: {
    8774           0 :     fd_bpf_upgradeable_loader_state_buffer_new( &self->buffer );
    8775           0 :     break;
    8776           0 :   }
    8777           0 :   case 2: {
    8778           0 :     fd_bpf_upgradeable_loader_state_program_new( &self->program );
    8779           0 :     break;
    8780           0 :   }
    8781           0 :   case 3: {
    8782           0 :     fd_bpf_upgradeable_loader_state_program_data_new( &self->program_data );
    8783           0 :     break;
    8784           0 :   }
    8785           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    8786           0 :   }
    8787           0 : }
    8788           0 : void fd_bpf_upgradeable_loader_state_new_disc( fd_bpf_upgradeable_loader_state_t * self, uint discriminant ) {
    8789           0 :   self->discriminant = discriminant;
    8790           0 :   fd_bpf_upgradeable_loader_state_inner_new( &self->inner, self->discriminant );
    8791           0 : }
    8792           0 : void fd_bpf_upgradeable_loader_state_new( fd_bpf_upgradeable_loader_state_t * self ) {
    8793           0 :   fd_memset( self, 0, sizeof(fd_bpf_upgradeable_loader_state_t) );
    8794           0 :   fd_bpf_upgradeable_loader_state_new_disc( self, UINT_MAX );
    8795           0 : }
    8796             : 
    8797           0 : ulong fd_bpf_upgradeable_loader_state_size( fd_bpf_upgradeable_loader_state_t const * self ) {
    8798           0 :   ulong size = 0;
    8799           0 :   size += sizeof(uint);
    8800           0 :   switch (self->discriminant) {
    8801           0 :   case 1: {
    8802           0 :     size += fd_bpf_upgradeable_loader_state_buffer_size( &self->inner.buffer );
    8803           0 :     break;
    8804           0 :   }
    8805           0 :   case 2: {
    8806           0 :     size += fd_bpf_upgradeable_loader_state_program_size( &self->inner.program );
    8807           0 :     break;
    8808           0 :   }
    8809           0 :   case 3: {
    8810           0 :     size += fd_bpf_upgradeable_loader_state_program_data_size( &self->inner.program_data );
    8811           0 :     break;
    8812           0 :   }
    8813           0 :   }
    8814           0 :   return size;
    8815           0 : }
    8816             : 
    8817           0 : 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 ) {
    8818           0 :   int err;
    8819           0 :   switch (discriminant) {
    8820           0 :   case 1: {
    8821           0 :     err = fd_bpf_upgradeable_loader_state_buffer_encode( &self->buffer, ctx );
    8822           0 :     if( FD_UNLIKELY( err ) ) return err;
    8823           0 :     break;
    8824           0 :   }
    8825           0 :   case 2: {
    8826           0 :     err = fd_bpf_upgradeable_loader_state_program_encode( &self->program, ctx );
    8827           0 :     if( FD_UNLIKELY( err ) ) return err;
    8828           0 :     break;
    8829           0 :   }
    8830           0 :   case 3: {
    8831           0 :     err = fd_bpf_upgradeable_loader_state_program_data_encode( &self->program_data, ctx );
    8832           0 :     if( FD_UNLIKELY( err ) ) return err;
    8833           0 :     break;
    8834           0 :   }
    8835           0 :   }
    8836           0 :   return FD_BINCODE_SUCCESS;
    8837           0 : }
    8838           0 : int fd_bpf_upgradeable_loader_state_encode( fd_bpf_upgradeable_loader_state_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    8839           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    8840           0 :   if( FD_UNLIKELY( err ) ) return err;
    8841           0 :   return fd_bpf_upgradeable_loader_state_inner_encode( &self->inner, self->discriminant, ctx );
    8842           0 : }
    8843             : 
    8844           0 : int fd_loader_v4_state_encode( fd_loader_v4_state_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    8845           0 :   int err;
    8846           0 :   err = fd_bincode_uint64_encode( self->slot, ctx );
    8847           0 :   if( FD_UNLIKELY( err ) ) return err;
    8848           0 :   err = fd_pubkey_encode( &self->authority_address_or_next_version, ctx );
    8849           0 :   if( FD_UNLIKELY( err ) ) return err;
    8850           0 :   err = fd_bincode_uint64_encode( self->status, ctx );
    8851           0 :   if( FD_UNLIKELY( err ) ) return err;
    8852           0 :   return FD_BINCODE_SUCCESS;
    8853           0 : }
    8854           0 : static inline int fd_loader_v4_state_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8855           0 :   if( (ulong)ctx->data + 48UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8856           0 :   ctx->data = (void *)( (ulong)ctx->data + 48UL );
    8857           0 :   return 0;
    8858           0 : }
    8859           0 : static void fd_loader_v4_state_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8860           0 :   fd_loader_v4_state_t * self = (fd_loader_v4_state_t *)struct_mem;
    8861           0 :   fd_bincode_uint64_decode_unsafe( &self->slot, ctx );
    8862           0 :   fd_pubkey_decode_inner( &self->authority_address_or_next_version, alloc_mem, ctx );
    8863           0 :   fd_bincode_uint64_decode_unsafe( &self->status, ctx );
    8864           0 : }
    8865           0 : void * fd_loader_v4_state_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8866           0 :   fd_loader_v4_state_t * self = (fd_loader_v4_state_t *)mem;
    8867           0 :   fd_loader_v4_state_new( self );
    8868           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_loader_v4_state_t);
    8869           0 :   void * * alloc_mem = &alloc_region;
    8870           0 :   fd_loader_v4_state_decode_inner( mem, alloc_mem, ctx );
    8871           0 :   return self;
    8872           0 : }
    8873           0 : int fd_frozen_hash_status_encode( fd_frozen_hash_status_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    8874           0 :   int err;
    8875           0 :   err = fd_hash_encode( &self->frozen_hash, ctx );
    8876           0 :   if( FD_UNLIKELY( err ) ) return err;
    8877           0 :   err = fd_bincode_bool_encode( (uchar)(self->is_duplicate_confirmed), ctx );
    8878           0 :   if( FD_UNLIKELY( err ) ) return err;
    8879           0 :   return FD_BINCODE_SUCCESS;
    8880           0 : }
    8881           0 : static int fd_frozen_hash_status_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8882           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8883           0 :   int err = 0;
    8884           0 :   err = fd_hash_decode_footprint_inner( ctx, total_sz );
    8885           0 :   if( FD_UNLIKELY( err ) ) return err;
    8886           0 :   err = fd_bincode_bool_decode_footprint( ctx );
    8887           0 :   if( FD_UNLIKELY( err ) ) return err;
    8888           0 :   return 0;
    8889           0 : }
    8890           0 : int fd_frozen_hash_status_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8891           0 :   *total_sz += sizeof(fd_frozen_hash_status_t);
    8892           0 :   void const * start_data = ctx->data;
    8893           0 :   int err = fd_frozen_hash_status_decode_footprint_inner( ctx, total_sz );
    8894           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8895           0 :   ctx->data = start_data;
    8896           0 :   return err;
    8897           0 : }
    8898           0 : static void fd_frozen_hash_status_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8899           0 :   fd_frozen_hash_status_t * self = (fd_frozen_hash_status_t *)struct_mem;
    8900           0 :   fd_hash_decode_inner( &self->frozen_hash, alloc_mem, ctx );
    8901           0 :   fd_bincode_bool_decode_unsafe( &self->is_duplicate_confirmed, ctx );
    8902           0 : }
    8903           0 : void * fd_frozen_hash_status_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8904           0 :   fd_frozen_hash_status_t * self = (fd_frozen_hash_status_t *)mem;
    8905           0 :   fd_frozen_hash_status_new( self );
    8906           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_frozen_hash_status_t);
    8907           0 :   void * * alloc_mem = &alloc_region;
    8908           0 :   fd_frozen_hash_status_decode_inner( mem, alloc_mem, ctx );
    8909           0 :   return self;
    8910           0 : }
    8911           0 : void fd_frozen_hash_status_new(fd_frozen_hash_status_t * self) {
    8912           0 :   fd_memset( self, 0, sizeof(fd_frozen_hash_status_t) );
    8913           0 :   fd_hash_new( &self->frozen_hash );
    8914           0 : }
    8915           0 : FD_FN_PURE uchar fd_frozen_hash_versioned_is_current(fd_frozen_hash_versioned_t const * self) {
    8916           0 :   return self->discriminant == 0;
    8917           0 : }
    8918             : void fd_frozen_hash_versioned_inner_new( fd_frozen_hash_versioned_inner_t * self, uint discriminant );
    8919           0 : int fd_frozen_hash_versioned_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8920           0 :   int err;
    8921           0 :   switch (discriminant) {
    8922           0 :   case 0: {
    8923           0 :     err = fd_frozen_hash_status_decode_footprint_inner( ctx, total_sz );
    8924           0 :     if( FD_UNLIKELY( err ) ) return err;
    8925           0 :     return FD_BINCODE_SUCCESS;
    8926           0 :   }
    8927           0 :   default: return FD_BINCODE_ERR_ENCODING;
    8928           0 :   }
    8929           0 : }
    8930           0 : static int fd_frozen_hash_versioned_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8931           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8932           0 :   uint discriminant = 0;
    8933           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    8934           0 :   if( FD_UNLIKELY( err ) ) return err;
    8935           0 :   return fd_frozen_hash_versioned_inner_decode_footprint( discriminant, ctx, total_sz );
    8936           0 : }
    8937           0 : int fd_frozen_hash_versioned_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    8938           0 :   *total_sz += sizeof(fd_frozen_hash_versioned_t);
    8939           0 :   void const * start_data = ctx->data;
    8940           0 :   int err =  fd_frozen_hash_versioned_decode_footprint_inner( ctx, total_sz );
    8941           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    8942           0 :   ctx->data = start_data;
    8943           0 :   return err;
    8944           0 : }
    8945           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 ) {
    8946           0 :   switch (discriminant) {
    8947           0 :   case 0: {
    8948           0 :     fd_frozen_hash_status_decode_inner( &self->current, alloc_mem, ctx );
    8949           0 :     break;
    8950           0 :   }
    8951           0 :   }
    8952           0 : }
    8953           0 : static void fd_frozen_hash_versioned_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    8954           0 :   fd_frozen_hash_versioned_t * self = (fd_frozen_hash_versioned_t *)struct_mem;
    8955           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    8956           0 :   fd_frozen_hash_versioned_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    8957           0 : }
    8958           0 : void * fd_frozen_hash_versioned_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    8959           0 :   fd_frozen_hash_versioned_t * self = (fd_frozen_hash_versioned_t *)mem;
    8960           0 :   fd_frozen_hash_versioned_new( self );
    8961           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_frozen_hash_versioned_t);
    8962           0 :   void * * alloc_mem = &alloc_region;
    8963           0 :   fd_frozen_hash_versioned_decode_inner( mem, alloc_mem, ctx );
    8964           0 :   return self;
    8965           0 : }
    8966           0 : void fd_frozen_hash_versioned_inner_new( fd_frozen_hash_versioned_inner_t * self, uint discriminant ) {
    8967           0 :   switch( discriminant ) {
    8968           0 :   case 0: {
    8969           0 :     fd_frozen_hash_status_new( &self->current );
    8970           0 :     break;
    8971           0 :   }
    8972           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    8973           0 :   }
    8974           0 : }
    8975           0 : void fd_frozen_hash_versioned_new_disc( fd_frozen_hash_versioned_t * self, uint discriminant ) {
    8976           0 :   self->discriminant = discriminant;
    8977           0 :   fd_frozen_hash_versioned_inner_new( &self->inner, self->discriminant );
    8978           0 : }
    8979           0 : void fd_frozen_hash_versioned_new( fd_frozen_hash_versioned_t * self ) {
    8980           0 :   fd_memset( self, 0, sizeof(fd_frozen_hash_versioned_t) );
    8981           0 :   fd_frozen_hash_versioned_new_disc( self, UINT_MAX );
    8982           0 : }
    8983             : 
    8984           0 : ulong fd_frozen_hash_versioned_size( fd_frozen_hash_versioned_t const * self ) {
    8985           0 :   ulong size = 0;
    8986           0 :   size += sizeof(uint);
    8987           0 :   switch (self->discriminant) {
    8988           0 :   case 0: {
    8989           0 :     size += fd_frozen_hash_status_size( &self->inner.current );
    8990           0 :     break;
    8991           0 :   }
    8992           0 :   }
    8993           0 :   return size;
    8994           0 : }
    8995             : 
    8996           0 : int fd_frozen_hash_versioned_inner_encode( fd_frozen_hash_versioned_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    8997           0 :   int err;
    8998           0 :   switch (discriminant) {
    8999           0 :   case 0: {
    9000           0 :     err = fd_frozen_hash_status_encode( &self->current, ctx );
    9001           0 :     if( FD_UNLIKELY( err ) ) return err;
    9002           0 :     break;
    9003           0 :   }
    9004           0 :   }
    9005           0 :   return FD_BINCODE_SUCCESS;
    9006           0 : }
    9007           0 : int fd_frozen_hash_versioned_encode( fd_frozen_hash_versioned_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    9008           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    9009           0 :   if( FD_UNLIKELY( err ) ) return err;
    9010           0 :   return fd_frozen_hash_versioned_inner_encode( &self->inner, self->discriminant, ctx );
    9011           0 : }
    9012             : 
    9013           0 : int fd_lookup_table_meta_encode( fd_lookup_table_meta_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    9014           0 :   int err;
    9015           0 :   err = fd_bincode_uint64_encode( self->deactivation_slot, ctx );
    9016           0 :   if( FD_UNLIKELY( err ) ) return err;
    9017           0 :   err = fd_bincode_uint64_encode( self->last_extended_slot, ctx );
    9018           0 :   if( FD_UNLIKELY( err ) ) return err;
    9019           0 :   err = fd_bincode_uint8_encode( (uchar)(self->last_extended_slot_start_index), ctx );
    9020           0 :   if( FD_UNLIKELY( err ) ) return err;
    9021           0 :   err = fd_bincode_bool_encode( self->has_authority, ctx );
    9022           0 :   if( FD_UNLIKELY( err ) ) return err;
    9023           0 :   if( self->has_authority ) {
    9024           0 :     err = fd_pubkey_encode( &self->authority, ctx );
    9025           0 :     if( FD_UNLIKELY( err ) ) return err;
    9026           0 :   }
    9027           0 :   err = fd_bincode_uint16_encode( self->_padding, ctx );
    9028           0 :   if( FD_UNLIKELY( err ) ) return err;
    9029           0 :   return FD_BINCODE_SUCCESS;
    9030           0 : }
    9031           0 : static int fd_lookup_table_meta_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9032           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9033           0 :   int err = 0;
    9034           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    9035           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    9036           0 :   err = fd_bincode_uint64_decode_footprint( ctx );
    9037           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    9038           0 :   err = fd_bincode_uint8_decode_footprint( ctx );
    9039           0 :   if( FD_UNLIKELY( err ) ) return err;
    9040           0 :   {
    9041           0 :     uchar o;
    9042           0 :     err = fd_bincode_bool_decode( &o, ctx );
    9043           0 :     if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    9044           0 :     if( o ) {
    9045           0 :       err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    9046           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    9047           0 :     }
    9048           0 :   }
    9049           0 :   err = fd_bincode_uint16_decode_footprint( ctx );
    9050           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    9051           0 :   return 0;
    9052           0 : }
    9053           0 : int fd_lookup_table_meta_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9054           0 :   *total_sz += sizeof(fd_lookup_table_meta_t);
    9055           0 :   void const * start_data = ctx->data;
    9056           0 :   int err = fd_lookup_table_meta_decode_footprint_inner( ctx, total_sz );
    9057           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9058           0 :   ctx->data = start_data;
    9059           0 :   return err;
    9060           0 : }
    9061           0 : static void fd_lookup_table_meta_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    9062           0 :   fd_lookup_table_meta_t * self = (fd_lookup_table_meta_t *)struct_mem;
    9063           0 :   fd_bincode_uint64_decode_unsafe( &self->deactivation_slot, ctx );
    9064           0 :   fd_bincode_uint64_decode_unsafe( &self->last_extended_slot, ctx );
    9065           0 :   fd_bincode_uint8_decode_unsafe( &self->last_extended_slot_start_index, ctx );
    9066           0 :   {
    9067           0 :     uchar o;
    9068           0 :     fd_bincode_bool_decode_unsafe( &o, ctx );
    9069           0 :     self->has_authority = !!o;
    9070           0 :     if( o ) {
    9071           0 :       fd_pubkey_new( &self->authority );
    9072           0 :       fd_pubkey_decode_inner( &self->authority, alloc_mem, ctx );
    9073           0 :     }
    9074           0 :   }
    9075           0 :   fd_bincode_uint16_decode_unsafe( &self->_padding, ctx );
    9076           0 : }
    9077           0 : void * fd_lookup_table_meta_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    9078           0 :   fd_lookup_table_meta_t * self = (fd_lookup_table_meta_t *)mem;
    9079           0 :   fd_lookup_table_meta_new( self );
    9080           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_lookup_table_meta_t);
    9081           0 :   void * * alloc_mem = &alloc_region;
    9082           0 :   fd_lookup_table_meta_decode_inner( mem, alloc_mem, ctx );
    9083           0 :   return self;
    9084           0 : }
    9085           0 : void fd_lookup_table_meta_new(fd_lookup_table_meta_t * self) {
    9086           0 :   fd_memset( self, 0, sizeof(fd_lookup_table_meta_t) );
    9087           0 : }
    9088           0 : ulong fd_lookup_table_meta_size( fd_lookup_table_meta_t const * self ) {
    9089           0 :   ulong size = 0;
    9090           0 :   size += sizeof(ulong);
    9091           0 :   size += sizeof(ulong);
    9092           0 :   size += sizeof(char);
    9093           0 :   size += sizeof(char);
    9094           0 :   if( self->has_authority ) {
    9095           0 :     size += fd_pubkey_size( &self->authority );
    9096           0 :   }
    9097           0 :   size += sizeof(ushort);
    9098           0 :   return size;
    9099           0 : }
    9100             : 
    9101           0 : int fd_address_lookup_table_encode( fd_address_lookup_table_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    9102           0 :   int err;
    9103           0 :   err = fd_lookup_table_meta_encode( &self->meta, ctx );
    9104           0 :   if( FD_UNLIKELY( err ) ) return err;
    9105           0 :   return FD_BINCODE_SUCCESS;
    9106           0 : }
    9107           0 : static int fd_address_lookup_table_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9108           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9109           0 :   int err = 0;
    9110           0 :   err = fd_lookup_table_meta_decode_footprint_inner( ctx, total_sz );
    9111           0 :   if( FD_UNLIKELY( err ) ) return err;
    9112           0 :   return 0;
    9113           0 : }
    9114           0 : int fd_address_lookup_table_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9115           0 :   *total_sz += sizeof(fd_address_lookup_table_t);
    9116           0 :   void const * start_data = ctx->data;
    9117           0 :   int err = fd_address_lookup_table_decode_footprint_inner( ctx, total_sz );
    9118           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9119           0 :   ctx->data = start_data;
    9120           0 :   return err;
    9121           0 : }
    9122           0 : static void fd_address_lookup_table_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    9123           0 :   fd_address_lookup_table_t * self = (fd_address_lookup_table_t *)struct_mem;
    9124           0 :   fd_lookup_table_meta_decode_inner( &self->meta, alloc_mem, ctx );
    9125           0 : }
    9126           0 : void * fd_address_lookup_table_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    9127           0 :   fd_address_lookup_table_t * self = (fd_address_lookup_table_t *)mem;
    9128           0 :   fd_address_lookup_table_new( self );
    9129           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_address_lookup_table_t);
    9130           0 :   void * * alloc_mem = &alloc_region;
    9131           0 :   fd_address_lookup_table_decode_inner( mem, alloc_mem, ctx );
    9132           0 :   return self;
    9133           0 : }
    9134           0 : void fd_address_lookup_table_new(fd_address_lookup_table_t * self) {
    9135           0 :   fd_memset( self, 0, sizeof(fd_address_lookup_table_t) );
    9136           0 :   fd_lookup_table_meta_new( &self->meta );
    9137           0 : }
    9138           0 : ulong fd_address_lookup_table_size( fd_address_lookup_table_t const * self ) {
    9139           0 :   ulong size = 0;
    9140           0 :   size += fd_lookup_table_meta_size( &self->meta );
    9141           0 :   return size;
    9142           0 : }
    9143             : 
    9144           0 : FD_FN_PURE uchar fd_address_lookup_table_state_is_uninitialized(fd_address_lookup_table_state_t const * self) {
    9145           0 :   return self->discriminant == 0;
    9146           0 : }
    9147           0 : FD_FN_PURE uchar fd_address_lookup_table_state_is_lookup_table(fd_address_lookup_table_state_t const * self) {
    9148           0 :   return self->discriminant == 1;
    9149           0 : }
    9150             : void fd_address_lookup_table_state_inner_new( fd_address_lookup_table_state_inner_t * self, uint discriminant );
    9151           0 : int fd_address_lookup_table_state_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9152           0 :   int err;
    9153           0 :   switch (discriminant) {
    9154           0 :   case 0: {
    9155           0 :     return FD_BINCODE_SUCCESS;
    9156           0 :   }
    9157           0 :   case 1: {
    9158           0 :     err = fd_address_lookup_table_decode_footprint_inner( ctx, total_sz );
    9159           0 :     if( FD_UNLIKELY( err ) ) return err;
    9160           0 :     return FD_BINCODE_SUCCESS;
    9161           0 :   }
    9162           0 :   default: return FD_BINCODE_ERR_ENCODING;
    9163           0 :   }
    9164           0 : }
    9165           0 : static int fd_address_lookup_table_state_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9166           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9167           0 :   uint discriminant = 0;
    9168           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    9169           0 :   if( FD_UNLIKELY( err ) ) return err;
    9170           0 :   return fd_address_lookup_table_state_inner_decode_footprint( discriminant, ctx, total_sz );
    9171           0 : }
    9172           0 : int fd_address_lookup_table_state_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9173           0 :   *total_sz += sizeof(fd_address_lookup_table_state_t);
    9174           0 :   void const * start_data = ctx->data;
    9175           0 :   int err =  fd_address_lookup_table_state_decode_footprint_inner( ctx, total_sz );
    9176           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9177           0 :   ctx->data = start_data;
    9178           0 :   return err;
    9179           0 : }
    9180           0 : 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 ) {
    9181           0 :   switch (discriminant) {
    9182           0 :   case 0: {
    9183           0 :     break;
    9184           0 :   }
    9185           0 :   case 1: {
    9186           0 :     fd_address_lookup_table_decode_inner( &self->lookup_table, alloc_mem, ctx );
    9187           0 :     break;
    9188           0 :   }
    9189           0 :   }
    9190           0 : }
    9191           0 : static void fd_address_lookup_table_state_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    9192           0 :   fd_address_lookup_table_state_t * self = (fd_address_lookup_table_state_t *)struct_mem;
    9193           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    9194           0 :   fd_address_lookup_table_state_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    9195           0 : }
    9196           0 : void * fd_address_lookup_table_state_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    9197           0 :   fd_address_lookup_table_state_t * self = (fd_address_lookup_table_state_t *)mem;
    9198           0 :   fd_address_lookup_table_state_new( self );
    9199           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_address_lookup_table_state_t);
    9200           0 :   void * * alloc_mem = &alloc_region;
    9201           0 :   fd_address_lookup_table_state_decode_inner( mem, alloc_mem, ctx );
    9202           0 :   return self;
    9203           0 : }
    9204           0 : void fd_address_lookup_table_state_inner_new( fd_address_lookup_table_state_inner_t * self, uint discriminant ) {
    9205           0 :   switch( discriminant ) {
    9206           0 :   case 0: {
    9207           0 :     break;
    9208           0 :   }
    9209           0 :   case 1: {
    9210           0 :     fd_address_lookup_table_new( &self->lookup_table );
    9211           0 :     break;
    9212           0 :   }
    9213           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    9214           0 :   }
    9215           0 : }
    9216           0 : void fd_address_lookup_table_state_new_disc( fd_address_lookup_table_state_t * self, uint discriminant ) {
    9217           0 :   self->discriminant = discriminant;
    9218           0 :   fd_address_lookup_table_state_inner_new( &self->inner, self->discriminant );
    9219           0 : }
    9220           0 : void fd_address_lookup_table_state_new( fd_address_lookup_table_state_t * self ) {
    9221           0 :   fd_memset( self, 0, sizeof(fd_address_lookup_table_state_t) );
    9222           0 :   fd_address_lookup_table_state_new_disc( self, UINT_MAX );
    9223           0 : }
    9224             : 
    9225           0 : ulong fd_address_lookup_table_state_size( fd_address_lookup_table_state_t const * self ) {
    9226           0 :   ulong size = 0;
    9227           0 :   size += sizeof(uint);
    9228           0 :   switch (self->discriminant) {
    9229           0 :   case 1: {
    9230           0 :     size += fd_address_lookup_table_size( &self->inner.lookup_table );
    9231           0 :     break;
    9232           0 :   }
    9233           0 :   }
    9234           0 :   return size;
    9235           0 : }
    9236             : 
    9237           0 : 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 ) {
    9238           0 :   int err;
    9239           0 :   switch (discriminant) {
    9240           0 :   case 1: {
    9241           0 :     err = fd_address_lookup_table_encode( &self->lookup_table, ctx );
    9242           0 :     if( FD_UNLIKELY( err ) ) return err;
    9243           0 :     break;
    9244           0 :   }
    9245           0 :   }
    9246           0 :   return FD_BINCODE_SUCCESS;
    9247           0 : }
    9248           0 : int fd_address_lookup_table_state_encode( fd_address_lookup_table_state_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    9249           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    9250           0 :   if( FD_UNLIKELY( err ) ) return err;
    9251           0 :   return fd_address_lookup_table_state_inner_encode( &self->inner, self->discriminant, ctx );
    9252           0 : }
    9253             : 
    9254           0 : int fd_addrlut_create_encode( fd_addrlut_create_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    9255           0 :   int err;
    9256           0 :   err = fd_bincode_uint64_encode( self->recent_slot, ctx );
    9257           0 :   if( FD_UNLIKELY( err ) ) return err;
    9258           0 :   err = fd_bincode_uint8_encode( (uchar)(self->bump_seed), ctx );
    9259           0 :   if( FD_UNLIKELY( err ) ) return err;
    9260           0 :   return FD_BINCODE_SUCCESS;
    9261           0 : }
    9262           0 : static inline int fd_addrlut_create_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9263           0 :   if( (ulong)ctx->data + 9UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9264           0 :   ctx->data = (void *)( (ulong)ctx->data + 9UL );
    9265           0 :   return 0;
    9266           0 : }
    9267           0 : static void fd_addrlut_create_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    9268           0 :   fd_addrlut_create_t * self = (fd_addrlut_create_t *)struct_mem;
    9269           0 :   fd_bincode_uint64_decode_unsafe( &self->recent_slot, ctx );
    9270           0 :   fd_bincode_uint8_decode_unsafe( &self->bump_seed, ctx );
    9271           0 : }
    9272           0 : void * fd_addrlut_create_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    9273           0 :   fd_addrlut_create_t * self = (fd_addrlut_create_t *)mem;
    9274           0 :   fd_addrlut_create_new( self );
    9275           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_addrlut_create_t);
    9276           0 :   void * * alloc_mem = &alloc_region;
    9277           0 :   fd_addrlut_create_decode_inner( mem, alloc_mem, ctx );
    9278           0 :   return self;
    9279           0 : }
    9280           0 : int fd_addrlut_extend_encode( fd_addrlut_extend_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    9281           0 :   int err;
    9282           0 :   err = fd_bincode_uint64_encode( self->new_addrs_len, ctx );
    9283           0 :   if( FD_UNLIKELY(err) ) return err;
    9284           0 :   if( self->new_addrs_len ) {
    9285           0 :     for( ulong i=0; i < self->new_addrs_len; i++ ) {
    9286           0 :       err = fd_pubkey_encode( self->new_addrs + i, ctx );
    9287           0 :       if( FD_UNLIKELY( err ) ) return err;
    9288           0 :     }
    9289           0 :   }
    9290           0 :   return FD_BINCODE_SUCCESS;
    9291           0 : }
    9292           0 : static int fd_addrlut_extend_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9293           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9294           0 :   int err = 0;
    9295           0 :   ulong new_addrs_len;
    9296           0 :   err = fd_bincode_uint64_decode( &new_addrs_len, ctx );
    9297           0 :   if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    9298           0 :   if( new_addrs_len ) {
    9299           0 :     *total_sz += FD_PUBKEY_ALIGN + sizeof(fd_pubkey_t)*new_addrs_len;
    9300           0 :     for( ulong i=0; i < new_addrs_len; i++ ) {
    9301           0 :       err = fd_pubkey_decode_footprint_inner( ctx, total_sz );
    9302           0 :       if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
    9303           0 :     }
    9304           0 :   }
    9305           0 :   return 0;
    9306           0 : }
    9307           0 : int fd_addrlut_extend_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9308           0 :   *total_sz += sizeof(fd_addrlut_extend_t);
    9309           0 :   void const * start_data = ctx->data;
    9310           0 :   int err = fd_addrlut_extend_decode_footprint_inner( ctx, total_sz );
    9311           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9312           0 :   ctx->data = start_data;
    9313           0 :   return err;
    9314           0 : }
    9315           0 : static void fd_addrlut_extend_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    9316           0 :   fd_addrlut_extend_t * self = (fd_addrlut_extend_t *)struct_mem;
    9317           0 :   fd_bincode_uint64_decode_unsafe( &self->new_addrs_len, ctx );
    9318           0 :   if( self->new_addrs_len ) {
    9319           0 :     *alloc_mem = (void*)fd_ulong_align_up( (ulong)(*alloc_mem), FD_PUBKEY_ALIGN );
    9320           0 :     self->new_addrs = *alloc_mem;
    9321           0 :     *alloc_mem = (uchar *)(*alloc_mem) + sizeof(fd_pubkey_t)*self->new_addrs_len;
    9322           0 :     for( ulong i=0; i < self->new_addrs_len; i++ ) {
    9323           0 :       fd_pubkey_new( self->new_addrs + i );
    9324           0 :       fd_pubkey_decode_inner( self->new_addrs + i, alloc_mem, ctx );
    9325           0 :     }
    9326           0 :   } else
    9327           0 :     self->new_addrs = NULL;
    9328           0 : }
    9329           0 : void * fd_addrlut_extend_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    9330           0 :   fd_addrlut_extend_t * self = (fd_addrlut_extend_t *)mem;
    9331           0 :   fd_addrlut_extend_new( self );
    9332           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_addrlut_extend_t);
    9333           0 :   void * * alloc_mem = &alloc_region;
    9334           0 :   fd_addrlut_extend_decode_inner( mem, alloc_mem, ctx );
    9335           0 :   return self;
    9336           0 : }
    9337           0 : void fd_addrlut_extend_new(fd_addrlut_extend_t * self) {
    9338           0 :   fd_memset( self, 0, sizeof(fd_addrlut_extend_t) );
    9339           0 : }
    9340           0 : ulong fd_addrlut_extend_size( fd_addrlut_extend_t const * self ) {
    9341           0 :   ulong size = 0;
    9342           0 :   do {
    9343           0 :     size += sizeof(ulong);
    9344           0 :     for( ulong i=0; i < self->new_addrs_len; i++ )
    9345           0 :       size += fd_pubkey_size( self->new_addrs + i );
    9346           0 :   } while(0);
    9347           0 :   return size;
    9348           0 : }
    9349             : 
    9350           0 : FD_FN_PURE uchar fd_addrlut_instruction_is_create_lut(fd_addrlut_instruction_t const * self) {
    9351           0 :   return self->discriminant == 0;
    9352           0 : }
    9353           0 : FD_FN_PURE uchar fd_addrlut_instruction_is_freeze_lut(fd_addrlut_instruction_t const * self) {
    9354           0 :   return self->discriminant == 1;
    9355           0 : }
    9356           0 : FD_FN_PURE uchar fd_addrlut_instruction_is_extend_lut(fd_addrlut_instruction_t const * self) {
    9357           0 :   return self->discriminant == 2;
    9358           0 : }
    9359           0 : FD_FN_PURE uchar fd_addrlut_instruction_is_deactivate_lut(fd_addrlut_instruction_t const * self) {
    9360           0 :   return self->discriminant == 3;
    9361           0 : }
    9362           0 : FD_FN_PURE uchar fd_addrlut_instruction_is_close_lut(fd_addrlut_instruction_t const * self) {
    9363           0 :   return self->discriminant == 4;
    9364           0 : }
    9365             : void fd_addrlut_instruction_inner_new( fd_addrlut_instruction_inner_t * self, uint discriminant );
    9366           0 : int fd_addrlut_instruction_inner_decode_footprint( uint discriminant, fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9367           0 :   int err;
    9368           0 :   switch (discriminant) {
    9369           0 :   case 0: {
    9370           0 :     err = fd_addrlut_create_decode_footprint_inner( ctx, total_sz );
    9371           0 :     if( FD_UNLIKELY( err ) ) return err;
    9372           0 :     return FD_BINCODE_SUCCESS;
    9373           0 :   }
    9374           0 :   case 1: {
    9375           0 :     return FD_BINCODE_SUCCESS;
    9376           0 :   }
    9377           0 :   case 2: {
    9378           0 :     err = fd_addrlut_extend_decode_footprint_inner( ctx, total_sz );
    9379           0 :     if( FD_UNLIKELY( err ) ) return err;
    9380           0 :     return FD_BINCODE_SUCCESS;
    9381           0 :   }
    9382           0 :   case 3: {
    9383           0 :     return FD_BINCODE_SUCCESS;
    9384           0 :   }
    9385           0 :   case 4: {
    9386           0 :     return FD_BINCODE_SUCCESS;
    9387           0 :   }
    9388           0 :   default: return FD_BINCODE_ERR_ENCODING;
    9389           0 :   }
    9390           0 : }
    9391           0 : static int fd_addrlut_instruction_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9392           0 :   if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9393           0 :   uint discriminant = 0;
    9394           0 :   int err = fd_bincode_uint32_decode( &discriminant, ctx );
    9395           0 :   if( FD_UNLIKELY( err ) ) return err;
    9396           0 :   return fd_addrlut_instruction_inner_decode_footprint( discriminant, ctx, total_sz );
    9397           0 : }
    9398           0 : int fd_addrlut_instruction_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
    9399           0 :   *total_sz += sizeof(fd_addrlut_instruction_t);
    9400           0 :   void const * start_data = ctx->data;
    9401           0 :   int err =  fd_addrlut_instruction_decode_footprint_inner( ctx, total_sz );
    9402           0 :   if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
    9403           0 :   ctx->data = start_data;
    9404           0 :   return err;
    9405           0 : }
    9406           0 : static void fd_addrlut_instruction_inner_decode_inner( fd_addrlut_instruction_inner_t * self, void * * alloc_mem, uint discriminant, fd_bincode_decode_ctx_t * ctx ) {
    9407           0 :   switch (discriminant) {
    9408           0 :   case 0: {
    9409           0 :     fd_addrlut_create_decode_inner( &self->create_lut, alloc_mem, ctx );
    9410           0 :     break;
    9411           0 :   }
    9412           0 :   case 1: {
    9413           0 :     break;
    9414           0 :   }
    9415           0 :   case 2: {
    9416           0 :     fd_addrlut_extend_decode_inner( &self->extend_lut, alloc_mem, ctx );
    9417           0 :     break;
    9418           0 :   }
    9419           0 :   case 3: {
    9420           0 :     break;
    9421           0 :   }
    9422           0 :   case 4: {
    9423           0 :     break;
    9424           0 :   }
    9425           0 :   }
    9426           0 : }
    9427           0 : static void fd_addrlut_instruction_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
    9428           0 :   fd_addrlut_instruction_t * self = (fd_addrlut_instruction_t *)struct_mem;
    9429           0 :   fd_bincode_uint32_decode_unsafe( &self->discriminant, ctx );
    9430           0 :   fd_addrlut_instruction_inner_decode_inner( &self->inner, alloc_mem, self->discriminant, ctx );
    9431           0 : }
    9432           0 : void * fd_addrlut_instruction_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
    9433           0 :   fd_addrlut_instruction_t * self = (fd_addrlut_instruction_t *)mem;
    9434           0 :   fd_addrlut_instruction_new( self );
    9435           0 :   void * alloc_region = (uchar *)mem + sizeof(fd_addrlut_instruction_t);
    9436           0 :   void * * alloc_mem = &alloc_region;
    9437           0 :   fd_addrlut_instruction_decode_inner( mem, alloc_mem, ctx );
    9438           0 :   return self;
    9439           0 : }
    9440           0 : void fd_addrlut_instruction_inner_new( fd_addrlut_instruction_inner_t * self, uint discriminant ) {
    9441           0 :   switch( discriminant ) {
    9442           0 :   case 0: {
    9443           0 :     fd_addrlut_create_new( &self->create_lut );
    9444           0 :     break;
    9445           0 :   }
    9446           0 :   case 1: {
    9447           0 :     break;
    9448           0 :   }
    9449           0 :   case 2: {
    9450           0 :     fd_addrlut_extend_new( &self->extend_lut );
    9451           0 :     break;
    9452           0 :   }
    9453           0 :   case 3: {
    9454           0 :     break;
    9455           0 :   }
    9456           0 :   case 4: {
    9457           0 :     break;
    9458           0 :   }
    9459           0 :   default: break; // FD_LOG_ERR(( "unhandled type"));
    9460           0 :   }
    9461           0 : }
    9462           0 : void fd_addrlut_instruction_new_disc( fd_addrlut_instruction_t * self, uint discriminant ) {
    9463           0 :   self->discriminant = discriminant;
    9464           0 :   fd_addrlut_instruction_inner_new( &self->inner, self->discriminant );
    9465           0 : }
    9466           0 : void fd_addrlut_instruction_new( fd_addrlut_instruction_t * self ) {
    9467           0 :   fd_memset( self, 0, sizeof(fd_addrlut_instruction_t) );
    9468           0 :   fd_addrlut_instruction_new_disc( self, UINT_MAX );
    9469           0 : }
    9470             : 
    9471           0 : ulong fd_addrlut_instruction_size( fd_addrlut_instruction_t const * self ) {
    9472           0 :   ulong size = 0;
    9473           0 :   size += sizeof(uint);
    9474           0 :   switch (self->discriminant) {
    9475           0 :   case 0: {
    9476           0 :     size += fd_addrlut_create_size( &self->inner.create_lut );
    9477           0 :     break;
    9478           0 :   }
    9479           0 :   case 2: {
    9480           0 :     size += fd_addrlut_extend_size( &self->inner.extend_lut );
    9481           0 :     break;
    9482           0 :   }
    9483           0 :   }
    9484           0 :   return size;
    9485           0 : }
    9486             : 
    9487           0 : int fd_addrlut_instruction_inner_encode( fd_addrlut_instruction_inner_t const * self, uint discriminant, fd_bincode_encode_ctx_t * ctx ) {
    9488           0 :   int err;
    9489           0 :   switch (discriminant) {
    9490           0 :   case 0: {
    9491           0 :     err = fd_addrlut_create_encode( &self->create_lut, ctx );
    9492           0 :     if( FD_UNLIKELY( err ) ) return err;
    9493           0 :     break;
    9494           0 :   }
    9495           0 :   case 2: {
    9496           0 :     err = fd_addrlut_extend_encode( &self->extend_lut, ctx );
    9497           0 :     if( FD_UNLIKELY( err ) ) return err;
    9498           0 :     break;
    9499           0 :   }
    9500           0 :   }
    9501           0 :   return FD_BINCODE_SUCCESS;
    9502           0 : }
    9503           0 : int fd_addrlut_instruction_encode( fd_addrlut_instruction_t const * self, fd_bincode_encode_ctx_t * ctx ) {
    9504           0 :   int err = fd_bincode_uint32_encode( self->discriminant, ctx );
    9505           0 :   if( FD_UNLIKELY( err ) ) return err;
    9506           0 :   return fd_addrlut_instruction_inner_encode( &self->inner, self->discriminant, ctx );
    9507           0 : }
    9508             : 
    9509             : #include "fd_types_custom.c"

Generated by: LCOV version 1.14