diff --git a/client/ts/src/constants.ts b/client/ts/src/constants.ts index e7d972d94..48c109ee3 100644 --- a/client/ts/src/constants.ts +++ b/client/ts/src/constants.ts @@ -1,3 +1,3 @@ -export const FIXED_MANIFEST_HEADER_SIZE: number = 512; +export const FIXED_MANIFEST_HEADER_SIZE: number = 256; export const FIXED_WRAPPER_HEADER_SIZE: number = 64; export const NIL = 4_294_967_295; diff --git a/client/ts/src/market.ts b/client/ts/src/market.ts index 0a35bedb5..8e7af93fa 100644 --- a/client/ts/src/market.ts +++ b/client/ts/src/market.ts @@ -349,8 +349,7 @@ export class Market { offset += 4; // _padding2: [u32; 3], - // _padding3: [u64; 32], - // _padding4: [u64; 8], + // _padding3: [u64; 8], const bids: RestingOrder[] = bidsRootIndex != NIL diff --git a/programs/manifest/src/state/constants.rs b/programs/manifest/src/state/constants.rs index 8cafc7b20..d73d8a8a3 100644 --- a/programs/manifest/src/state/constants.rs +++ b/programs/manifest/src/state/constants.rs @@ -1,6 +1,6 @@ use hypertree::RBTREE_OVERHEAD_BYTES; -pub const MARKET_FIXED_SIZE: usize = 512; +pub const MARKET_FIXED_SIZE: usize = 256; pub const GLOBAL_FIXED_SIZE: usize = 88; // Red black tree overhead is 16 bytes. If each block is 80 bytes, then we get diff --git a/programs/manifest/src/state/market.rs b/programs/manifest/src/state/market.rs index 742ba68ba..3e8eb24a5 100644 --- a/programs/manifest/src/state/market.rs +++ b/programs/manifest/src/state/market.rs @@ -107,9 +107,11 @@ pub struct MarketFixed { /// LinkedList representing all free blocks that could be used for ClaimedSeats or RestingOrders free_list_head_index: DataIndex, + // Unused padding. Saved in case a later version wants to be backwards + // compatible. Also, it is nice to have the fixed size be a round number, + // 256 bytes. _padding2: [u32; 3], - _padding3: [u64; 32], - _padding4: [u64; 8], + _padding3: [u64; 8], } const_assert_eq!( size_of::(), @@ -134,7 +136,6 @@ const_assert_eq!( 4 + // claimed_seats_best_index 4 + // free_list_head_index 8 + // padding2 - 256 + // padding3 64 // padding4 ); const_assert_eq!(size_of::(), MARKET_FIXED_SIZE); @@ -169,8 +170,7 @@ impl MarketFixed { claimed_seats_root_index: NIL, free_list_head_index: NIL, _padding2: [0; 3], - _padding3: [0; 32], - _padding4: [0; 8], + _padding3: [0; 8], } }