Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Block struct to Miden objects #592

Closed
bobbinth opened this issue Apr 11, 2024 · 1 comment
Closed

Add Block struct to Miden objects #592

bobbinth opened this issue Apr 11, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bobbinth
Copy link
Contributor

bobbinth commented Apr 11, 2024

Currently, we have a Block struct defined in miden-node. I think this is a foundational enough struct that it should be defined in miden-base. This struct could then be used in various places (e.g., for storing block data on disk, or returning block data via node endpoints etc.).

The block struct should into the block module. It could look something like this:

pub struct Block {
    header: BlockHeader,
    updated_accounts: Vec<AccountUpdate>,
    created_notes: Vec<(BlockNoteIndex, OutputNote)>,
    created_nullifiers: Vec<Nullifier>,
    // TODO: zk proof
}

pub struct AccountUpdate {
    account_id: AccountId,
    new_state_hash: Digest,
    delta: Option<AccountDelta>,
}

pub struct BlockNoteIndex {
    batch_index: u8,
    note_index: u16,
}

A couple of open questions:

  1. Should we put BlockNoteTree into the block as well (e.g., as a lazily constructed filed)?
  2. The above assumes that #524 is implemented and we can use just AccountDelta for the update details.
@bobbinth
Copy link
Contributor Author

Closed by #621.

@github-project-automation github-project-automation bot moved this from In Review to Done in User's testnet Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants