This repository was archived by the owner on Nov 15, 2023. It is now read-only.
pallet-mmr: fix batch proof failures#11840
Merged
acatangiu merged 13 commits intoparitytech:masterfrom Jul 21, 2022
Merged
Conversation
covers all possible 2-leaf combinations now, including current verification failures that batch proof item count limit is too low sometimes.
as described in paritytech#11753 (comment)
acatangiu
reviewed
Jul 14, 2022
acatangiu
reviewed
Jul 14, 2022
note: right now, since not killing old chain, it keeps growing by 7 blocks for every leaf selection (added after proof generation), hence heavier to compute.
1d8399e to
11ee5d7
Compare
svyatonik
approved these changes
Jul 21, 2022
DaviRain-Su
pushed a commit
to octopus-network/substrate
that referenced
this pull request
Aug 23, 2022
* pallet-mmr: extend batch proof verification test covers all possible 2-leaf combinations now, including current verification failures that batch proof item count limit is too low sometimes. * raise upper bound on proof item number as described in paritytech#11753 (comment) * test for powerset of leaves * refactor batch proof verification test * test all batch proofs for mmr sizes up to n=13 * limit mmr size to reduce batch proof test duration * use saturating integer addition for proof check * extract common chain building in batch proof tests note: right now, since not killing old chain, it keeps growing by 7 blocks for every leaf selection (added after proof generation), hence heavier to compute. * only add blocks after a proof generation once * increase batch proof testing range * register offchain extensions only once * fmt & remove unused util
ark0f
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Feb 27, 2023
* pallet-mmr: extend batch proof verification test covers all possible 2-leaf combinations now, including current verification failures that batch proof item count limit is too low sometimes. * raise upper bound on proof item number as described in paritytech#11753 (comment) * test for powerset of leaves * refactor batch proof verification test * test all batch proofs for mmr sizes up to n=13 * limit mmr size to reduce batch proof test duration * use saturating integer addition for proof check * extract common chain building in batch proof tests note: right now, since not killing old chain, it keeps growing by 7 blocks for every leaf selection (added after proof generation), hence heavier to compute. * only add blocks after a proof generation once * increase batch proof testing range * register offchain extensions only once * fmt & remove unused util
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description:
This PR fixes the incorrect upper bound on batch proof items that was used when verifying batch proofs, which would then throw false negatives. This failure was reported and discussed in #11753.
Side note: The test coverage for batch proofs has been expanded: tests all possible batch proofs for mmr size < 8 and 2-leaf batch proofs until mmr size < 15. This does increase the test suite runtime for
pallet-mmrquite a bit (on my system, roughly from 0.5s to 4s). If this is a concern, I'm happy to reduce the test coverage.Related Issues:
Fixes #11753