Skip to content

Commit

Permalink
chore: bump miden-base versions (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
igamigo authored Feb 14, 2025
1 parent ebef215 commit 26cf6be
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ version = "0.8.0"
assert_matches = { version = "1.5" }
itertools = { version = "0.14" }
miden-air = { version = "0.12" }
miden-lib = { git = "https://github.com/0xPolygonMiden/miden-base.git", rev = "e82dee03de7589ef3fb12b7fd901cef25ae5535d" }
miden-lib = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next" }
miden-node-block-producer = { path = "crates/block-producer", version = "0.8" }
miden-node-proto = { path = "crates/proto", version = "0.8" }
miden-node-rpc = { path = "crates/rpc", version = "0.8" }
miden-node-store = { path = "crates/store", version = "0.8" }
miden-node-test-macro = { path = "crates/test-macro" }
miden-node-utils = { path = "crates/utils", version = "0.8" }
miden-objects = { git = "https://github.com/0xPolygonMiden/miden-base.git", rev = "e82dee03de7589ef3fb12b7fd901cef25ae5535d" }
miden-objects = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next" }
miden-processor = { version = "0.12" }
miden-stdlib = { version = "0.12", default-features = false }
miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base.git", rev = "e82dee03de7589ef3fb12b7fd901cef25ae5535d" }
miden-tx-batch-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", rev = "e82dee03de7589ef3fb12b7fd901cef25ae5535d" }
miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next" }
miden-tx-batch-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next" }
prost = { version = "0.13" }
rand = { version = "0.8" }
thiserror = { version = "2.0", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions crates/block-producer/src/test_utils/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use miden_objects::{
batch::{BatchAccountUpdate, BatchId, BatchNoteTree, ProvenBatch},
block::BlockNumber,
transaction::{InputNotes, ProvenTransaction},
Digest,
};

use crate::test_utils::MockProvenTxBuilder;
Expand Down Expand Up @@ -57,6 +58,8 @@ impl TransactionBatchConstructor for ProvenBatch {

ProvenBatch::new(
BatchId::from_transactions(txs.into_iter()),
Digest::default(),
BlockNumber::GENESIS,
account_updates,
InputNotes::new_unchecked(input_notes),
BatchNoteTree::with_contiguous_leaves(
Expand Down
2 changes: 1 addition & 1 deletion crates/block-producer/src/test_utils/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl MockBlockBuilder {
pub fn account_updates(mut self, updated_accounts: Vec<BlockAccountUpdate>) -> Self {
for update in &updated_accounts {
self.store_accounts
.insert(update.account_id().into(), update.new_state_hash().into());
.insert(update.account_id().into(), update.final_state_commitment().into());
}

self.updated_accounts = Some(updated_accounts);
Expand Down
3 changes: 2 additions & 1 deletion crates/block-producer/src/test_utils/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ impl MockStoreSuccess {

// update accounts
for update in block.updated_accounts() {
locked_accounts.insert(update.account_id().into(), update.new_state_hash().into());
locked_accounts
.insert(update.account_id().into(), update.final_state_commitment().into());
}
let header = block.header();
debug_assert_eq!(locked_accounts.root(), header.account_root());
Expand Down
14 changes: 9 additions & 5 deletions crates/store/src/db/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ pub fn upsert_accounts(
AccountUpdateDetails::New(account) => {
debug_assert_eq!(account_id, account.id());

if account.hash() != update.new_state_hash() {
if account.hash() != update.final_state_commitment() {
return Err(DatabaseError::AccountHashesMismatch {
calculated: account.hash(),
expected: update.new_state_hash(),
expected: update.final_state_commitment(),
});
}

Expand All @@ -439,16 +439,20 @@ pub fn upsert_accounts(
return Err(DatabaseError::AccountNotFoundInDb(account_id));
};

let account =
apply_delta(account_id, &row.get_ref(0)?, delta, &update.new_state_hash())?;
let account = apply_delta(
account_id,
&row.get_ref(0)?,
delta,
&update.final_state_commitment(),
)?;

(Some(Cow::Owned(account)), Some(Cow::Borrowed(delta)))
},
};

let inserted = upsert_stmt.execute(params![
account_id.to_bytes(),
update.new_state_hash().to_bytes(),
update.final_state_commitment().to_bytes(),
block_num.as_u32(),
full_account.as_ref().map(|account| account.to_bytes()),
])?;
Expand Down
2 changes: 1 addition & 1 deletion crates/store/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl GenesisState {

let account_smt: SimpleSmt<ACCOUNT_TREE_DEPTH> =
SimpleSmt::with_leaves(accounts.iter().map(|update| {
(update.account_id().prefix().into(), update.new_state_hash().into())
(update.account_id().prefix().into(), update.final_state_commitment().into())
}))?;

let header = BlockHeader::new(
Expand Down
2 changes: 1 addition & 1 deletion crates/store/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl State {
block.updated_accounts().iter().map(|update| {
(
LeafIndex::new_max_depth(update.account_id().prefix().into()),
update.new_state_hash().into(),
update.final_state_commitment().into(),
)
}),
);
Expand Down

0 comments on commit 26cf6be

Please sign in to comment.