Skip to content

fix: #2095 follow-ups#2132

Open
igamigo wants to merge 4 commits into
nextfrom
igamigo-clean-up
Open

fix: #2095 follow-ups#2132
igamigo wants to merge 4 commits into
nextfrom
igamigo-clean-up

Conversation

@igamigo
Copy link
Copy Markdown
Collaborator

@igamigo igamigo commented May 25, 2026

  • Rename AreNetworkAccounts to FilterNetworkAccounts (link)
  • Collapse NetworkAccountIdSubset into account.AccountIdList (link)
  • Rename state::are_network_accounts to filter_network_accounts (link) and rpc_api::are_network_accounts to filter_network_accounts (link)
  • Remove NetworkAccountId newtype wrapper (link, link, link, link)
  • Use try_into().context() for MMR forest size with a meaningful message (link)
  • Fix proto::note::NoteHeader round-trip by using details_commitment instead of note_id (link); also adds a test for this
  • Rename genesis config storage_mode to account_type and StorageMode -> AccountTypeConfig (link, link, link, link)
  • Add SAFETY comment to raw_sql_to_nonce (link)
  • Factor network-account classification into a helper in rpc::server::api (link)
  • Removed unused details_commitment field from Store (link)
  • Add Network Account cache for RpcService (link)

@igamigo igamigo force-pushed the igamigo-clean-up branch from 9fee88b to 36c569f Compare May 25, 2026 19:22
@igamigo igamigo marked this pull request as ready for review May 26, 2026 11:07
Base automatically changed from jmunoz-update-miden-deps to next May 26, 2026 12:57
@igamigo igamigo force-pushed the igamigo-clean-up branch from 735297b to 845c773 Compare May 26, 2026 14:41
@juan518munoz juan518munoz self-requested a review May 26, 2026 14:56
/// This wraps the full `AccountId` of a network account, typically extracted
/// from a `NetworkAccountTarget` attachment.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub struct NetworkAccountId(AccountId);
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.

We should also remove the proto definition at proto/proto/internal/store.proto:253-256.

/// should pre-filter to post-deployment, public-account ids; `Ok(())` on empty.
async fn reject_if_any_network_accounts(
&self,
candidate_ids: Vec<proto::account::AccountId>,
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.

It may be better to take domain type AccountId here, then convert internally. So function callers (which are domain type) don't need to be aware of the proto parallels.

@igamigo igamigo mentioned this pull request May 26, 2026
Copy link
Copy Markdown
Collaborator

@juan518munoz juan518munoz left a comment

Choose a reason for hiding this comment

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

Besides the small comments it looks ok IMO. Note that the las two commits (removing details_commitment from store and adding netwrok account cache to rpc service) are of my own, so my approval could be consider disregardable in those sections.

Copy link
Copy Markdown
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left a couple of non-blocking comments inline.

Comment thread crates/store/build.rs
6,
Felt::new_unchecked(10_000_000_000),
Felt::new_unchecked(0),
Felt::from_u64(10_000_000_000u64),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I'd use Felt::new_unchecked() and then we don't need PrimeCharacteristicRing import above (the effect will be the same).

Comment on lines +1382 to +1384
// Inherit the classification when the account already exists; otherwise classify it once at
// creation based on the new state.
let network_account_type = match existing {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not for this PR, but somewhere (probably much further upstream), we should try to detect if the delta is trying to introduce (or update) the storage slot that identifies network accounts. In case such a storage slot is being added to an existing account, we should throw an error (accounts cannot become network accounts after creation), if it is an update, then NTX builder will need to update the set of notes that the account is able to process.

Let's create an issue for this (unless we have one already).

@juan518munoz
Copy link
Copy Markdown
Collaborator

Reverted 69aa665, replaced by separate PR #2145 due to change possible becoming redundant soon.

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.

3 participants