Skip to content

ci: add new CI jobs to check correct vendoring of libsimplicity - #392

Merged
apoelstra merged 2 commits into
BlockstreamResearch:masterfrom
stringhandler:st-ci-vendor-checks
Oct 16, 2026
Merged

apoelstra merged 2 commits into
BlockstreamResearch:masterfrom
stringhandler:st-ci-vendor-checks

Conversation

@stringhandler

Copy link
Copy Markdown
Contributor

Adds two jobs:

  1. A job that compares the vendored simplicity files against the stated commit.
  2. A job that checks that version numbers on the methods are correct (e.g. rustsimplicity_0_8)

One worry is that outside users might edit vendor.sh and execute code, but that can't really be prevented in CI, since that check could also be edited. Github does, by default, prevent running of outsider contributor's jobs, but we should be vigilant to not just click the approve before reviewing code.

vendor-simplicity.sh prefixes every libsimplicity symbol with the crate's
major/minor version so incompatible versions can be linked together. Fail CI
if any file carries a different prefix, e.g. one copied in by hand.
Re-run vendor-simplicity.sh at the commit in simplicity-HEAD-revision.txt and
fail if the vendored tree differs, catching hand-edited or grafted files.

Also restrict the workflow's GITHUB_TOKEN to read-only contents access, since
no job needs to write.
@apoelstra

Copy link
Copy Markdown
Collaborator

we should be vigilant to not just click the approve before reviewing code.

As a general rule, I never give Github CI jobs any credentials to do "real" stuff. At worst the runners can create new PRs.

But it would be nice if we could, say, verify a gpg signature from one of us before running the vendoring script, or something.

# Check that every versioned symbol prefix in simplicity-sys matches the crate version.
#
# vendor-simplicity.sh renames every libsimplicity symbol to `rustsimplicity_<major>_<minor>_*`
# and the allocator hooks to `rust_<major>_<minor>_*`, so that semver-incompatible versions of

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.

In 0316258:

This is fine, but the pattern is really rust_0_<minor>_*. When the major version changes to 1, if ever, we would change the pattern to rust_<major>_*, dropping the minor version which would no longer indicate a semver-incompatible release.

Basically the rule is that we try to encode the "major version according to Rust's semver rules" and nothing more than that.

@apoelstra apoelstra 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.

ACK 619d916; successfully ran local tests

@apoelstra
apoelstra merged commit 6acbaa1 into BlockstreamResearch:master Oct 16, 2026
26 checks passed
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.

2 participants