Skip to content

Commit

Permalink
Cut rent in half for market fixed (#18)
Browse files Browse the repository at this point in the history
* cut rent in half for market fixed

* fmt

* comment
  • Loading branch information
brittcyr authored Aug 26, 2024
1 parent d2cb57a commit 06432ad
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/ts/src/constants.ts
Original file line number Diff line number Diff line change
@@ -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;
3 changes: 1 addition & 2 deletions client/ts/src/market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion programs/manifest/src/state/constants.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions programs/manifest/src/state/market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<MarketFixed>(),
Expand All @@ -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::<MarketFixed>(), MARKET_FIXED_SIZE);
Expand Down Expand Up @@ -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],
}
}

Expand Down

0 comments on commit 06432ad

Please sign in to comment.