Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove archive stable memory limit #2600

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/archive/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ use ic_stable_structures::memory_manager::{MemoryId, MemoryManager, VirtualMemor
use ic_stable_structures::storable::Bound;
use ic_stable_structures::{
cell::Cell as StableCell, log::Log, DefaultMemoryImpl, Memory as StableMemory,
RestrictedMemory, StableBTreeMap, Storable,
RestrictedMemory, StableBTreeMap, Storable, MAX_PAGES,
};
use internet_identity_interface::archive::types::*;
use internet_identity_interface::http_gateway::{HttpRequest, HttpResponse};
Expand All @@ -71,12 +71,6 @@ type ConfigCell = StableCell<ConfigState, Memory>;
type LogIndex = u64;
type AnchorIndex = StableBTreeMap<AnchorIndexKey, (), VirtualMemory<Memory>>;

const GIB: u64 = 1 << 30;
const WASM_PAGE_SIZE: u64 = 65536;
const MAX_STABLE_MEMORY_SIZE: u64 = 32 * GIB;
/// The maximum number of Wasm pages that we allow to use for the stable storage.
const MAX_WASM_PAGES: u64 = MAX_STABLE_MEMORY_SIZE / WASM_PAGE_SIZE;

/// Memory ids of memory managed by the memory manager.
const LOG_INDEX_MEMORY_ID: MemoryId = MemoryId::new(0);
const LOG_DATA_MEMORY_ID: MemoryId = MemoryId::new(1);
Expand Down Expand Up @@ -111,7 +105,7 @@ fn config_memory() -> Memory {

/// All the memory after the initial config page is managed by the [MemoryManager].
fn managed_memory() -> Memory {
RestrictedMemory::new(DefaultMemoryImpl::default(), 1..MAX_WASM_PAGES)
RestrictedMemory::new(DefaultMemoryImpl::default(), 1..MAX_PAGES)
}

/// A helper function to access the configuration.
Expand Down