-
Notifications
You must be signed in to change notification settings - Fork 688
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
PVF: Add worker check during tests and benches #1771
Conversation
Also: - Use an env var for the node version to avoid unnecessary dependencies on polkadot-cli - Add a benchmark for preparation through the host
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.
Wow, it's an impressive amount of checks for dev-only code! Nothing has caught my eye, looks good!
panic!("ERROR: Workers do not exist or are not executable. Workers directory: {:?}", workers_path); | ||
} | ||
|
||
let node_version = env!("POLKADOT_NODE_VERSION"); |
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.
So this is now the reason the version is put into an env variable?
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.
Yessir.
|
||
// We don't want to check against the commit hash because we'd have to always rebuild | ||
// the calling crate on every commit. | ||
eprintln!("WARNING: Workers match the node version, but may have changed in recent commits. Please rebuild them if anything funny happens. Workers path: {workers_path:?}"); |
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.
You already print this here. So, this doesn't really make any sense to compare the version. If you really want to make it more "safe", you can call here cargo build
to ensure the worker are there.
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.
Well, this warning won't show up unless -- --nocapture
is passed. I left it because it's better than nothing I guess. I think it's still useful to separately check for worker existence and that they're on the same version.
If you really want to make it more "safe", you can call here cargo build to ensure the worker are there.
You mean cargo build
in build.rs, every time the version changes?
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.
No, I mean this function does this at "runtime". This is only being used for testing stuff. So, it could ensure that the workers are up to date. It would also make testing easier, as people would not be required to first run cargo build
after finding out that the workers are not there.
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.
Would still like that get_and_check_worker_paths
just calls cargo build
to provide some better UX for tests. However, this isn't a real blocker as the current behavior isn't changed.
I'm considering removing the benches in favor of the one here: https://github.com/paritytech/polkadot-sdk/pull/1192/files#diff-50fee62320022788db79b0efec4a3dd9e9c7060efbcb6af6a4ce27f31392a395. For the measurement I want to get (time of an execution job), it would be better to add a metric and get it by running zombienet. Because right now execution always returns early due to an invalid candidate so I don't get an accurate stat. Edit: oh, we already have such a metric ( |
…ing-tests' into mrcnski/pvf-add-worker-check-during-tests
The CI pipeline was cancelled due to failure one of the required jobs. |
* tsv-disabling: (36 commits) Removed TODO from test-case for hard-coded delivery fee estimation (#2042) Expose collection attributes from `Inspect` trait (#1914) `polkadot-parachain-primitives` should not depend on `frame-support`. (#1897) [testnet] Align testnet system parachain runtimes using `RelayTreasuryLocation` and `SystemParachains` in the same way (#2023) Sort the benchmarks before listing them (#2026) publish pallet-root-testing (#2017) Contracts: Add benchmarks to include files (#2022) Small optimisation to `--profile dev` wasm builds (#1851) basic-authorship: Improve time recording and logging (#2010) Application Crypto and BEEFY Support for paired (ECDSA,BLS) crypto (#1815) [ci] Run check-rust-feature-propagation in pr and master (#2012) Improve features dev-ex (#1831) Remove obsolete comment. (#2008) Refactor candidates test in paras_inherent (#2004) PVF: Add worker check during tests and benches (#1771) Bump actions/setup-node from 3.8.1 to 4.0.0 (#1997) polkadot: enable tikv-jemallocator/unprefixed_malloc_on_supported_platforms (#2002) Make `IdentityInfo` generic in `pallet-identity` (#1661) Ensure correct variant count in `Runtime[Hold/Freeze]Reason` (#1900) `CheckWeight`: Add more logging (#1996) ...
Improves test ergonomics. Please see #1724.
Also:
Related
Closes #1724