Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions cumulus/test/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,17 @@ std = [
"substrate-wasm-builder",
"tracing/std",
]

increment-spec-version = []
# A runtime which expects to build behind the relay chain tip.
relay-parent-offset = []
# A runtime with elastic-scaling configuration.
elastic-scaling = []
# A runtime with low slot duration of 500ms for low-latency testing with 12 cores.
elastic-scaling-500ms = []
# A runtime with a slot duration of 6s but parameters that allow multiple blocks per slot.
elastic-scaling-multi-block-slot = []
# A runtime that uses block-bundling.
block-bundling = []
# A runtime with 12s slot duration which only authors one block per slot.

12s-slot = []
18s-slot = []

sync-backing = []
# A runtime with 6s slot duration which only authors one block per slot.
async-backing = []
# A runtime that uses `CandidateDescriptorV3`.
velocity-3 = []
velocity-6 = []
velocity-12 = []
Comment on lines +121 to +125
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please comments on what they are doing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done


relay-parent-offset-2 = []

v3-descriptor = []
# An elastic scaling runtime with 12s slots.
elastic-scaling-12s-slot = []
# A runtime with 18s slot duration with increased spec version for runtime upgrade testing.
slot-duration-18s = ["increment-spec-version"]
77 changes: 29 additions & 48 deletions cumulus/test/runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,99 +18,80 @@
fn main() {
use substrate_wasm_builder::WasmBuilder;

WasmBuilder::init_with_defaults()
.enable_feature("async-backing")
.import_memory()
.build();
// A runtime with 6s slot duration which only authors one block per slot.
WasmBuilder::init_with_defaults().build();

WasmBuilder::init_with_defaults()
.enable_feature("increment-spec-version")
.set_file_name("wasm_binary_spec_version_incremented.rs")
.build();

WasmBuilder::init_with_defaults()
.enable_feature("elastic-scaling")
.import_memory()
.set_file_name("wasm_binary_elastic_scaling_mvp.rs")
.build();

WasmBuilder::new()
.with_current_project()
.enable_feature("elastic-scaling")
.import_memory()
.enable_feature("velocity-3")
.enable_feature("increment-spec-version")
.set_file_name("wasm_binary_elastic_scaling.rs")
.build();

WasmBuilder::new()
.with_current_project()
.enable_feature("elastic-scaling-500ms")
.import_memory()
// A runtime with low slot duration of 500ms for low-latency testing with 12 cores.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment is wrong? Because this only enables 12 blocks, but doesn't change the slot time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

WasmBuilder::init_with_defaults()
.enable_feature("velocity-12")
.set_file_name("wasm_binary_elastic_scaling_500ms.rs")
.build();

WasmBuilder::new()
.with_current_project()
.enable_feature("elastic-scaling-multi-block-slot")
.import_memory()
// A runtime with a slot duration of 6s but parameters that allow multiple blocks per slot.
WasmBuilder::init_with_defaults()
.enable_feature("velocity-6")
.set_file_name("wasm_binary_elastic_scaling_multi_block_slot.rs")
.build();

WasmBuilder::new()
.with_current_project()
.enable_feature("relay-parent-offset")
.import_memory()
// A runtime that uses a relay parent offset of 2.
WasmBuilder::init_with_defaults()
.enable_feature("relay-parent-offset-2")
.set_file_name("wasm_binary_relay_parent_offset.rs")
.build();

WasmBuilder::new()
.with_current_project()
WasmBuilder::init_with_defaults()
.enable_feature("sync-backing")
.import_memory()
.enable_feature("12s-slot")
.set_file_name("wasm_binary_sync_backing.rs")
.build();

WasmBuilder::new()
.with_current_project()
.enable_feature("elastic-scaling-12s-slot")
.enable_feature("elastic-scaling")
.import_memory()
// An elastic scaling runtime with 12s slots.
WasmBuilder::init_with_defaults()
.enable_feature("12s-slot")
.enable_feature("velocity-3")
.enable_feature("increment-spec-version")
.set_file_name("wasm_binary_elastic_scaling_12s_slot.rs")
.build();

WasmBuilder::new()
.with_current_project()
.enable_feature("block-bundling")
.import_memory()
// A runtime that uses block-bundling.
WasmBuilder::init_with_defaults()
.enable_feature("velocity-12")
.set_file_name("wasm_binary_block_bundling.rs")
.build();

WasmBuilder::new()
.with_current_project()
.enable_feature("async-backing")
WasmBuilder::init_with_defaults()
.enable_feature("v3-descriptor")
.import_memory()
Comment thread
serban300 marked this conversation as resolved.
Outdated
.set_file_name("wasm_binary_async_backing_v3.rs")
.build();

WasmBuilder::new()
.with_current_project()
Comment thread
serban300 marked this conversation as resolved.
Outdated
.enable_feature("async-backing")
.enable_feature("v3-descriptor")
.enable_feature("relay-parent-offset")
.import_memory()
.enable_feature("relay-parent-offset-2")
.set_file_name("wasm_binary_async_backing_v3_rpo.rs")
.build();

WasmBuilder::new()
.with_current_project()
.enable_feature("elastic-scaling")
WasmBuilder::init_with_defaults()
.enable_feature("v3-descriptor")
.import_memory()
.enable_feature("velocity-3")
.set_file_name("wasm_binary_elastic_scaling_v3.rs")
.build();

// A runtime with 18s slot duration with increased spec version for runtime upgrade testing.
WasmBuilder::init_with_defaults()
.enable_feature("slot-duration-18s")
.enable_feature("18s-slot")
.enable_feature("increment-spec-version")
.set_file_name("wasm_binary_slot_duration_18s.rs")
.build();
Expand Down
Loading
Loading