Skip to content

chore: Move to base's next#859

Merged
igamigo merged 3 commits intonextfrom
igamigo-move-to-next
Apr 21, 2025
Merged

chore: Move to base's next#859
igamigo merged 3 commits intonextfrom
igamigo-move-to-next

Conversation

@igamigo
Copy link
Collaborator

@igamigo igamigo commented Apr 18, 2025

Refactors FPI-related changes after changes in witness data on base and node.

@igamigo igamigo added no changelog This PR does not require an entry in the `CHANGELOG.md` file documentation Improvements or additions to documentation labels Apr 18, 2025
@igamigo igamigo force-pushed the igamigo-move-to-next branch from e0b8f14 to ca5a099 Compare April 18, 2025 13:53
Copy link
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 comments inline - but these are more for future discussions/considerations.

Comment on lines 234 to +237
/// Account state headers.
#[derive(Clone, Debug)]
pub struct StateHeaders {
// TODO: should this be renamed? or storage_slots moved to AccountProof
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, naming here could be improved. Basically, we have:

  • AccountWitness which proves that an account with a given commitment is in the chain.
  • StateHeaders which contains some information about the account, but not all info.
  • AccountProof which contain AccountWitness and optional StateHeaders.

I think I'm OK with AccountWitness but the naming of StateHeaders and AccountProof is confusing.

Maybe StateHeaders should be something like PartialAccount as it contains partial information about the account.

Not sure what would be a good name for AccountProof though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created an issue to track this (#862), though I think I might be able to refactor some of this from miden-base (since it's related to 0xMiden/miden-base#1229)

Comment on lines +1051 to +1061
let account_leaf = account_witness.leaf();
let account_leaf_hash = account_leaf.hash();

// Extend the advice inputs with Merkle store data
tx_args.extend_merkle_store(
merkle_path.inner_nodes(account_id.prefix().as_u64(), account_header.commitment())?,
account_witness
.path()
.inner_nodes(account_id.prefix().as_u64(), account_leaf_hash)?,
);
// populate advice map with the account's leaf
tx_args.extend_advice_map([(account_leaf_hash, account_leaf.to_elements())]);
Copy link
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 I wish this was somehow abstracted away - e.g., AccountWitness "knew" how to add itself to tx args. But that's probably a bigger change throughout the codebase.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems also a bit related to 0xMiden/miden-base#1229 (comment)

@igamigo igamigo merged commit ac1a349 into next Apr 21, 2025
19 checks passed
@igamigo igamigo deleted the igamigo-move-to-next branch April 21, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants