@@ -95,7 +95,6 @@ typedef struct {
95
95
96
96
ulong * published_wmark ; /* same as the one in replay tile */
97
97
fd_alloc_t * alloc ;
98
- fd_valloc_t valloc ;
99
98
long replay_time ;
100
99
ulong slot_cnt ;
101
100
@@ -138,8 +137,8 @@ static fd_shred_t const *
138
137
rocksdb_get_shred ( ctx_t * ctx ,
139
138
ulong * out_sz ) {
140
139
if ( ctx -> rocksdb_curr_idx == ctx -> rocksdb_end_idx ) {
141
- if ( FD_UNLIKELY ( fd_rocksdb_root_iter_next ( & ctx -> rocksdb_root_iter , & ctx -> rocksdb_slot_meta , ctx -> valloc ) ) ) return NULL ;
142
- if ( FD_UNLIKELY ( fd_rocksdb_get_meta ( & ctx -> rocksdb , ctx -> rocksdb_slot_meta .slot , & ctx -> rocksdb_slot_meta , ctx -> valloc ) ) ) return NULL ;
140
+ if ( FD_UNLIKELY ( fd_rocksdb_root_iter_next ( & ctx -> rocksdb_root_iter , & ctx -> rocksdb_slot_meta ) ) ) return NULL ;
141
+ if ( FD_UNLIKELY ( fd_rocksdb_get_meta ( & ctx -> rocksdb , ctx -> rocksdb_slot_meta .slot , & ctx -> rocksdb_slot_meta ) ) ) return NULL ;
143
142
ctx -> rocksdb_curr_idx = 0 ;
144
143
ctx -> rocksdb_end_idx = ctx -> rocksdb_slot_meta .received ;
145
144
}
@@ -230,19 +229,13 @@ unprivileged_init( fd_topo_t * topo,
230
229
if ( FD_UNLIKELY ( !ctx -> alloc ) ) {
231
230
FD_LOG_ERR ( ( "fd_alloc_join failed" ) );
232
231
}
233
- ctx -> valloc = fd_alloc_virtual ( ctx -> alloc );
234
232
235
233
/* Tower */
236
234
ctx -> tower = fd_tower_join ( fd_tower_new ( tower_mem ) );
237
235
if ( FD_UNLIKELY ( !ctx -> tower ) ) {
238
236
FD_LOG_ERR ( ( "fd_tower_join failed" ) );
239
237
}
240
238
241
- ctx -> rocksdb_bank_hash = fd_valloc_malloc ( ctx -> valloc , fd_frozen_hash_versioned_align (), sizeof (fd_frozen_hash_versioned_t ) );
242
- if ( FD_UNLIKELY ( NULL == ctx -> rocksdb_bank_hash ) ) {
243
- FD_LOG_ERR (( "Failed at allocating memory for rocksdb bank hash" ));
244
- }
245
-
246
239
fd_topo_link_t * replay_in_link = & topo -> links [ tile -> in_link_id [ REPLAY_IN_IDX ] ];
247
240
ctx -> replay_in_mem = topo -> workspaces [ topo -> objs [ replay_in_link -> dcache_obj_id ].wksp_id ].wksp ;
248
241
ctx -> replay_in_chunk0 = fd_dcache_compact_chunk0 ( ctx -> replay_in_mem , replay_in_link -> dcache );
@@ -356,7 +349,7 @@ after_credit_rocksdb( ctx_t * ctx,
356
349
ctx -> playback_started = 1 ;
357
350
358
351
fd_rocksdb_root_iter_new ( & ctx -> rocksdb_root_iter );
359
- if ( FD_UNLIKELY ( fd_rocksdb_root_iter_seek ( & ctx -> rocksdb_root_iter , & ctx -> rocksdb , wmark , & ctx -> rocksdb_slot_meta , ctx -> valloc ) ) ) {
352
+ if ( FD_UNLIKELY ( fd_rocksdb_root_iter_seek ( & ctx -> rocksdb_root_iter , & ctx -> rocksdb , wmark , & ctx -> rocksdb_slot_meta ) ) ) {
360
353
FD_LOG_CRIT (( "Failed at seeking rocksdb root iter for slot=%lu" , wmark ));
361
354
}
362
355
ctx -> rocksdb_iter = rocksdb_create_iterator_cf (ctx -> rocksdb .db , ctx -> rocksdb .ro , ctx -> rocksdb .cf_handles [FD_ROCKSDB_CFIDX_DATA_SHRED ]);
@@ -545,7 +538,7 @@ after_credit( ctx_t * ctx,
545
538
switch ( ctx -> ingest_mode ) {
546
539
case FD_BACKTEST_ROCKSDB_INGEST :
547
540
fd_rocksdb_root_iter_new ( & ctx -> rocksdb_root_iter );
548
- if ( FD_UNLIKELY ( fd_rocksdb_root_iter_seek ( & ctx -> rocksdb_root_iter , & ctx -> rocksdb , wmark , & ctx -> rocksdb_slot_meta , ctx -> valloc ) ) ) {
541
+ if ( FD_UNLIKELY ( fd_rocksdb_root_iter_seek ( & ctx -> rocksdb_root_iter , & ctx -> rocksdb , wmark , & ctx -> rocksdb_slot_meta ) ) ) {
549
542
FD_LOG_CRIT (( "Failed at seeking rocksdb root iter for slot=%lu" , wmark ));
550
543
}
551
544
ctx -> rocksdb_iter = rocksdb_create_iterator_cf (ctx -> rocksdb .db , ctx -> rocksdb .ro , ctx -> rocksdb .cf_handles [FD_ROCKSDB_CFIDX_DATA_SHRED ]);
@@ -589,16 +582,9 @@ rocksdb_bank_hash_check( ctx_t * ctx, ulong slot, fd_hash_t * bank_hash ) {
589
582
if ( FD_UNLIKELY ( err || vallen == 0 ) ) {
590
583
FD_LOG_ERR (( "Failed at reading bank hash for slot%lu from rocksdb" , slot ));
591
584
}
592
- fd_bincode_decode_ctx_t decode = {
593
- .data = res ,
594
- .dataend = res + vallen
595
- };
596
- ulong total_sz = 0UL ;
597
- int decode_err = fd_frozen_hash_versioned_decode_footprint ( & decode , & total_sz );
598
585
599
- fd_frozen_hash_versioned_t * versioned = fd_frozen_hash_versioned_decode ( ctx -> rocksdb_bank_hash , & decode );
600
- if ( FD_UNLIKELY ( decode_err != FD_BINCODE_SUCCESS ) ||
601
- FD_UNLIKELY ( decode .data != decode .dataend ) ||
586
+ fd_frozen_hash_versioned_t versioned [1 ];
587
+ if ( FD_UNLIKELY ( !fd_bincode_decode_static ( frozen_hash_versioned , versioned , res , vallen , NULL ) ) ||
602
588
FD_UNLIKELY ( versioned -> discriminant != fd_frozen_hash_versioned_enum_current ) ) {
603
589
FD_LOG_ERR (( "Failed at decoding bank hash from rocksdb" ));
604
590
}
0 commit comments