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

feat(block-producer): nullifier map type safety #406

Merged

Conversation

Mirko-von-Leipzig
Copy link
Contributor

@Mirko-von-Leipzig Mirko-von-Leipzig commented Jul 12, 2024

Improve the type safety of TransactionInputs::nullifiers mapping by using Option<NonZeroU32> instead of relying on zero to indicate none.

Shower thought: is there utility in allowing a nullifier set to be included in the genesis block? Maybe for bootstrapping test networks..

(I'm happy to also just drop this PR, its not a major thing)

Use `Option<NonZeroU32>` instead of relying on zero to indicate none.
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! Let's update the changelog and merge.

Shower thought: is there utility in allowing a nullifier set to be included in the genesis block? Maybe for bootstrapping test networks..

Hmmm - I haven't thought about it much but doing something like that might be tricky. The main reason is that when we build the nullifier SMT the default value for missing nullifiers is 0. This works because we assume that no nullifier can exist in the genesis block (block 0). But if in fact some nullifiers can exist in the genesis block, we'll either need to use a different default value for missing nullifiers, or do something else to distinguish missing nullifiers from the ones that were created in the genesis block.

@Mirko-von-Leipzig
Copy link
Contributor Author

Looks good! Thank you! Let's update the changelog and merge.

Done. I don't think I'm seeing the correct merge option - I assume we're doing fast-foward merges? However, I'm only seeing merge with merge commit or squash + merge.

@bobbinth
Copy link
Contributor

I don't think I'm seeing the correct merge option - I assume we're doing fast-foward merges? However, I'm only seeing merge with merge commit or squash + merge.

In most cases, we use the "squash and merge" option. But this is also something to be discussed in the styles and processes discussion I mentioned earlier today.

@bobbinth bobbinth merged commit 90e510d into 0xPolygonMiden:next Jul 15, 2024
6 checks passed
@bobbinth
Copy link
Contributor

Oh - another thing, we usually create branches directly in the repos (rather than in forked repos).

@Mirko-von-Leipzig Mirko-von-Leipzig deleted the fork/nullifier-map-type-safety branch July 16, 2024 06:20
@Mirko-von-Leipzig
Copy link
Contributor Author

Oh - another thing, we usually create branches directly in the repos (rather than in forked repos).

The CONTRIBUTING.md said to use forked repos; but I definitely prefer not dealing with origin/upstream remotes so that's good news

@bobbinth
Copy link
Contributor

Oh - another thing, we usually create branches directly in the repos (rather than in forked repos).

The CONTRIBUTING.md said to use forked repos; but I definitely prefer not dealing with origin/upstream remotes so that's good news

Yep - that's the flow for external contributors. But for the core team, we can create branches in the repos directly.

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