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

LimeChain's proposal for a research grant for the Polkadot Protocol Conformance Tests RFP #1950

Merged
merged 6 commits into from
Oct 4, 2023

Conversation

hgergov
Copy link
Contributor

@hgergov hgergov commented Sep 5, 2023

Hello W3F grants team,

We are pleased to present our project application for a research grant for the Polkadot Protocol Conformance Tests RFP.

It outlines the research approach and objectives. We are looking forward your feedback and are committed to promptly integrating suggested changes, and ensuring the application's refinement.

Best Regards,
LimeChain team

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@hgergov
Copy link
Contributor Author

hgergov commented Sep 5, 2023

I have read and hereby sign the Contributor License Agreement.

@hgergov
Copy link
Contributor Author

hgergov commented Sep 5, 2023

recheck

@Noc2 Noc2 self-assigned this Sep 6, 2023
Copy link
Collaborator

@Noc2 Noc2 left a comment

Choose a reason for hiding this comment

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

Thanks for the application. Could you potentially also add to the deliveries a short report that tries to outline the different requirements of the different implementations? The conformance test suit ideally should be used by all implementers, and it would be nice if you quickly sync with them as part of the grant.

@Noc2 Noc2 requested a review from bhargavbh September 6, 2023 12:52
@Noc2 Noc2 added the changes requested The team needs to clarify a few things first. label Sep 6, 2023
@Noc2
Copy link
Collaborator

Noc2 commented Sep 6, 2023

@hgergov Bhargav also invited you to a shared channel with the Zombienet team. Could you double-check if you received the invite?

@Noc2 Noc2 mentioned this pull request Sep 7, 2023
10 tasks
@Noc2
Copy link
Collaborator

Noc2 commented Sep 7, 2023

@hgergov see #1956 (review)

Copy link
Contributor

@bhargavbh bhargavbh left a comment

Choose a reason for hiding this comment

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

Could you please elaborate more on the test properties for BABE and Grandpa that you plan to research the feasibility?


[Zombienet](https://github.com/paritytech/zombienet) aims to be a testing framework for Substrate-based blockchains, providing a CLI tool that allows users to spawn and test ephemeral networks. The assertions used in the tests can include on-chain storage, metrics, logs, and custom JavaScript scripts that interact with the chain

Our team has successfully utilised Zombienet to run PVF conformance tests as part of another W3F grant. This is the reason why we believe that Zombienet has the potential to be the go-to framework for running conformance tests on the Hosts. The research is going to focus on Zombienet, as well as on the new [Zombienet SDK](https://github.com/paritytech/zombienet-sdk).
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please elaborate on how Zombienet was used to integrate with the PVF conformance test-suite? And briefly compare and contrast with the current project?

Copy link
Contributor

Choose a reason for hiding this comment

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

In the PVF conformance test-suite, we leveraged Zombienet's custom WASM configuration option(genesis_wasm_path) in order to inject malicious PVFs. Additionally, the team used Zombienet's DSL language in order to assert on the behaviour of the network. You can find the tests here. They're split into different folders and files mainly because it's easier to read and understand what's happening. The main difference between Polkadot and Kagome's tests is the startup command. There are also one or two differences in terms of logs emitted by each Host.

Copy link
Contributor

Choose a reason for hiding this comment

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

When it comes to comparing the 'adapter' approach with the Zombienet approach, the biggest difference is in terms of maintainability and being forward-compatible. The adapter approach is dependent on each Host not changing its implementation details. If the function's name is changed or is extracted in another module/repository, the testing suite should change as well; otherwise, it won't compile. If a function's logic is changed, then this may result in tests failing. These are all cases very relevant for Hosts in early stages of their implementation. Whereas, changes to CLI parameters and public APIs (which Zombienet uses under the hood) happen less often, which makes the approach better in terms of maintainability


The main focus of the research will be on investigating each of the aforementioned protocols and functionalities and how they can be tested in a host-agnostic manner. Based on our preliminary research and the work we've conducted on the PVF conformance testing suite, our team believes that Zombienet can serve as the foundation for the testing suite. The team will examine whether Hosts and Zombienet have the required feature set to support such testing scenarios. If this is not achievable, the team will document the missing components so that they can be identified and potentially contributed in a future proposal.

Our team acknowledges that, for certain Hosts, having the Host API, SCALE, and State Trie as standalone artifacts could be beneficial for Host developers during the early phases of their implementation. However, this proposal primarily focuses on adopting a host-agnostic approach for Hosts that are already functioning with the already existing tests. Depending on the research outcomes, our team may subsequently introduce a new proposal involving the redesign of the conformance repository. In this redesign, the tests would be separated into a standalone artifact and transformed into Zombienet tests.
Copy link
Contributor

Choose a reason for hiding this comment

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

this sounds reasonable, and aligns with the definition of conformance tests. However, it is interesting to check if the conformance tests can be easily distilled to generate stand-alone tests to support early-stage host implementers.

Copy link
Contributor

Choose a reason for hiding this comment

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

We believe that generating stand-alone tests is completely feasible and it’s scope could be a completely different project as it will require delving deep in each module and understanding it to the smallest detail. Our proposal, however, aims to discover a new and better approach to running the tests for advanced Host implementations. We believe that coming up with a better approach for testing Hosts is more important than generating stand-alone artefacts as there are currently 3 advanced Host implementations(Polkadot, Kagome, Gossamer) and one in early stages of development(Fruzhin). As stated in the proposal, we have plans to work on expanding the tests and extracting them in stand-alone artefacts in the future.

2. Child Storage
3. Hashing
4. Trie
2. SCALE
Copy link
Contributor

Choose a reason for hiding this comment

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

SCALE codec already has a comprehensive test-suite here which can be leveraged upon.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that’s correct. If it’s an interest to the W3F and the community we can add more SCALE codec test scenarios to the PoC if it proves to be feasible. We’re trying to implement a different approach because as we mentioned the “adapter” approach is not very flexible

1. Trie encoding
2. Trie decoding
3. Trie proof generation
4. BABE
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you elaborate more on this? Does block import include forking and longest chain related properties?

Copy link
Contributor

Choose a reason for hiding this comment

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

We’ve intentionally left out specific properties for BABE and GRANDPA as our main goal will be to establish a way to test any BABE functionality/property which implicitly includes forking and longest chain related properties. If you have specific properties that you’d want us to test, feel free to note them here as we won’t be able to cover all of them in the specified timeline.

4. BABE
1. Block import
2. Block validation
5. GRANDPA
Copy link
Contributor

Choose a reason for hiding this comment

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

similarly, does this cover voting and justifications of the finalisation mechanism?

Copy link
Contributor

Choose a reason for hiding this comment

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

We’ve intentionally left out specific properties for BABE and GRANDPA as our main goal will be to establish a way to test any GRANDPA functionality/property which implicitly includes voting and justifications. If you have specific properties that you’d want us to test, feel free to note them here as we won’t be able to cover all of them in the specified timeline.


| Number | Deliverable | Specification |
| --- | --- | --- |
| 0a. | License | Apache 2.0 / GPLv3 / MIT / Unlicense |
Copy link
Member

Choose a reason for hiding this comment

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

Please specify the license(s).

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

# Polkadot Protocol Conformance Tests Research Proposal

- **Team Name:** [LimeChain](https://github.com/LimeChain)
- **Payment Address:** 15reUHgnkE9QeH9zUoduCVYAbksTmQXvpMd6L95rBhTNFuGw
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- **Payment Address:** 15reUHgnkE9QeH9zUoduCVYAbksTmQXvpMd6L95rBhTNFuGw
- **Payment Address:** 15reUHgnkE9QeH9zUoduCVYAbksTmQXvpMd6L95rBhTNFuGw (USDT)

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

@vikinatora
Copy link
Contributor

Thanks for the application. Could you potentially also add to the deliveries a short report that tries to outline the different requirements of the different implementations? The conformance test suit ideally should be used by all implementers, and it would be nice if you quickly sync with them as part of the grant.

Hey David, hopefully, I’ve understood your reply correctly. The goal of the research is to prove or disprove whether using Zombienet/Zombienet-SDK for these specific Host's modules is possible. If the research turns out positive, then we can schedule a call with each Host’s team and have a discussion regarding what needs to be added in order to support the tests. We believe that any preliminary syncs with Host implementation teams would be pointless, as the outcome could be negative. If that’s not what you meant, please let us know.

@vikinatora
Copy link
Contributor

I have read and hereby sign the Contributor License Agreement.

Copy link
Collaborator

@Noc2 Noc2 left a comment

Choose a reason for hiding this comment

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

I'm sorry for not getting back to you sooner. Got it. However, in this case, it might make sense to remove "Create one test for each module from the previous steps if the research outcome indicates that it’s possible." and reduce the price. Also because it's unclear how much effort you actually need to put into this project at this stage.

@vikinatora
Copy link
Contributor

Hey David, thanks for your input! It sound reasonable and we've adjusted the scope and effort in the proposal. We're ready for a re-review.

Copy link
Collaborator

@Noc2 Noc2 left a comment

Choose a reason for hiding this comment

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

Thanks for the update. I will mark the application as ready for review and share it with the rest of the team. I personally have one last question: Would you be willing to reduce the price a little bit more?

@Noc2 Noc2 added ready for review The project is ready to be reviewed by the committee members. and removed changes requested The team needs to clarify a few things first. labels Sep 19, 2023
…neration. Adapt the effort.

Adapt the scope to exclude Host API (Storage, Child Storage, Hashing), and Trie Proof Generation.
@hgergov
Copy link
Contributor Author

hgergov commented Sep 19, 2023

I'm sorry for not getting back to you sooner. Got it. However, in this case, it might make sense to remove "Create one test for each module from the previous steps if the research outcome indicates that it’s possible." and reduce the price. Also because it's unclear how much effort you actually need to put into this project at this stage.

Hey David,

Certainly, we can further narrow down the scope and allocate certain topics for future phases.

The most meaningful ones in this context would be Host API (Storage, Child Storage, Hashing), and Trie Proof Generation. We believe that we can rely on the outcomes of the other topics to gain a high level of certainty about them. So, those are great candidates to be postponed.

We've already made the changes in the proposal accordingly.

Removing the PoC development delivery, it was a leftover from a previous commit when the scope was reduced.
@semuelle semuelle requested a review from nikw3f September 20, 2023 08:10
Copy link
Member

@semuelle semuelle left a comment

Choose a reason for hiding this comment

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

Happy to support this.

Copy link
Contributor

@keeganquigley keeganquigley left a comment

Choose a reason for hiding this comment

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

Thanks @hgergov and to everyone else for the deep dives. This is a well-written proposal and I'm interested to see Zombienet become the go-to for conformance tests. Also happy to approve.

@semuelle semuelle requested review from takahser and laboon September 29, 2023 09:50
Copy link
Contributor

@nikw3f nikw3f left a comment

Choose a reason for hiding this comment

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

Ok from my side

@takahser takahser merged commit a49deee into w3f:master Oct 4, 2023
7 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Congratulations and welcome to the Web3 Foundation Grants Program! Please refer to our Milestone Delivery repository for instructions on how to submit milestones and invoices, our FAQ for frequently asked questions and the support section of our README for more ways to find answers to your questions.

Before you start, take a moment to read through our announcement guidelines for all communications related to the grant or make them known to the right person in your organisation. In particular, please don't announce the grant publicly before at least the first milestone of your project has been approved. At that point or shortly before, you can get in touch with us at [email protected] and we'll be happy to collaborate on an announcement about the work you’re doing.

Lastly, please remember to let us know in case you run into any delays or deviate from the deliverables in your application. You can either leave a comment here or directly request to amend your application via PR. We wish you luck with your project! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review The project is ready to be reviewed by the committee members.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants