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

refactor(Block): Distinguish MSA: in-between versus after-block #232

Closed
wants to merge 10 commits into from

Conversation

aszepieniec
Copy link
Contributor

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 for BlockPrimitiveWitness 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.

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.
aszepieniec and others added 4 commits November 12, 2024 10:04
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>
@aszepieniec
Copy link
Contributor Author

Rebased and pushed onto master.

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