Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
WIP: Reconnect native_blockifier with blockifier and bump papyrus_sto…
Browse files Browse the repository at this point in the history
…rage

TODO: there are some new storage config options we need to understand
in order to know how to initialize papyrus_storage.
  • Loading branch information
Gilad Chase committed Nov 7, 2023
1 parent 64e517e commit 2dcfb8c
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 79 deletions.
161 changes: 87 additions & 74 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions crates/native_blockifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ name = "native_blockifier"
crate-type = ["cdylib"]

[dependencies]
blockifier = { version = "0.4.0-rc2", features = ["testing"] }
blockifier = { path = "../blockifier", version = "0.4.0-rc4", features = [
"testing",
] }
cairo-lang-starknet.workspace = true
cairo-vm.workspace = true
indexmap.workspace = true
log.workspace = true
num-bigint.workspace = true
papyrus_storage = { version = "0.0.5", features = ["testing"] }
papyrus_storage = { version = "0.2.0-rc1", features = ["testing"] }
pyo3 = { version = "0.19.1", features = ["num-bigint", "hashbrown"] }
pyo3-log = "0.8.1"
serde_json = { workspace = true, features = ["arbitrary_precision"] }
starknet_api = { version = "0.5.0-rc1", features = ["testing"] }
starknet_api = { workspace = "true", features = ["testing"] }

thiserror.workspace = true

Expand Down
11 changes: 9 additions & 2 deletions crates/native_blockifier/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ impl Storage {
max_size: config.max_size,
growth_step: 1 << 26, // 64MB.
};
let (reader, writer) = papyrus_storage::open_storage(db_config)?;
let storage_config = papyrus_storage::StorageConfig {
db_config,
scope: papyrus_storage::StorageScope::FullArchive, // stores state diffs.
// BLOCKING TODO(Gilad): Figure out what this does.
mmap_file_config: papyrus_storage::mmap_file::MmapFileConfig::default(),
};
let (reader, writer) = papyrus_storage::open_storage(storage_config)?;
log::debug!("Initialized Blockifier storage.");

Ok(Storage { reader: Some(reader), writer: Some(writer) })
Expand Down Expand Up @@ -202,7 +208,8 @@ impl Storage {
max_size: 1 << 35, // 32GB
growth_step: 1 << 26, // 64MB
};
let (reader, writer) = papyrus_storage::open_storage(db_config).unwrap();
let storage_config = papyrus_storage::StorageConfig { db_config, ..Default::default() };
let (reader, writer) = papyrus_storage::open_storage(storage_config).unwrap();

Storage { reader: Some(reader), writer: Some(writer) }
}
Expand Down

0 comments on commit 2dcfb8c

Please sign in to comment.