Skip to content

Commit 300b76d

Browse files
patches
1 parent f4931f9 commit 300b76d

File tree

4 files changed

+20
-22
lines changed

4 files changed

+20
-22
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,11 @@ keystore-rs = "0.1.0"
6565
toml = "0.8.14"
6666
dirs = "5.0.1"
6767
anyhow = "1.0.44"
68-
jmt = { path = "../jmt", features = [
69-
"mocks",
70-
] } #{ version = "0.10.0", features = ["mocks"] }
68+
jmt = { version = "0.10.0", features = ["mocks"] }
7169
bellpepper-core = { version = "0.4.0", default-features = false }
7270
bellpepper = "0.4.1"
73-
arecibo = { git = "https://github.com/deltadevsde/arecibo" }
74-
itertools = "0.13.0" # zip_eq
71+
itertools = "0.13.0" # zip_eq
72+
arecibo = "0.2.0"
7573
sha2 = "0.10.8"
7674
auto_impl = "1.2.0"
7775
bincode = "1.3.3"
@@ -86,6 +84,10 @@ sp1-helper = "1.2.0"
8684

8785
[patch.crates-io]
8886
sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", branch = "patch-sha2-v0.10.8" }
87+
arecibo = { git = "https://github.com/deltadevsde/arecibo" }
88+
jmt = { git = "https://github.com/deltadevsde/jmt", branch = "rehashing-circuit", features = [
89+
"mocks",
90+
] }
8991

9092
# [workspace.dev-dependencies]
9193
# serial_test = "3.1.1"

crates/prism/src/node_types/sequencer.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ impl Sequencer {
374374
let proof =
375375
tree.update(KeyHash::with::<Hasher>(hashed_id), current_chain.clone())?;
376376
self.db
377-
.update_hashchain(operation, &current_chain)
377+
.set_hashchain(operation, &current_chain)
378378
.context(format!(
379379
"Failed to update hashchain for operation {:?}",
380380
operation
@@ -408,12 +408,10 @@ impl Sequencer {
408408
let mut chain = Hashchain::new(id.clone());
409409
chain.create_account(value.into(), source.clone())?;
410410

411-
self.db
412-
.update_hashchain(operation, &chain)
413-
.context(format!(
414-
"Failed to create hashchain for operation {:?}",
415-
operation
416-
))?;
411+
self.db.set_hashchain(operation, &chain).context(format!(
412+
"Failed to create hashchain for operation {:?}",
413+
operation
414+
))?;
417415

418416
let mut tree = self.tree.lock().await;
419417
let hashed_id = hash(id.as_bytes());

crates/prism/src/storage.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{anyhow, Context, Result};
1+
use anyhow::{anyhow, Result};
22
use auto_impl::auto_impl;
33
use jmt::{
44
storage::{LeafNode, Node, NodeBatch, NodeKey, TreeReader, TreeWriter},
@@ -32,11 +32,8 @@ pub struct RedisConnection {
3232
#[auto_impl(&, Box, Arc)]
3333
pub trait Database: Send + Sync + TreeReader + TreeWriter {
3434
fn get_hashchain(&self, key: &str) -> Result<Hashchain>;
35-
fn update_hashchain(
36-
&self,
37-
incoming_operation: &Operation,
38-
value: &[HashchainEntry],
39-
) -> Result<()>;
35+
fn set_hashchain(&self, incoming_operation: &Operation, value: &[HashchainEntry])
36+
-> Result<()>;
4037

4138
fn get_commitment(&self, epoch: &u64) -> Result<String>;
4239
fn set_commitment(&self, epoch: &u64, commitment: &Digest) -> Result<()>;
@@ -220,7 +217,7 @@ impl Database for RedisConnection {
220217
.map_err(|_| anyhow!(DatabaseError::WriteError(format!("epoch: {}", epoch))))
221218
}
222219

223-
fn update_hashchain(
220+
fn set_hashchain(
224221
&self,
225222
incoming_operation: &Operation,
226223
value: &[HashchainEntry],
@@ -313,7 +310,7 @@ mod tests {
313310
let chain_entry = create_mock_chain_entry();
314311

315312
redis_connections
316-
.update_hashchain(&incoming_operation, &[chain_entry.clone()])
313+
.set_hashchain(&incoming_operation, &[chain_entry.clone()])
317314
.unwrap();
318315

319316
let hashchain = redis_connections
@@ -338,7 +335,7 @@ mod tests {
338335
let chain_entry = create_mock_chain_entry();
339336

340337
redis_connections
341-
.update_hashchain(&incoming_operation, &[chain_entry.clone()])
338+
.set_hashchain(&incoming_operation, &[chain_entry.clone()])
342339
.unwrap();
343340

344341
let hashchain = redis_connections.get_hashchain("main:missing_test_key");
@@ -406,7 +403,7 @@ mod tests {
406403

407404
let chain_entries: Vec<HashchainEntry> = vec![create_mock_chain_entry()];
408405

409-
match redis_connections.update_hashchain(&incoming_operation, &chain_entries) {
406+
match redis_connections.set_hashchain(&incoming_operation, &chain_entries) {
410407
Ok(_) => (),
411408
Err(e) => panic!("Failed to update hashchain: {}", e),
412409
}

0 commit comments

Comments
 (0)