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

add frontier-pos-template-m1 #1235

Merged
merged 2 commits into from
Jan 17, 2025
Merged

add frontier-pos-template-m1 #1235

merged 2 commits into from
Jan 17, 2025

Conversation

weimeme
Copy link
Contributor

@weimeme weimeme commented Dec 20, 2024

Milestone Delivery Checklist

  • The milestone-delivery-template.md has been copied and updated.
  • This pull request is being made by the same account as the accepted application.
  • I have disclosed any and all sources of reused code in the submitted repositories and have done my due diligence to meet its license requirements.
  • In case of acceptance, invoices must be submitted and payments will be transferred to the Polkadot AssetHub and/or fiat account provided in the application.
  • The delivery is according to the Guidelines for Milestone Deliverables.

Link to the application pull request: https://github.com/w3f/Grants-Program/blob/master/applications/frontier-pos-template.md

@semuelle
Copy link
Member

Thanks for the delivery, @weimeme. Sorry for the delay, but most of the team is out of office over the holidays, so it'll take another week at least before someone can have a look.

@keeganquigley
Copy link
Contributor

Hi @weimeme sorry for the delay, I have started the evaluation and will let you know if I have any comments/questions.

@weimeme
Copy link
Contributor Author

weimeme commented Jan 11, 2025

Hi @weimeme sorry for the delay, I have started the evaluation and will let you know if I have any comments/questions.

@keeganquigley Very excited! We're also happy to let you known that two public chains developed based on this project template will be launching soon. The Polkadot ecosystem is attracting more and more teams.

@PieWol PieWol assigned PieWol and keeganquigley and unassigned PieWol Jan 13, 2025
@keeganquigley
Copy link
Contributor

@weimeme awesome happy to hear it!

So I'm able to compile and run the node but when I run the unit tests with Tarpaulin I get the following error:

   Compiling common-runtime v0.1.0 (/home/ubuntu/frontier-pos-template/runtime/common)
   Compiling node-rpc v3.0.0-dev (/home/ubuntu/frontier-pos-template/node/rpc)
   Compiling substrate-test-runtime-client v2.0.0 (https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d)
   Compiling sc-service-test v2.0.0 (https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d)
error: could not compile `staging-node-cli` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `kitchensink-testnet-runtime` (lib test) due to 2 previous errors; 2 warnings emitted
2025-01-14T23:24:40.614706Z ERROR cargo_tarpaulin: Failed to compile tests!
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/ubuntu/.rustup/toolchains/1.80.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux

I get the same thing when I run regular cargo test. I'm not out of disk space, so I know that's not the issue. Can you tell me what version of Rust and toolchain I should be using?

@keeganquigley
Copy link
Contributor

Additionally, when I try to run with Docker Compose I get the following:

docker-compose up
ERROR: Version "1.0.0" in "./docker-compose.yml" is invalid.

Could you update the .yaml file?

@weimeme
Copy link
Contributor Author

weimeme commented Jan 15, 2025

@weimeme awesome happy to hear it!

So I'm able to compile and run the node but when I run the unit tests with Tarpaulin I get the following error:

   Compiling common-runtime v0.1.0 (/home/ubuntu/frontier-pos-template/runtime/common)
   Compiling node-rpc v3.0.0-dev (/home/ubuntu/frontier-pos-template/node/rpc)
   Compiling substrate-test-runtime-client v2.0.0 (https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d)
   Compiling sc-service-test v2.0.0 (https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d)
error: could not compile `staging-node-cli` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `kitchensink-testnet-runtime` (lib test) due to 2 previous errors; 2 warnings emitted
2025-01-14T23:24:40.614706Z ERROR cargo_tarpaulin: Failed to compile tests!
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/ubuntu/.rustup/toolchains/1.80.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux

I get the same thing when I run regular cargo test. I'm not out of disk space, so I know that's not the issue. Can you tell me what version of Rust and toolchain I should be using?

@keeganquigley This seems to be due to an environment problem. I would like to know what OS you are using?

@weimeme
Copy link
Contributor Author

weimeme commented Jan 15, 2025

Additionally, when I try to run with Docker Compose I get the following:

docker-compose up
ERROR: Version "1.0.0" in "./docker-compose.yml" is invalid.

Could you update the .yaml file?

In order to facilitate development, I made some updates to Docker a few days ago. I will rebuild and push it today, and I will also conduct basic tests.

@weimeme
Copy link
Contributor Author

weimeme commented Jan 15, 2025

@weimeme awesome happy to hear it!

So I'm able to compile and run the node but when I run the unit tests with Tarpaulin I get the following error:

   Compiling common-runtime v0.1.0 (/home/ubuntu/frontier-pos-template/runtime/common)
   Compiling node-rpc v3.0.0-dev (/home/ubuntu/frontier-pos-template/node/rpc)
   Compiling substrate-test-runtime-client v2.0.0 (https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d)
   Compiling sc-service-test v2.0.0 (https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d)
error: could not compile `staging-node-cli` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `kitchensink-testnet-runtime` (lib test) due to 2 previous errors; 2 warnings emitted
2025-01-14T23:24:40.614706Z ERROR cargo_tarpaulin: Failed to compile tests!
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/ubuntu/.rustup/toolchains/1.80.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux

I get the same thing when I run regular cargo test. I'm not out of disk space, so I know that's not the issue. Can you tell me what version of Rust and toolchain I should be using?

rust: 1.80

install envirenment

apt update
apt install -y make clang pkg-config libssl-dev protobuf-compiler build-essential git curl llvm make
rustup update nightly
rustup component add rust-src
rustup target add wasm32-unknown-unknown --toolchain nightly

@weimeme
Copy link
Contributor Author

weimeme commented Jan 15, 2025

Additionally, when I try to run with Docker Compose I get the following:

docker-compose up
ERROR: Version "1.0.0" in "./docker-compose.yml" is invalid.

Could you update the .yaml file?

In order to facilitate development, I made some updates to Docker a few days ago. I will rebuild and push it today, and I will also conduct basic tests.

@keeganquigley
Remove the existing images, then run docker-compose up again.

# Remove existing images
docker rmi chainsupport/substrate-testnet-node:latest

# Run docker-compose up again
docker-compose up

@weimeme
Copy link
Contributor Author

weimeme commented Jan 15, 2025

@keeganquigley
I have updated and tested it, and there are no issues on my end. You can proceed. Please let me know if there are any problems.

@weimeme
Copy link
Contributor Author

weimeme commented Jan 16, 2025

@keeganquigley I noticed you encountered errors when running cargo clippy. I have updated the tutorial, you can just follow the commands provided here https://github.com/ChainSupport/frontier-pos-template/blob/main/docs/tutorial.md#cargo-clippy

@weimeme
Copy link
Contributor Author

weimeme commented Jan 16, 2025

Regarding unit test coverage, we only need to focus on babe-consensus-data-provider and ecdsa-keyring, which are the newly added code. The other parts of the code come from Frontier and Substrate, and following the principle of minimal modification, for security and ease of future maintenance, no additional testing is required.

@weimeme
Copy link
Contributor Author

weimeme commented Jan 16, 2025

The low test coverage of the babe-consensus-data-provider module is due to my thorough research of both the babe module and moonbeam's pending-consensus-data-provider during development. I decided to directly adopt most methods from the babe module. Only the VRF generation and verification need to be tested, and this part of the unit testing has already been implemented at https://github.com/ChainSupport/frontier-pos-template/blob/main/client/babe-consensus-data-provider/src/lib.rs#L251.Actually, all of my personally added new code has been thoroughly tested.

@weimeme
Copy link
Contributor Author

weimeme commented Jan 16, 2025

The low test coverage of the babe-consensus-data-provider module is due to my thorough research of both the babe module and moonbeam's pending-consensus-data-provider during development. I decided to directly adopt most methods from the babe module. Only the VRF generation and verification need to be tested, and this part of the unit testing has already been implemented at https://github.com/ChainSupport/frontier-pos-template/blob/main/client/babe-consensus-data-provider/src/lib.rs#L251.Actually, all of my personally added new code has been thoroughly tested.

The explanation for this part has been added to the documentation https://github.com/ChainSupport/frontier-pos-template/blob/main/client/babe-consensus-data-provider/src/lib.rs#L18

@keeganquigley
Copy link
Contributor

keeganquigley commented Jan 16, 2025

Thanks @weimeme sounds good, will try the above commands. Thanks for responding to my eval notes too.

@keeganquigley
Copy link
Contributor

Thanks for your patience @weimeme while I ran a control experiment with regular Frontier template node to make sure the issues weren't on my end. I am running Ubuntu 20.04. But you saw my notes and fixed it anyway. Thanks also for explanations on the unit tests. Everything is working now, I was finally able to add the network manually in MetaMask and transfer UNIT balance, as well as use Remix. Thanks for the nice work! Here is my final evaluation.

@keeganquigley keeganquigley merged commit 7206d3b into w3f:master Jan 17, 2025
3 checks passed
Copy link

🪙 Please fill out the invoice form in order to initiate the payment process. Thank you!

Copy link

We noticed that this is the last milestone of your project. Congratulations on completing your grant! 🎊

So, where to from here? First of all, you should join our Grants Community chat, if you haven't already, so we can stay in touch.
If you are looking for continuative support for your project, there are quite a few options. The main goal of the W3F grants program is to support research as well as early-stage technical projects. If your project still falls under one of those categories, you might want to apply for a follow-up grant. However, depending on your goals and project status, there are other support programs in our ecosystem that might be better suited as the next step. For example, projects with a Business Case/Token should look into the Substrate Builders Program or VC Funding and Common Good projects have a good chance of receiving Treasury Funding. If you are looking for guidance, the team at https://substrate.io/ecosystem/square-one/ has compiled a list of ecosystem support sources and are happy to help you navigate it.

For a more comprehensive list, see our Alternative Funding page. Let us know if you have any questions regarding the above. We are more than happy to point you to additional resources and help you determine the best course of action.
Lastly, we hope your W3F grant was a success and we want to thank you for being part of the journey!

@weimeme
Copy link
Contributor Author

weimeme commented Jan 17, 2025

Thanks for your patience @weimeme while I ran a control experiment with regular Frontier template node to make sure the issues weren't on my end. I am running Ubuntu 20.04. But you saw my notes and fixed it anyway. Thanks also for explanations on the unit tests. Everything is working now, I was finally able to add the network manually in MetaMask and transfer UNIT balance, as well as use Remix. Thanks for the nice work! Here is my final evaluation.

@keeganquigley @semuelle @PieWol I have submitted the invoice. If there are any issues, please let me know immediately. Thank you again.

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.

4 participants