-
Notifications
You must be signed in to change notification settings - Fork 58
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
Test: Offchain workers disabled by default for container chains #723
Test: Offchain workers disabled by default for container chains #723
Conversation
…e container chain template
…t emitter to offchain worker pallet
WASM runtime size check:Compared to target branchdancebox runtime: 1412 KB (no changes) ✅ flashbox runtime: 832 KB (no changes) ✅ dancelight runtime: 2008 KB (no changes) ✅ container chain template simple runtime: 1088 KB (no changes) ✅ container chain template frontier runtime: 1388 KB (no changes) ✅ |
Coverage Report@@ Coverage Diff @@
## master aleks-container-chains-disabled-offchain-workers-check +/- ##
==========================================================================================
- Coverage 65.56% 65.44% -0.12%
+ Files 308 309 +1
+ Lines 53879 53985 +106
==========================================================================================
+ Hits 35325 35328 +3
+ Misses 18554 18657 +103
|
I think we need to test this better. I think we trully need to understand what the offchain worker does, which for starters should call a extrinsic of some sort to emit an event and you be able to detect it. In its current state I dont think we are testing much... I think the "easiest" way to test this would be:
|
…pallet-ocw-testing
…r by default for offchain worker pallet
… worker events, both when offchain worker testing is enabled and not
… for offchain worker tests
…hen disabling offchain worker using the switch extrinsic
…_worker and made it pass an additional bool parameter that turns it on/off
…xt N blocks to use it for offchain worker testing
I was able to trigger a test failure by enabling offchain workers like this, good job! diff --git a/client/node-common/src/service.rs b/client/node-common/src/service.rs
index 9500a431..cad274a0 100644
--- a/client/node-common/src/service.rs
+++ b/client/node-common/src/service.rs
@@ -552,7 +552,7 @@ where
let collator = parachain_config.role.is_authority();
- if parachain_config.offchain_worker.enabled {
+ if parachain_config.offchain_worker.enabled || true {
task_manager.spawn_handle().spawn(
"offchain-workers-runner",
"offchain-work", |
…r.sh setup script that spawns only 1 container chain
… unsigned offchain extrinsic
Adding tests to verify that offchain workers are disabled by default for container chains. Created dummy offchain worker pallet that submits an unsigned extrinsic and emits an event. The pallet is added it to the simple container chain template and offchain actions must be disabled by default.
TO DO:
false
by default