|
73 | 73 | be replayed. The new Dispatcher will change this by taking a FEC
|
74 | 74 | set as input instead. */
|
75 | 75 |
|
| 76 | +typedef struct { |
| 77 | + ulong slot; |
| 78 | + fd_hash_t block_id; /* we in fact need to store multiple block ids, but can mempool later i guess */ |
| 79 | +} bid_t; |
| 80 | + |
| 81 | +#define MAP_NAME fd_bid_map |
| 82 | +#define MAP_T bid_t |
| 83 | +#define MAP_KEY slot |
| 84 | +#define MAP_MEMOIZE 0 |
| 85 | +#include "../../util/tmpl/fd_map_dynamic.c" |
| 86 | + |
76 | 87 | /* An estimate of the max number of transactions in a block. If there are more
|
77 | 88 | transactions, they must be split into multiple sets. */
|
78 | 89 | #define MAX_TXNS_PER_REPLAY ( ( FD_SHRED_BLK_MAX * FD_SHRED_MAX_SZ) / FD_TXN_MIN_SERIALIZED_SZ )
|
@@ -1820,10 +1831,10 @@ unprivileged_init( fd_topo_t * topo,
|
1820 | 1831 | for( ulong i = 0UL; i<FD_PACK_MAX_BANK_TILES; i++ ) {
|
1821 | 1832 | ctx->bmtree[i] = FD_SCRATCH_ALLOC_APPEND( l, FD_BMTREE_COMMIT_ALIGN, FD_BMTREE_COMMIT_FOOTPRINT(0) );
|
1822 | 1833 | }
|
1823 |
| - void * slice_buf = FD_SCRATCH_ALLOC_APPEND( l, 128UL, FD_SLICE_MAX ); |
1824 |
| - void * block_id_map_mem = FD_SCRATCH_ALLOC_APPEND( l, block_id_map_align(), block_id_map_footprint( fd_ulong_find_msb( fd_ulong_pow2_up( FD_BLOCK_MAX ) ) ) ); |
1825 |
| - void * exec_slice_map_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_exec_slice_map_align(), fd_exec_slice_map_footprint( 20 ) ); |
1826 |
| - ulong scratch_alloc_mem = FD_SCRATCH_ALLOC_FINI ( l, scratch_align() ); |
| 1834 | + void * slice_buf = FD_SCRATCH_ALLOC_APPEND( l, 128UL, FD_SLICE_MAX ); |
| 1835 | + void * block_id_map_mem = FD_SCRATCH_ALLOC_APPEND( l, block_id_map_align(), block_id_map_footprint( fd_ulong_find_msb( fd_ulong_pow2_up( FD_BLOCK_MAX ) ) ) ); |
| 1836 | + void * exec_slice_map_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_exec_slice_map_align(), fd_exec_slice_map_footprint( 20 ) ); |
| 1837 | + ulong scratch_alloc_mem = FD_SCRATCH_ALLOC_FINI ( l, scratch_align() ); |
1827 | 1838 |
|
1828 | 1839 | if( FD_UNLIKELY( scratch_alloc_mem != ( (ulong)scratch + scratch_footprint( tile ) ) ) ) {
|
1829 | 1840 | FD_LOG_ERR( ( "scratch_alloc_mem did not match scratch_footprint diff: %lu alloc: %lu footprint: %lu",
|
@@ -1999,6 +2010,8 @@ unprivileged_init( fd_topo_t * topo,
|
1999 | 2010 |
|
2000 | 2011 | ctx->forks = fd_forks_join( fd_forks_new( forks_mem, FD_BLOCK_MAX, 42UL ) );
|
2001 | 2012 |
|
| 2013 | + ctx->bid_map = fd_bid_map_join( fd_bid_map_new( bid_map_mem, 16 ) ); |
| 2014 | + |
2002 | 2015 | /**********************************************************************/
|
2003 | 2016 | /* bank_hash_cmp */
|
2004 | 2017 | /**********************************************************************/
|
|
0 commit comments