Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- [BREAKING] Renamed `SubmitProvenBatch` RPC endpoint to `SubmitProvenTxBatch` ([#2094](https://github.com/0xMiden/node/pull/2094)).
- Fixed block producer mempool panic when selecting transactions that depend on notes created by pruned committed transactions ([#2097](https://github.com/0xMiden/node/pull/2097)).
- Implemented filtering based on the network account note script root allowlist in ntx-builder ([#2042](https://github.com/0xMiden/node/issues/2042)).
- Added SQL conversion trait coverage for common store database binary types ([#1477](https://github.com/0xMiden/node/issues/1477)).

- [BREAKING] Renamed `ExplorerStatusDetails` fields in the network monitor's `/status` payload from `number_of_*` to `total_*` (`total_transactions`, `total_nullifiers`, `total_notes`, `total_account_updates`). The values now represent network-wide cumulative totals from the explorer's `overviewStats` query instead of last-block counts.
- [BREAKING] Removed `--wallet-filepath` / `--counter-filepath` flags and the `MIDEN_MONITOR_WALLET_FILEPATH` / `MIDEN_MONITOR_COUNTER_FILEPATH` env vars from the network monitor. The monitor now keeps wallet and counter accounts fully in memory and regenerates them on every startup; the dashboard's counter value resets to zero on restart.
Expand Down
63 changes: 59 additions & 4 deletions crates/store/src/db/models/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,30 @@
)]

use miden_crypto::Word;
use miden_crypto::utils::Deserializable;
use miden_crypto::utils::{Deserializable, Serializable};
use miden_protocol::Felt;
use miden_protocol::account::{StorageSlotName, StorageSlotType};
use miden_protocol::account::{
AccountCode,
AccountId,
AccountStorageHeader,
StorageMapKey,
StorageSlotName,
StorageSlotType,
};
use miden_protocol::asset::Asset;
use miden_protocol::block::{BlockHeader, BlockNumber};
use miden_protocol::note::NoteTag;
use miden_protocol::crypto::merkle::SparseMerklePath;
use miden_protocol::note::{
NoteAssets,
NoteAttachments,
NoteId,
NoteMetadata,
NoteScript,
NoteStorage,
NoteTag,
Nullifier,
};
use miden_protocol::transaction::TransactionId;

use crate::db::models::queries::{BlockHeaderCommitment, NetworkAccountType};

Expand Down Expand Up @@ -91,10 +110,46 @@ impl SqlTypeConvert for BlockHeader {
}

fn to_raw_sql(self) -> Self::Raw {
miden_crypto::utils::Serializable::to_bytes(&self)
Serializable::to_bytes(&self)
}
}

macro_rules! impl_binary_sql_convert {
($($ty:ty),+ $(,)?) => {
$(
impl SqlTypeConvert for $ty {
type Raw = Vec<u8>;

fn from_raw_sql(raw: Self::Raw) -> Result<Self, DatabaseTypeConversionError> {
<Self as Deserializable>::read_from_bytes(raw.as_slice()).map_err(Self::map_err)
}

fn to_raw_sql(self) -> Self::Raw {
Serializable::to_bytes(&self)
}
}
)+
};
}

impl_binary_sql_convert!(
AccountCode,
AccountId,
AccountStorageHeader,
Asset,
NoteAssets,
NoteAttachments,
NoteId,
NoteMetadata,
NoteScript,
NoteStorage,
Nullifier,
SparseMerklePath,
StorageMapKey,
TransactionId,
Word,
);

impl SqlTypeConvert for NetworkAccountType {
type Raw = i32;

Expand Down
Loading