Skip to content

feat(cli): --version reports the commit summit was built from - #468

Merged
samlaf merged 2 commits into
mainfrom
sl/sei-845-featsummit-version-reports-the-commit-the-binary-was-built
Oct 13, 2026
Merged

samlaf merged 2 commits into
mainfrom
sl/sei-845-featsummit-version-reports-the-commit-the-binary-was-built

Conversation

@samlaf

@samlaf samlaf commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Closes SEI-845.

Need summit's version when founding a TEE network since we pin the genesis format, which can change over different summit versions. Seismic-images release pin a summit version that is used in the image, so goal is to eventually have the seismic-tee CLI download the same summit version from summit releases.

Having summit document it's version is needed to help debug version mismatches.

People recommend using vergen (just like reth does) but decided against it because it's very easy to roll our own with LLMs nowadays, so we keep our supply chain smaller. Plus vergen seems to have issues when building dirty worktrees (see bullet point below)

LLM Summary

summit --version follows rustc and cargo (not seismic-reth, whose -V and --version print different things): one line by default, key: value lines with -vV for scripts:

summit 0.0.3-alpha (7aac73b40 2026-10-10)
release: 0.0.3-alpha
commit-hash: 7aac73b40db1a3693da3c1970d32485381d04cf6
commit-date: 2026-10-10
host: x86_64-unknown-linux-gnu
  • Dirty: the hash gets -dirty when tracked files differ from the commit, so a dirty build never matches a pin.
  • Reproducible: every value comes from the inputs (commit, its commit date, target), none from the build itself (no timestamp or path).
  • Needs git: without git or a checkout of this workspace, the hash and date read unknown, never a wrong commit. Release CI and the image build from git clones.
  • Not vergen: it reruns only when HEAD or the branch ref moves, so its dirty flag goes stale after an edit, and its reproducibility settings target build timestamps we don't embed. node/build.rs has no dependencies and reruns on any tracked-file edit.
  • clap's version flag can't take -v, so -V/-v are declared on CliArgs; summit prints the version when no subcommand is given.

The release workflow now fails unless commit-hash: equals the commit it built.

`summit --version` follows rustc and cargo (not seismic-reth, whose
`-V` and `--version` print different things): one line by default,
`key: value` lines with `-vV` for scripts:

    summit 0.0.3-alpha (7aac73b 2026-10-10)
    release: 0.0.3-alpha
    commit-hash: 7aac73b
    commit-date: 2026-10-10
    host: x86_64-unknown-linux-gnu

- Dirty: the hash gets `-dirty` when tracked files differ from the
  commit, so a dirty build never matches a pin.
- Reproducible: every value comes from the inputs (commit, its commit
  date, target), none from the build itself (no timestamp or path).
- Needs git: without git or a checkout of this workspace, the hash and
  date read `unknown`, never a wrong commit. Release CI and the image
  build from git clones.
- Not vergen: it reruns only when HEAD or the branch ref moves, so its
  dirty flag goes stale after an edit, and its reproducibility settings
  target build timestamps we don't embed. node/build.rs has no
  dependencies and reruns on any tracked-file edit.
- clap's version flag can't take `-v`, so `-V`/`-v` are declared on
  `CliArgs`; `summit` prints the version when no subcommand is given.

The release workflow now fails unless `commit-hash:` equals the commit
it built.

Closes SEI-845.
The comment on `--untracked-files=no` claimed an untracked file only
enters the build through a tracked change that references it. Cargo
also builds files it finds by path, such as a new build.rs or src/bin/
target, so an untracked one changes the binary without a `-dirty` mark.
The mark still ignores untracked files, as `git describe --dirty` does;
releases build from a clean checkout, which has none.

Each `git status` flag's comment now sits next to the flag.
@samlaf

samlaf commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Edited the docs describing the behavior of --dirty to not include untracked files after chatting with @matthias-wright , reasoning being:
image

@samlaf
samlaf merged commit bd7b485 into main Oct 13, 2026
4 checks passed
@samlaf
samlaf deleted the sl/sei-845-featsummit-version-reports-the-commit-the-binary-was-built branch October 13, 2026 15:30
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.

1 participant