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

[All] Split up manta_primitives lib.rs & [Manta&Calamari] Port parity's fast-runtime cargo feature #383

Merged
merged 25 commits into from Mar 3, 2022

Conversation

Garandor
Copy link
Contributor

@Garandor Garandor commented Feb 6, 2022

Description

Closes #357
Port of paritytech/polkadot#4332

Allows building Manta/Calamari runtimes with session and democracy times set to much shorter 2 or 5 minutes instead of their production values and for customizable timings using environment variables.
Env variables are ignored unless the RT is built with --features=fast-runtime in which case they overwrite the (shortened) defaults.

Build fast RTs with
cargo build --release --features=fast-runtime

or customize, to e.g. 1 minute period interval with env variable
MANTA_PERIOD=5 cargo build --release --features=fast-runtime

Variables are named as capitalized versions of their name in the parameter_types! macro prefixed with MANTA_ or CALAMARI_ respectively


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (manta or dolphin) with right title (start with [Manta] or [Dolphin]),
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests. N/A, buildtime changes only
  • Updated relevant documentation in the code. N/A, buildtime changes only
  • Re-reviewed Files changed in the Github PR explorer.
  • If runtime changes, need to update the version numbers properly N/A, buildtime changes only
  • If needed, notify the committer this is a draft-release and a tag is needed after merging the PR. N/A, is feature PR
  • Verify benchmarks & weights have been updated for any modified runtime logics N/A, buildtime changes only
  • If needed, bump version for every crate. N/A, buildtime changes only
  • If import a new pallet, choose a proper module index for it, and allow it in BaseFilter. Ensure every extrinsic works from front-end. If there's corresponding tool, ensure both work for each other. N/A, buildtime changes only
  • If needed, update our Javascript/Typescript APIs. These APIs are offcially used by exchanges or community developers. N/A, buildtime changes only
  • If we're going to issue a new release, freeze the code one week early(it depends, but usually it's one week), ensure we have enough time for related testing. N/A, Is feature PR

Build fast RTs with
cargo build --release --features=fast-runtime

or customize, to e.g. 1 minute period interval with env variable
MANTA_PERIOD=5 cargo build --release --features=fast-runtime

Taken from https://github.com/paritytech/polkadot/pull/4332/files?diff=unified&w=1
@Garandor
Copy link
Contributor Author

Garandor commented Feb 6, 2022

@ghzlatarev Please have a look whether the Calamari Democracy pallet fast defaults make sense

@Garandor Garandor changed the title Initial port of fast runtime feature to manta/calamari RT [MANTA&CALAMARI] Port parity's fast-runtime cargo feature to manta & calamari RT Feb 6, 2022
@Garandor Garandor changed the title [MANTA&CALAMARI] Port parity's fast-runtime cargo feature to manta & calamari RT [Manta&Calamari] Port parity's fast-runtime cargo feature to manta & calamari RT Feb 6, 2022
@Garandor
Copy link
Contributor Author

Garandor commented Feb 6, 2022

Have to mark as draft - calamari-local isn't producing blocks when built with fast-runtime, both in local testing and CI

Nevermind, CI passed. However i still can't get the parachain to start collating using polkadot-launch. Not sure yet if it's due to my config.

@Garandor Garandor marked this pull request as draft February 6, 2022 22:44
@Garandor Garandor marked this pull request as ready for review February 7, 2022 00:34
@Garandor
Copy link
Contributor Author

Garandor commented Feb 7, 2022

@Dengjianping check out this revision, it's a larger PR but I think having the types module makes the code cleaner

@Garandor
Copy link
Contributor Author

Garandor commented Feb 7, 2022

Managed to test a fast-runtime locally using polkadot-launch

All good according to me

@Garandor Garandor self-assigned this Feb 7, 2022
@Garandor Garandor added this to the v3.1.5 milestone Feb 7, 2022
runtime/primitives/src/lib.rs Outdated Show resolved Hide resolved
runtime/calamari/src/lib.rs Outdated Show resolved Hide resolved
@Garandor Garandor mentioned this pull request Feb 15, 2022
12 tasks
@ghzlatarev
Copy link
Contributor

@Garandor merge conflicts after the 0.9.16 pr.

@Garandor
Copy link
Contributor Author

Conflicts resolved, ready to merge

@Garandor Garandor changed the title [Manta&Calamari] Port parity's fast-runtime cargo feature to manta & calamari RT [All] Split up manta_primitives lib.rs & [Manta&Calamari] Port parity's fast-runtime cargo feature Feb 28, 2022
@stechu
Copy link
Contributor

stechu commented Mar 1, 2022

Thanks for this cleaning up PR. Please merge conflicts.

@stechu
Copy link
Contributor

stechu commented Mar 2, 2022

The XCM test code needs to adapt to this new change as well. See the failed unit test.

@Garandor
Copy link
Contributor Author

Garandor commented Mar 2, 2022

@stechu the PR finished CI and is ready to merge

Adam Reif and others added 3 commits March 2, 2022 17:31
run tests with runtime-benchmarks & try-runtime instead of --all--features
@Garandor
Copy link
Contributor Author

Garandor commented Mar 3, 2022

@stechu Ready to merge again

@stechu
Copy link
Contributor

stechu commented Mar 3, 2022

@Garandor Thanks for the PR!

@stechu stechu merged commit 52812c6 into manta Mar 3, 2022
@stechu stechu deleted the garandor/fast-runtime branch March 3, 2022 19:39
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.

Implement a feature like fast-runtime
4 participants