Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
4ff0970
for account queries, now return partials too
drahnr Dec 1, 2025
5ee1043
drop all tables as part of migration
drahnr Dec 1, 2025
8eca359
externalize storage and vault blobs to separate tables
drahnr Dec 1, 2025
e7f17ed
trailing .
drahnr Dec 1, 2025
c8b43ab
smt forest
drahnr Dec 1, 2025
19164be
changset, should go away after rebase
drahnr Dec 1, 2025
8eb49af
improve
drahnr Dec 1, 2025
6725461
TODO and deprecation
drahnr Dec 1, 2025
ee65a88
account queries
drahnr Dec 1, 2025
741df6f
yes
drahnr Dec 2, 2025
6a64077
why
drahnr Dec 2, 2025
9d5806e
y
drahnr Dec 2, 2025
2964a93
y
drahnr Dec 2, 2025
9416a63
review comments
drahnr Dec 2, 2025
ccc2d63
sanitize comments
drahnr Dec 2, 2025
66ea831
remove
drahnr Dec 4, 2025
1c4f8b1
cleanup
drahnr Dec 4, 2025
80e0393
fix queries with _at suffix
drahnr Dec 4, 2025
e7bf1aa
cleanup
drahnr Dec 4, 2025
dad90e7
simplify
drahnr Dec 4, 2025
e441245
fix
drahnr Dec 4, 2025
0a319d1
cleanup
drahnr Dec 4, 2025
8897939
remove dead code
drahnr Dec 4, 2025
7d7fefc
add test
drahnr Dec 5, 2025
0f53fa9
add block exists helper
drahnr Dec 5, 2025
7400134
Merge remote-tracking branch 'origin' into bernhard-integrate-smtforest
drahnr Dec 9, 2025
0e2d871
simplify
drahnr Dec 9, 2025
f78103e
better docs
drahnr Dec 9, 2025
ea05b01
split long function in State
drahnr Dec 9, 2025
3cd457a
better
drahnr Dec 9, 2025
c8f0eb1
clippy et al
drahnr Dec 9, 2025
ed7224e
review
drahnr Dec 10, 2025
6336f41
address review comments
drahnr Dec 10, 2025
a1173f7
Revert "address review comments"
drahnr Dec 11, 2025
36470a5
improve
drahnr Dec 11, 2025
928fdb4
yes
drahnr Dec 18, 2025
5de3936
tuple ticks
drahnr Dec 18, 2025
f5b4898
Merge remote-tracking branch 'origin' into bernhard-integrate-smtforest
drahnr Dec 18, 2025
ca5ef9a
docs
drahnr Dec 18, 2025
17fd95b
from_iter
drahnr Dec 18, 2025
22f3ca9
simplify
drahnr Dec 18, 2025
3ee1884
docs
drahnr Dec 18, 2025
eaf7242
undo
drahnr Dec 18, 2025
72126e1
one more enum
drahnr Dec 18, 2025
be9071b
docs
drahnr Dec 18, 2025
a0f8fc9
unneces
drahnr Dec 18, 2025
88c058b
simplify
drahnr Dec 18, 2025
b84f25f
misleading
drahnr Dec 18, 2025
25b5550
bound
drahnr Dec 18, 2025
31dacdd
fmt
drahnr Dec 18, 2025
55f4a46
changelog
drahnr Dec 18, 2025
bf67ce8
0 ->1; 1->0
drahnr Dec 19, 2025
0c0e32b
avoid full paths
drahnr Dec 19, 2025
ec4318e
fn
drahnr Dec 19, 2025
4bfee30
refactor, simplify
drahnr Dec 19, 2025
b8d2e66
yuk
drahnr Dec 19, 2025
e453faa
remoe useless comment
drahnr Dec 19, 2025
f6d1ce1
shorthandg pu
drahnr Dec 19, 2025
b1f9cf6
delete unused
drahnr Dec 19, 2025
d2d9e8c
review
drahnr Dec 20, 2025
2781db8
simplify
drahnr Dec 22, 2025
b0e537c
Merge remote-tracking branch 'origin' into bernhard-integrate-smtforest
drahnr Dec 22, 2025
d6b31ef
minor
drahnr Dec 22, 2025
9c859fc
fmt
drahnr Dec 23, 2025
b016495
Merge branch 'next' into bernhard-integrate-smtforest
bobbinth Dec 27, 2025
579b9dc
chore: fix merge conflicts
bobbinth Dec 27, 2025
3336edb
chore: fix test
bobbinth Dec 27, 2025
2aa8c8b
chore: minor formatting changes
bobbinth Dec 27, 2025
354d586
chore: move InnerForest module
bobbinth Dec 27, 2025
a96def0
chore: refactor SMT forest initialization
bobbinth Dec 27, 2025
e8cdad1
chore: re-organize account queries
bobbinth Dec 27, 2025
3009bf7
nope
drahnr Dec 29, 2025
3110962
fix inconsistency
drahnr Dec 29, 2025
53cb5e8
faster
drahnr Dec 29, 2025
0cc0c61
undue changes
drahnr Dec 29, 2025
ac7b8f9
move fn to innerforest
drahnr Dec 29, 2025
369db2f
y
drahnr Dec 29, 2025
6cd1033
another
drahnr Dec 29, 2025
7613624
test re-review
drahnr Dec 29, 2025
e04ff10
fuckup
drahnr Dec 29, 2025
9d8c220
update
drahnr Dec 29, 2025
5ed1a4f
sync docs
drahnr Dec 29, 2025
c43a5a2
splits
drahnr Dec 29, 2025
3346d9f
cleanup
drahnr Dec 29, 2025
dbbc1eb
fmt
drahnr Dec 29, 2025
b3c91df
remove dead code
drahnr Dec 29, 2025
77443c2
foo
drahnr Dec 29, 2025
1efa4f0
fixup
drahnr Dec 29, 2025
69ee5a5
change log
drahnr Dec 29, 2025
c5a199a
Merge branch 'bernhard-db-schema-queries' into bernhard-integrate-smt…
drahnr Dec 30, 2025
8d33f66
fix storage_header comment
drahnr Dec 30, 2025
635cb78
select_account_code_at_block -> select_account_code_by_commitment
drahnr Dec 30, 2025
7ca6999
add minor test xtension
drahnr Dec 30, 2025
c712ba4
Merge branch 'bernhard-db-schema-queries' into bernhard-integrate-smt…
drahnr Jan 4, 2026
d9a666f
review
drahnr Jan 6, 2026
29b840c
remove dead code
drahnr Jan 6, 2026
1b22a34
chore: minor rename
bobbinth Jan 7, 2026
1cab5e2
review
drahnr Jan 9, 2026
c42d5f5
some more docs
drahnr Jan 9, 2026
f1655fe
Merge remote-tracking branch 'origin/next' into bernhard-integrate-sm…
drahnr Jan 9, 2026
9fe3979
add InnerForestError type, make asset addition non-panic
drahnr Jan 10, 2026
5a8ea18
clippy
drahnr Jan 10, 2026
38f3763
Merge remote-tracking branch 'origin/next' into bernhard-integrate-sm…
drahnr Jan 10, 2026
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
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@
- Remove `trait AccountTreeStorage` ([#1352](https://github.com/0xMiden/miden-node/issues/1352)).
- [BREAKING] `SubmitProvenTransaction` now **requires** that the network's genesis commitment is set in the request's `ACCEPT` header ([#1298](https://github.com/0xMiden/miden-node/pull/1298), [#1436](https://github.com/0xMiden/miden-node/pull/1436)).
- Add `S` generic to `NullifierTree` to allow usage with `LargeSmt`s ([#1353](https://github.com/0xMiden/miden-node/issues/1353)).
- Removed internal errors from the `miden-network-monitor` ([#1424](https://github.com/0xMiden/miden-node/pull/1424)).
- Track network transactions latency in `miden-network-monitor` ([#1430](https://github.com/0xMiden/miden-node/pull/1430)).
- Refactor account table and introduce tracking forest ([#1394](https://github.com/0xMiden/miden-node/pull/1394)).
- [BREAKING] Re-organized RPC protobuf schema to be independent of internal schema ([#1401](https://github.com/0xMiden/miden-node/pull/1401)).
- Increased the maximum query limit for the store ([#1443](https://github.com/0xMiden/miden-node/pull/1443)).
- Removed internal errors from the `miden-network-monitor` ([#1424](https://github.com/0xMiden/miden-node/pull/1424)).
- [BREAKING] Added block signing capabilities to Validator component and updated gensis bootstrap to sign blocks with configured signer ([#1426](https://github.com/0xMiden/miden-node/pull/1426)).
- Track network transactions latency in `miden-network-monitor` ([#1430](https://github.com/0xMiden/miden-node/pull/1430)).
- Reduced default block interval from `5s` to `2s` ([#1438](https://github.com/0xMiden/miden-node/pull/1438)).
- Increased retained account tree history from 33 to 100 blocks to account for the reduced block interval ([#1438](https://github.com/0xMiden/miden-node/pull/1438)).
- Increased the maximum query limit for the store ([#1443](https://github.com/0xMiden/miden-node/pull/1443)).
- [BREAKING] Migrated to version `v0.20` of the VM ([#1476](https://github.com/0xMiden/miden-node/pull/1476)).
- [BREAKING] Change account in database representation ([#1481](https://github.com/0xMiden/miden-node/pull/1481)).
- Remove the cyclic database optimization ([#1497](https://github.com/0xMiden/miden-node/pull/1497)).
Expand Down
92 changes: 46 additions & 46 deletions crates/proto/src/domain/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,52 @@ impl TryFrom<proto::rpc::account_proof_request::AccountDetailRequest> for Accoun
}
}

impl TryFrom<proto::rpc::account_storage_details::AccountStorageMapDetails>
for AccountStorageMapDetails
{
type Error = ConversionError;

fn try_from(
value: proto::rpc::account_storage_details::AccountStorageMapDetails,
) -> Result<Self, Self::Error> {
use proto::rpc::account_storage_details::account_storage_map_details::map_entries::StorageMapEntry;
let proto::rpc::account_storage_details::AccountStorageMapDetails {
slot_name,
too_many_entries,
entries,
} = value;

let slot_name = StorageSlotName::new(slot_name)?;

let entries = if too_many_entries {
StorageMapEntries::LimitExceeded
} else {
let map_entries = if let Some(entries) = entries {
entries
.entries
.into_iter()
.map(|entry| {
let key = entry
.key
.ok_or(StorageMapEntry::missing_field(stringify!(key)))?
.try_into()?;
let value = entry
.value
.ok_or(StorageMapEntry::missing_field(stringify!(value)))?
.try_into()?;
Ok((key, value))
})
.collect::<Result<Vec<_>, ConversionError>>()?
} else {
Vec::new()
};
StorageMapEntries::Entries(map_entries)
};

Ok(Self { slot_name, entries })
}
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct StorageMapRequest {
pub slot_name: StorageSlotName,
Expand Down Expand Up @@ -544,52 +590,6 @@ const fn storage_slot_type_to_raw(slot_type: StorageSlotType) -> u32 {
}
}

impl TryFrom<proto::rpc::account_storage_details::AccountStorageMapDetails>
for AccountStorageMapDetails
{
type Error = ConversionError;

fn try_from(
value: proto::rpc::account_storage_details::AccountStorageMapDetails,
) -> Result<Self, Self::Error> {
use proto::rpc::account_storage_details::account_storage_map_details::map_entries::StorageMapEntry;
let proto::rpc::account_storage_details::AccountStorageMapDetails {
slot_name,
too_many_entries,
entries,
} = value;

let slot_name = StorageSlotName::new(slot_name)?;

let entries = if too_many_entries {
StorageMapEntries::LimitExceeded
} else {
let map_entries = if let Some(entries) = entries {
entries
.entries
.into_iter()
.map(|entry| {
let key = entry
.key
.ok_or(StorageMapEntry::missing_field(stringify!(key)))?
.try_into()?;
let value = entry
.value
.ok_or(StorageMapEntry::missing_field(stringify!(value)))?
.try_into()?;
Ok((key, value))
})
.collect::<Result<Vec<_>, ConversionError>>()?
} else {
Vec::new()
};
StorageMapEntries::Entries(map_entries)
};

Ok(Self { slot_name, entries })
}
}

// ACCOUNT PROOF RESPONSE
//================================================================================================

Expand Down
2 changes: 1 addition & 1 deletion crates/store/src/accounts/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod account_tree_with_history_tests {
/// Helper function to create an `AccountTree` from entries using the new API
fn create_account_tree(
entries: impl IntoIterator<Item = (AccountId, Word)>,
) -> AccountTree<LargeSmt<MemoryStorage>> {
) -> InMemoryAccountTree {
let smt_entries = entries
.into_iter()
.map(|(id, commitment)| (account_id_to_smt_key(id), commitment));
Expand Down
6 changes: 2 additions & 4 deletions crates/store/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ impl TransactionRecord {
self,
note_records: Vec<NoteRecord>,
) -> proto::rpc::TransactionRecord {
let output_notes: Vec<proto::note::NoteSyncRecord> =
note_records.into_iter().map(Into::into).collect();
let output_notes = Vec::from_iter(note_records.into_iter().map(Into::into));

proto::rpc::TransactionRecord {
header: Some(proto::transaction::TransactionHeader {
Expand Down Expand Up @@ -324,7 +323,7 @@ impl Db {

/// Loads all the nullifiers from the DB.
#[instrument(level = "debug", target = COMPONENT, skip_all, ret(level = "debug"), err)]
pub async fn select_all_nullifiers(&self) -> Result<Vec<NullifierInfo>> {
pub(crate) async fn select_all_nullifiers(&self) -> Result<Vec<NullifierInfo>> {
self.transact("all nullifiers", move |conn| {
let nullifiers = queries::select_all_nullifiers(conn)?;
Ok(nullifiers)
Expand Down Expand Up @@ -403,7 +402,6 @@ impl Db {
}

/// Returns all account IDs that have public state.
#[allow(dead_code)] // Will be used by InnerForest in next PR
#[instrument(level = "debug", target = COMPONENT, skip_all, ret(level = "debug"), err)]
pub async fn select_all_public_account_ids(&self) -> Result<Vec<AccountId>> {
self.transact("read all public account IDs", move |conn| {
Expand Down
1 change: 0 additions & 1 deletion crates/store/src/db/models/queries/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ pub(crate) fn select_all_account_commitments(
/// ORDER BY
/// block_num ASC
/// ```
#[allow(dead_code)] // Will be used by InnerForest in next PR
pub(crate) fn select_all_public_account_ids(
conn: &mut SqliteConnection,
) -> Result<Vec<AccountId>, DatabaseError> {
Expand Down
5 changes: 5 additions & 0 deletions crates/store/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use tonic::Status;

use crate::db::manager::ConnectionManagerError;
use crate::db::models::conv::DatabaseTypeConversionError;
use crate::inner_forest::InnerForestError;

// DATABASE ERRORS
// =================================================================================================
Expand Down Expand Up @@ -197,6 +198,8 @@ pub enum StateInitializationError {
BlockStoreLoadError(#[source] std::io::Error),
#[error("failed to load database")]
DatabaseLoadError(#[from] DatabaseSetupError),
#[error("inner forest error")]
InnerForestError(#[from] InnerForestError),
}

#[derive(Debug, Error)]
Expand Down Expand Up @@ -274,6 +277,8 @@ pub enum ApplyBlockError {
TokioJoinError(#[from] tokio::task::JoinError),
#[error("invalid block error")]
InvalidBlockError(#[from] InvalidBlockError),
#[error("inner forest error")]
InnerForestError(#[from] InnerForestError),

// OTHER ERRORS
// ---------------------------------------------------------------------------------------------
Expand Down
Loading