Skip to content

refactor: remove all full Account reads - #2362

Open
igamigo wants to merge 7 commits into
nextfrom
igamigo-remove-acc-reads
Open

refactor: remove all full Account reads#2362
igamigo wants to merge 7 commits into
nextfrom
igamigo-remove-acc-reads

Conversation

@igamigo

@igamigo igamigo commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@juan518munoz
juan518munoz marked this pull request as ready for review August 19, 2026 18:33
@juan518munoz
juan518munoz self-requested a review August 19, 2026 18:34
Base automatically changed from igamigo-partial-acc to next August 19, 2026 20:51
Comment thread bin/miden-cli/src/commands/account.rs Outdated
Comment on lines +277 to +278
/// Reads the faucet's token symbol and decimals from its token config storage slot, without
/// loading the full account.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's relevant to the user/docs wheter the full account is used for the function or not

Suggested change
/// Reads the faucet's token symbol and decimals from its token config storage slot, without
/// loading the full account.
/// Reads the faucet's token symbol and decimals from its token config storage slot.

Comment thread bin/miden-cli/src/commands/call.rs Outdated
Comment on lines +64 to +65
// Ensure the account is tracked before executing against it; only the header is needed.
client.account_reader(account_id).header().await?;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other parts of the codebase assure header presence in a stricter way:

// Import account if not already present in store
let has_account = client.account_reader(account_id).header().await.is_ok();
if has_account {
println!("Using account {account_id} from persistent store");
} else {
println!("Importing account {account_id}...");
client.import_account_by_id(account_id).await?;
}

account_code_interface: &AccountCodeInterface,
) -> Result<(), ClientError> {
if account_code_interface.contains([FungibleFaucet::mint_and_send_root()]) {
// TODO(SantiagoPittella): Add faucet validations.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related to any issue? If so, let's add the number alongside the TODO.

Comment thread CHANGELOG.md Outdated
* [rust] State sync now authenticates every relevant note block but only persists block headers and MMR authentication nodes for blocks containing notes that remain unspent or that a `NoteObserver` explicitly marks as relevant ([#2297](https://github.com/0xMiden/rust-sdk/pull/2297)).
* [rust,store] `BatchBuilder` now stacks in-batch account state as a `PartialAccount` updated with each transaction's `AccountPatch` instead of reconstructing the full `Account` after every push. Witnesses for keys no prior in-batch transaction touched are served by the new `Store::vault_asset_witnesses_after_patch` and `Store::storage_map_witness_after_patch` methods, which stage the accumulated patch onto the store's committed Merkle forest without persisting it (default implementations return `UnsupportedOperation`; `SqliteStore` implements them) ([#2277](https://github.com/0xMiden/rust-sdk/pull/2277)).
* [rust,store] Single-transaction execution (`Client::execute_transaction`, `Client::validate_request`) no longer reconstructs the full `Account`: request validation now checks balances against the vault asset list fetched via the new `Store::get_account_assets`, and everything else works from the minimal partial account. Executor vault witnesses (including emptiness proofs for assets being added) are served by the new `Store::get_vault_asset_witnesses`, which `SqliteStore` answers directly from its in-memory Merkle forest instead of rebuilding the vault. Both new `Store` methods have vault-reconstruction default implementations, so existing store backends keep working unchanged ([#2277](https://github.com/0xMiden/rust-sdk/pull/2277)).
* [cli] `account --list`, `account show` and `call` no longer load full accounts from the store: faucet token symbols and decimals are read from the faucet's token config storage slot, and the `call` existence check uses the account header ([#TBD](https://github.com/0xMiden/rust-sdk/pull/TBD)).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [cli] `account --list`, `account show` and `call` no longer load full accounts from the store: faucet token symbols and decimals are read from the faucet's token config storage slot, and the `call` existence check uses the account header ([#TBD](https://github.com/0xMiden/rust-sdk/pull/TBD)).
* [cli] `account --list`, `account show` and `call` no longer load full accounts from the store: faucet token symbols and decimals are read from the faucet's token config storage slot, and the `call` existence check uses the account header ([#2362](https://github.com/0xMiden/rust-sdk/pull/2362)).

@igamigo
igamigo force-pushed the igamigo-remove-acc-reads branch from c8f9d09 to ccb6a79 Compare August 19, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants