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

Store endpoint: get_block_inputs #53

Closed
Dominik1999 opened this issue Oct 30, 2023 · 8 comments
Closed

Store endpoint: get_block_inputs #53

Dominik1999 opened this issue Oct 30, 2023 · 8 comments
Assignees
Labels
store Related to the store component
Milestone

Comments

@Dominik1999
Copy link
Contributor

@plafer to describe

@plafer plafer changed the title get_block_inputs store endpoint: get_block_inputs Oct 30, 2023
@plafer
Copy link
Contributor

plafer commented Oct 30, 2023

This is analogous to #54, but instead provides the block builder with the data it needs to create a block. What this looks like isn't fleshed out yet; it will be after #36

@bobbinth
Copy link
Contributor

Here is what I think could be the specifics of this endpoint:

Request {
    accounts: [list of account IDs to be modified in the proposed block],
    nullifiers: [list of nullifiers produced in the proposed block],
}

Response {
    block_header: [block header of the latest block in the chain],
    chain_peaks: [a list of MMR peaks for the current chain state],
    account_states: [latest account state hashes for all requested account IDs],
    account_proofs: <a partial Merkle tree with paths to all requested accounts in the account TSMT>,
    nullifier_proofs: <a partial Merkle tree with paths to all requested nullifiers in the nullifier TSMT>,
}

account_proofs and nullifier_proofs may be a bit more complex than what I described above. For example, for accounts, what we need are the paths in TSMT to a node which either contains the specified account or is sufficient to insert a new account. In the latter case, we may need to include (account_id, account_hash) tuple for the account which currently occupies the node.

We may also want to send information which maps accounts to node indexes in TSMT. We can derive this info from the other data in the response - but it would probably be much more efficient to send it directly.

The above also applies to nullifier proofs.

@bobbinth bobbinth added the store Related to the store component label Nov 1, 2023
@bobbinth bobbinth added this to the v0.1 milestone Nov 1, 2023
@bobbinth
Copy link
Contributor

bobbinth commented Nov 4, 2023

Most of this endpoint was implemented in #59. There are a few remaining things though:

@Dominik1999 Dominik1999 changed the title store endpoint: get_block_inputs Store endpoint: get_block_inputs Nov 20, 2023
@hackaugusto
Copy link
Contributor

@bobbinth I believe the nullifier was not included because it is blocked by this PR 0xPolygonMiden/crypto#211 , right?

@bobbinth
Copy link
Contributor

@hackaugusto - correct. We decided to implement the end-to-end flow without handling nullifiers, and then come back and add handling of nullifiers.

@Dominik1999
Copy link
Contributor Author

So, until 0xPolygonMiden/crypto#211 is merged, this issue is blocked?

@bobbinth
Copy link
Contributor

So, until 0xPolygonMiden/crypto#211 is merged, this issue is blocked?

Yes. Or alternatively we can close this issue and open another issue which is more targeted and describes only the remaining work.

@Dominik1999
Copy link
Contributor Author

Then let's close this issue and open another one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
store Related to the store component
Projects
No open projects
Development

No branches or pull requests

4 participants