-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add fast-runtime
Cargo Feature for Quick Test Runs
#4332
Conversation
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
I tried parsing a const out of an env variable with
but failed because |
If you need const for |
Mmh, but would we be comfortable with making it non-const in production for the test usecase? |
I am pretty comfortable with both, as long as there's no unreasonable shenanigans going on. Somethings are hard to make 'const', event though they are constant in reality. For example, see Type BlockWeights in system. |
…for parameter types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This would definitely only work for very few values. E.g. launch period can be reduced to 1 block without issues, but the election workers need enough time to submit their solutions (5 blocks (2min session time / 4) seems to work, didn't figure out the lower bound). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
How about disabling the UnexpectedEpochChange also with it ? It is quite common for test network to get stuck by it |
I take your point but talking with a few people it sounds like there should be a separate feature that turns on settings that make things more robust in terms of max finality lag and max backoffs. This is purely timings, but features are designed to be additive so I think they would play well together. |
bot merge |
* add fast-runtime feature for reduced session times * make democracy periods fast on fast-runtime * propagate fast-runtime feature through cargo.toml files * add fast motion and term durations to Kusama * Update runtime/westend/Cargo.toml Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * set session time to 2 minutes to avoid block production issues * formatting * update Substrate * set democracy fast periods back to 1min * set launch period and enactment period to 1 block in fast-runtime * remove unnecessary westend period configs * add prod_or_test macro to allow specifying prod, test and env values for parameter types * move prod_or_test macro into common module and use it consistently * rename macro to prod_or_fast * cargo +nightly fmt * bump impl_versions * newline Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * add note that env variable is evaluated at compile time * newline Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * newline Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * cargo fmt * impl_version: 0 * impl_version: 0 * use prod_or_fast macro for LeasePeriod and LeaseOffset * use prod_or_fast macro in WND and ROC constants Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Giles Cope <gilescope@gmail.com>
This is meant as a first stab at making certain runtime configuration values configurable via feature flag.
This PR:
fast-runtime
feature flag to toggle at build time whether the production or fast/testing values should be used for configuration values like the session time.prod_or_fast
macro to easily define config values taking advantage of thefast-runtime
flag.Usage
So to take advantage of the features introduced here you might call cargo like so:
or with cargo remote:
cargo remote -c release/polkadot -b 'KSM_LAUNCH_PERIOD=2; DOT_LAUNCH_PERIOD=2' -- build --release --features=fast-runtime
Kusama values are prefixed with
KSM
, Polkadot values withDOT
.Motivation
This allows for easier local testing of the interaction between the production chains with parachains (e.g. Kusama and Statemine).
aims to make progress towards #4333