Skip to content

test: DIP consumer tests - #611

Merged
ntn-x2 merged 40 commits into
developfrom
aa/dip-consumer-tests
Mar 28, 2024
Merged

test: DIP consumer tests#611
ntn-x2 merged 40 commits into
developfrom
aa/dip-consumer-tests

Conversation

@ntn-x2

@ntn-x2ntn-x2 commented Feb 23, 2024

Copy link
Copy Markdown
Contributor

Partially fixeshttps://github.com/KILTprotocol/ticket/issues/2562.

Adds unit tests for the verifier components (components tested are shown in the checklist below).
It also splits up the proof verification logic into multiple files, split by when those checks are performed. Check the crates/kilt-dip-primitives/src/merkle/v0/ folder for more details. It addresses an open comment in the DIP refactoring PR: #602 (comment).

Elements to add tests for

@ntn-x2ntn-x2 self-assigned this Feb 23, 2024
@ntn-x2
ntn-x2 marked this pull request as ready for review March 1, 2024 10:10
@ntn-x2
ntn-x2 requested a review from Ad96elMarch 1, 2024 10:10
@ntn-x2

Copy link
Copy Markdown
ContributorAuthor

@Ad96el please ignore the CI error, it is a consequence of the shitty benchmarking logic, which I plan to get rid of in the upcoming PR.

Base automatically changed from aa/dip-unit-tests to developMarch 1, 2024 13:41

@Ad96elAd96el left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. Nice job 👏

Some minor comments

Comment threadcrates/kilt-dip-primitives/src/merkle/v0/dip_subject_state/mod.rs Outdated
Comment threadcrates/kilt-dip-primitives/src/merkle/v0/dip_subject_state/tests.rs Outdated
Comment threadcrates/kilt-dip-primitives/src/merkle/v0/input_common.rs
Comment threadcrates/kilt-dip-primitives/src/merkle/v0/provider_state/tests.rs Outdated
Comment threadcrates/kilt-dip-primitives/src/merkle/v0/provider_state/tests.rs Outdated
Comment threadcrates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs Outdated
Comment threadcrates/kilt-dip-primitives/src/verifier/relaychain/error.rs
Comment threadcrates/kilt-dip-primitives/src/verifier/relaychain/error.rs
Comment threadpallets/pallet-dip-consumer/src/tests/mod.rs
Comment threadpallets/pallet-relay-store/src/mock.rs
@ntn-x2ntn-x2 mentioned this pull request Mar 6, 2024
@ntn-x2
ntn-x2force-pushed the aa/dip-consumer-tests branch from 3cd2292 to 740c79dCompareMarch 6, 2024 12:16
Comment threadcrates/kilt-dip-primitives/src/merkle/v0/provider_state/mod.rs Outdated
@Ad96el

Ad96el commented Mar 7, 2024

Copy link
Copy Markdown
Contributor

Last picky comment: In the crates/kilt-dip-primitives, there is the module merkle. This somehow triggers me. I am always thinking about the politician Angela Merkel 😆 . Wouldn't a better name be merkle_proof or merkle_tree? You can ignore this comment if you think the naming is good.

@Ad96elAd96el left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@ntn-x2
ntn-x2 enabled auto-merge (squash) March 7, 2024 12:29
@ntn-x2
ntn-x2 disabled auto-merge March 7, 2024 12:33
@ntn-x2ntn-x2 added the ✋on hold status: on hold label Mar 7, 2024
Fixeshttps://github.com/KILTprotocol/ticket/issues/3104, based on top
of #611.
It fixes the logic for the `dip-consumer` pallet, by delegating the
generation of a proof worst case to the proof verifier, which must make
sure the proof is indeed the one that requires the most weight to
verify, and that it verifies successfully. This also means that each
consumer runtime is responsible to implement this method, as there
cannot be a "universal" worst proof, as that depends on the use case.
The pallet benchmarking logic is now generic enough to make this
possible and flexible ✨✨✨
@ntn-x2ntn-x2 removed the ✋on hold status: on hold label Mar 28, 2024
@ntn-x2
ntn-x2 enabled auto-merge (squash) March 28, 2024 07:46
@ntn-x2
ntn-x2 merged commit 5cf55eb into developMar 28, 2024
@ntn-x2
ntn-x2 deleted the aa/dip-consumer-tests branch March 28, 2024 08:19
Ad96el pushed a commit that referenced this pull request Apr 2, 2024
Partially fixeshttps://github.com/KILTprotocol/ticket/issues/2562.
Adds unit tests for the verifier components (components tested are shown
in the checklist below).
It also splits up the proof verification logic into multiple files,
split by when those checks are performed. Check the
`crates/kilt-dip-primitives/src/merkle/v0/` folder for more details. It
addresses an open comment in the DIP refactoring PR:
#602 (comment).
## Elements to add tests for
- [x] `pallet-dip-consumer`
- [x] `pallet-relay-store`
- [x] `ProofVerifier`
- [x] Merge #612
- [x] Merge #613
ntn-x2 added a commit that referenced this pull request Apr 4, 2024
Partially fixeshttps://github.com/KILTprotocol/ticket/issues/2562.
Adds unit tests for the verifier components (components tested are shown
in the checklist below).
It also splits up the proof verification logic into multiple files,
split by when those checks are performed. Check the
`crates/kilt-dip-primitives/src/merkle/v0/` folder for more details. It
addresses an open comment in the DIP refactoring PR:
#602 (comment).
## Elements to add tests for
- [x] `pallet-dip-consumer`
- [x] `pallet-relay-store`
- [x] `ProofVerifier`
- [x] Merge #612
- [x] Merge #613
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ntn-x2@Ad96el