Skip to content

Handle missing runtimes and add runtime sanity checking - #57

Merged
joepetrowski merged 5 commits into
joepetrowski:masterfrom
ggwpez:oty-validate-artefact-names
Jun 8, 2026
Merged

joepetrowski merged 5 commits into
joepetrowski:masterfrom
ggwpez:oty-validate-artefact-names

Conversation

@ggwpez

@ggwpez ggwpez commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Somehow all the runtimes downloaded by OpenGov-CLI showed the same hash; turns out that hash was the blake2 of the GitHub 404 reply 😅

Changes:

  • Handle runtime download 404 error
  • Validate runtime size to be in [100KiB, 10MiB]
  • Check runtime to start with ZSTD prefix magic
  • CLI flag no_runtime_checks to skip runtime checks
  • Trim newline on hex file to account for editors that append newlines

ggwpez added 5 commits June 5, 2026 23:19
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@joepetrowski
joepetrowski merged commit fbd7a91 into joepetrowski:master Jun 8, 2026
0 of 3 checks passed

@seadanda seadanda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tests are failing

Comment thread src/build_upgrade.rs
let runtime = response.bytes().await.expect("need bytes");

if !upgrade_details.no_runtime_checks {
// Substrate zstd-compressed blob magic (`sp_maybe_compressed_blob::ZSTD_PREFIX`).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not import?

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.

That is private, but I guess you could call decompress.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ah fair enough, magic string is fine for something so unlikely to ever change

@seadanda

seadanda commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Ah already merged, I'll make a follow up to fix those few lines in the tests

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.

3 participants