test: DB forward-compat regression test across TEE-VM releases#608
Open
kariy wants to merge 1 commit into
Open
test: DB forward-compat regression test across TEE-VM releases#608kariy wants to merge 1 commit into
kariy wants to merge 1 commit into
Conversation
A newer TEE-VM release must be able to open the database a previous release wrote. With unsealed storage now the default, the VM's data disk is a plain katana MDBX DB the VM neither encrypts nor reshapes, so this reduces to a katana-db forward-compat check that needs no QEMU/SEV. - misc/AMDSEV/scripts/test-db-forward-compat.sh: fetches the katana bundled in the latest published TEE-VM release (katana-tee-vm-<tag>.tar.gz), writes a persistent DB with it (mines blocks via dev_generateBlock), then opens the same --db-dir with the current build under --db.auto-migrate and asserts the chain survived: same chain id, block height not reset, old tip block present. Skips (loudly) when no katana-v* release exists yet; fails on a real regression (e.g. a db-format bump without a migration, or MIN_OPENABLE rising above what shipped releases wrote). - .github/workflows/test.yml: new `tee-db-forward-compat` job, gated like `db-compatibility-check` (broader-rust) so it runs on the rust/db changes that actually regress forward-compat; reuses the binary-ubuntu artifact. - docs/amdsev.md: cross-reference the test from the forward-compat section. Complements the fixture-based `db-compat-test` crate by pinning compatibility to the actual release cadence rather than a checked-in snapshot. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #608 +/- ##
==========================================
- Coverage 73.32% 67.60% -5.72%
==========================================
Files 209 337 +128
Lines 23132 46355 +23223
==========================================
+ Hits 16961 31338 +14377
- Misses 6171 15017 +8846 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a CI regression test guarding database forward-compatibility across TEE-VM releases: a newer TEE-VM release must be able to open the database a previous release wrote. Follow-up to #601 (which made unsealed storage the default).
Why this is a katana-db test, not a VM test
Since #601 made unsealed storage the default, the TEE VM's data disk is an ordinary katana MDBX database on plain ext4 — the VM neither encrypts nor reshapes it, it just runs katana with a pinned
--db-dir. So "DB forward-compat across TEE releases" reduces to the katana-db property "a newer katana opens an older katana's on-disk database", which can be exercised with two binaries on a Linux host — no QEMU, no SEV-SNP hardware.What it does
misc/AMDSEV/scripts/test-db-forward-compat.sh:katana-tee-vm-<tag>.tar.gz).dev_generateBlock).--db-dirunder--db.auto-migrateand asserts the chain survived: same chain id, block height not reset, and the old tip block is present.It skips loudly when no
katana-v*release exists yet, and fails on a real regression — e.g. a db-format bump without a migration, orMIN_OPENABLE_DB_VERSIONrising above what shipped releases wrote. (--db.auto-migrateis required: without it a pending migration prompts interactively and would hang CI.)Wiring
tee-db-forward-compatjob in.github/workflows/test.yml, gated like the existingdb-compatibility-check(broader-rust) so it runs on the rust/db changes that actually regress forward-compat, and reuses thebinary-ubuntuartifact (no extra katana build).misc/AMDSEV/because it is TEE-release-artifact-aware (and is shellcheck-linted byamdsev-lint); the job lives intest.ymlso it triggers on code changes, not onlymisc/AMDSEVedits.docs/amdsev.md: cross-referenced from the forward-compat section.Complements the fixture-based
db-compat-testcrate by pinning compatibility to the actual release cadence rather than a checked-in snapshot.Verification
bash -n+shellcheck -S warningclean on the script;actionlintclean on the new job (pre-existing warnings elsewhere untouched)..github/workflows/test.yml, which is in both the workflow's trigger paths and thebroader-rustfilter — so the new job runs in this PR's CI, validating the script end-to-end against the current release.🤖 Generated with Claude Code