Skip to content

Gate incompatible alpha wallet databases#1

Closed
czarcas7ic wants to merge 1 commit into
mainfrom
adam/alpha4-wallet-db-compatibility-gate
Closed

Gate incompatible alpha wallet databases#1
czarcas7ic wants to merge 1 commit into
mainfrom
adam/alpha4-wallet-db-compatibility-gate

Conversation

@czarcas7ic

@czarcas7ic czarcas7ic commented May 4, 2026

Copy link
Copy Markdown

Summary

  • Add an early wallet SQLite compatibility gate before WalletMigrator can mutate an existing database.
  • Add Zallet-owned compatibility epoch metadata and record epoch 1 after a successful open/migration.
  • Reject legacy alpha databases whose latest recorded Zallet version is older than 0.1.0-alpha.4, while preserving the existing network mismatch error path.
  • Treat recorded compatibility epochs as exact-match only, so older binaries fail closed if a database was touched by a newer alpha.

Context

  • This is for the upstream alpha.4 wallet DB compatibility issue. This fork draft is for CI and review; the eventual upstream PR should include the repository-local closing reference for upstream issue 264.

Validation

  • First added the alpha.3 fixture regression test and confirmed it failed before the compatibility gate because the database opened successfully.
  • Added regression coverage that rejects future compatibility epochs.
  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test -p zallet components::database::tests --all-features
  • env -u RUST_LOG cargo test --workspace --all-features

@czarcas7ic
czarcas7ic force-pushed the adam/alpha4-wallet-db-compatibility-gate branch from f42b332 to 74ab6de Compare May 4, 2026 20:53
Add an early wallet SQLite compatibility gate before applying migrations. Legacy databases without explicit compatibility epoch metadata are accepted only if the latest recorded Zallet version is at least 0.1.0-alpha.4. Databases with explicit epoch metadata must exactly match the current epoch, so older binaries fail closed after a newer alpha has touched the DB.

Closes zcash#264.

Co-Authored-By: OpenAI Codex <codex@openai.com>
@czarcas7ic
czarcas7ic force-pushed the adam/alpha4-wallet-db-compatibility-gate branch from 88a0c68 to 46cc148 Compare May 4, 2026 21:44
@czarcas7ic czarcas7ic closed this May 4, 2026
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