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

runtime: add warp-time feature for "fast" runtime #4913

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

mnaamani
Copy link
Contributor

@mnaamani mnaamani commented Oct 6, 2023

Added a "warp-time" cargo feature for use with production runtime configuration to address #4894

To test build and run local chain (with production configration)

WASM_BUILD_TOOLCHAIN=nightly-2022-11-15 cargo build --release --features warp-time
./target/release/joystream-node --chain prod-test --tmp --alice --rpc-cors=all --pruning=archive

┆Issue is synchronized with this Asana task by Unito

Copy link
Contributor

@freakstatic freakstatic left a comment

Choose a reason for hiding this comment

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

@mnaamani are you sure you want to have "two names" for the same "feature"?
warp-time vs fast-block-production

testing-runtime = []
# Configuration suitable for automated integration testing only
testing-runtime = [
"fast-block-production"
Copy link
Contributor

Choose a reason for hiding this comment

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

will not this make testing-runtime with fast-block-production by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is already the case. The testing runtime uses 1s blocks (but doesn't warp the timing)

@freakstatic
Copy link
Contributor

oh maybe I misunderstood, so fast-block-production it's the regular testing environment and warp-time is the one with block production of 1s right?

@mnaamani
Copy link
Contributor Author

mnaamani commented Oct 16, 2023

oh maybe I misunderstood, so fast-block-production it's the regular testing environment and warp-time is the one with block production of 1s right?

Correct.
Not exactly.

testing-runtime feature and warp-time both enable 1s block times
testing-runtime uses different runtime constants for council/election/proposal periods than production.
warp-time if enabled with production runtime will use the production runtime constants and for periods which are defined using hours!,minutes!,days! macros will not be real minutes,hours,days .. they will be warped times.. so for example hours!(1) will be number of blocks (based on 6s) so 60 * 60 / 6 = 600 blocks. But since a blocks are actually at 1s intervals, that is actually 600 / 60 = 10 (real) minutes.

@mnaamani mnaamani merged commit 8fb3ea7 into Joystream:nara Oct 16, 2023
23 checks passed
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.

None yet

2 participants