-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor(Block
): Distinguish MSA: in-between versus after-block
#232
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Found a sanity check that was never triggered, except in a test case that was using mutator sets as a black box (but probably improperly). Add minimal negative test that triggers sanity check. Add comments clarifying sanity check, and rename some variables for clarity.
`MsaAndRecords::arbitrary`. Issue is that the SWBFI MMR leaf count is zero or (AOCL MMR leaf count / BATCH SIZE) - 1, whichever is larger. Dropping the "-1" will generate a corrupt mutator set accumulator.
Prior to logging a proof job, the computation is run on the VM to verify graceful halt. If this program (on the given input, etc.) does not halt gracefully, then the VM returns an error object of type `VMError`. The VMError type implements `Display` and its rendering to the screen is helpful for debugging. This commit prints the helpful debugging information, which was previously hidden behind error-ignoring asserts.
Specifically: the mutator set accumulator in the block body is *not* the mutator set accumulator after the block is applied. The difference is that the block defines miner fee UTXOs (right now only guesser fee UTXOs) which are added to it also. Function `Block::mutator_set_accumulator_after()` is renamed (adding `_after`) to clarify. This commit adds arbitrary implementations allowing for the generation of an arbitrary block primitive witness. This arbitrary implementation reflects the new dependency graph. Where possible, apply or un-apply mutator set update derived from block. Use the interface that hides the internal mechanics. NB: not always possible, see `archival_state::update_mutator_set`. Unclear why; to be investigated. Committing because all tests pass.
Anticipates directly collapsing `MutatorSetUpdate`s.
Update interfaces now jump from MSA-after-block to MSA-after-block, instead of from intermediate-MSA to intermediate-MSA. As a result, the guesser fee UTXOs are included in the block's mutator set update and do not need to be accounted for explicitly any more.
And replace it expressions computing relevant quantities, and in one case bind such an expression-evaluation to a variable with a descriptive name. Fixes test `allocate_sufficient_input_funds_test`.
Co-authored-by: Alan Szepieniec <alan@neptune.cash>
Rebased and pushed onto master. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes a distinction between the mutator set as presented in the block body, which is in an in-between state; and the mutator set implicitly defined by the block, which includes the guesser fee UTXOs and cannot be inferred from the block transaction alone. The
Arbitrary
implementation forBlockPrimitiveWitness
takes the new dependency graph into account.I cannot run all tests in a feasible amount of time because of the requirement to produce proofs. At this point I think all tests probably will pass.