Joystream / joystream

Joystream Monorepo
http://www.joystream.org
GNU General Public License v3.0
1.42k stars 115 forks source link

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

Closed mnaamani closed 11 months ago

mnaamani commented 11 months ago

Added a "warp-time" cargo feature for use with production runtime configuration to address https://github.com/Joystream/joystream/issues/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

freakstatic commented 11 months ago

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 commented 11 months ago

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.