Skip to content

Commit

Permalink
piecrust: increase max memory size to 4TiB
Browse files Browse the repository at this point in the history
Resolves #159
  • Loading branch information
Eduardo Leegwater Simões committed Oct 24, 2023
1 parent 4bdb216 commit a022c46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion piecrust/src/store/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crumbles::{LocateFile, Mmap};
use dusk_wasmtime::LinearMemory;

pub const PAGE_SIZE: usize = 0x10000;
const WASM_MAX_PAGES: u32 = 0x10000;
const WASM_MAX_PAGES: u32 = 0x4000000;

const MIN_PAGES: usize = 4;
const MIN_MEM_SIZE: usize = MIN_PAGES * PAGE_SIZE;
Expand Down
6 changes: 3 additions & 3 deletions piecrust/src/store/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use rkyv::{Archive, Deserialize, Serialize};

use crate::store::memory::Memory;

// There are `2^16` pages in a memory
const P_HEIGHT: usize = 16;
const P_ARITY: usize = 2;
// There are max `2^26` pages in a memory
const P_HEIGHT: usize = 13;
const P_ARITY: usize = 4;

pub type PageTree = dusk_merkle::Tree<Hash, P_HEIGHT, P_ARITY>;

Expand Down

0 comments on commit a022c46

Please sign in to comment.