Skip to content

feat: add migration for commitment contract features - #1665

Open
quake wants to merge 2 commits into
developfrom
feat/migrate-commitment-contract-features
Open

quake wants to merge 2 commits into
developfrom
feat/migrate-commitment-contract-features

Conversation

@quake

@quake quake commented Sep 25, 2026

Copy link
Copy Markdown
Member

Summary

Completes the database migration work left unfinished by #1656 (commitment-lock full payment hash). That PR added a commitment_contract_features field to three persisted types but shipped with no migration, so 0.10.0-rc1 required a fresh database.

This PR adds a migration that upgrades existing databases in place by adding commitment_contract_features (defaulting to Legacy, 0x0) to:

  • ChannelActorData (store prefix 0x00)
  • ChannelOpenRecord (store prefix 201)
  • watchtower ChannelData (store prefix 224)

Existing channels keep their legacy settlement layout, matching the on-chain behavior from #1656.

Changes

  • Add mig_20260925_commitment_contract_features migration with per-type conversion + unit tests.
  • Bump the fiber-types-090 migration dependency from 0.9.0-rc4 to 0.9.1 (the last published 0.9.x; struct layout is unchanged, only additive methods/variants) so the migration correctly round-trips channels in the Stale state introduced in 0.9.1.
  • Add fiber-types-0100 (0.10.0-rc1) as the "new" target types.
  • Update CHANGELOG to note in-place upgrade is now supported.

Verification

  • cargo test -p fiber-store --features rocksdb — 9 passed (3 new migration tests + existing).
  • cargo clippy -p fiber-store --all-targets --features rocksdb -- -D warnings — clean.
  • cargo check --locked -p fnn -p fiber-bin — passed.
  • cargo fmt --all -- --check — clean.

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