Skip to content
Merged
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 @@ -22,6 +22,7 @@
- Added `GetLimits` endpoint to the RPC server ([#1410](https://github.com/0xMiden/miden-node/pull/1410)).
- Added gRPC-Web probe support to the `miden-network-monitor` binary ([#1484](https://github.com/0xMiden/miden-node/pull/1484)).
- Add DB schema change check ([#1268](https://github.com/0xMiden/miden-node/pull/1485)).
- Add foreign account support to validator ([#1493](https://github.com/0xMiden/miden-node/pull/1493)).
- Improve DB query performance for account queries ([#1496](https://github.com/0xMiden/miden-node/pull/1496).
- Limit number of storage map keys in `GetAccount` requests ([#1517](https://github.com/0xMiden/miden-node/pull/1517)).
- The network monitor now marks the chain as unhealthy if it fails to create new blocks ([#1512](https://github.com/0xMiden/miden-node/pull/1512)).
Expand Down
35 changes: 20 additions & 15 deletions crates/validator/src/tx_validation/data_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,42 +53,47 @@ impl DataStore for TransactionInputsDataStore {
foreign_account_id: AccountId,
_ref_block: BlockNumber,
) -> impl FutureMaybeSend<Result<AccountInputs, DataStoreError>> {
async move { Err(DataStoreError::AccountNotFound(foreign_account_id)) }
async move {
self.tx_inputs.read_foreign_account_inputs(foreign_account_id).map_err(|err| {
DataStoreError::other_with_source("failed to read foreign account inputs", err)
})
}
}

fn get_vault_asset_witnesses(
&self,
_account_id: AccountId,
_vault_root: Word,
_vault_keys: BTreeSet<AssetVaultKey>,
vault_root: Word,
vault_keys: BTreeSet<AssetVaultKey>,
) -> impl FutureMaybeSend<Result<Vec<AssetWitness>, DataStoreError>> {
std::future::ready(Ok(vec![]))
async move {
// Retrieve native and foreign account asset witnesses from the advice inputs.
self.tx_inputs
.read_vault_asset_witnesses(vault_root, vault_keys)
.map_err(|err| {
DataStoreError::other_with_source("failed to read vault asset witnesses", err)
})
}
}

fn get_storage_map_witness(
&self,
account_id: AccountId,
_account_id: AccountId,
_map_root: Word,
_map_key: Word,
) -> impl FutureMaybeSend<Result<StorageMapWitness, DataStoreError>> {
async move {
if self.tx_inputs.account().id() != account_id {
return Err(DataStoreError::AccountNotFound(account_id));
}

// For partial accounts, storage map witness is not available.
Err(DataStoreError::Other {
error_msg: "storage map witness not available with partial account state".into(),
source: None,
})
unimplemented!(
"get_storage_map_witness is not used during re-execution of transactions"
)
}
}

fn get_note_script(
&self,
_script_root: Word,
) -> impl FutureMaybeSend<Result<Option<NoteScript>, DataStoreError>> {
async move { Ok(None) }
async move { unimplemented!("get_note_script is not used during re-execution of transactions") }
}
}

Expand Down