Repository navigation
fix: validate BFA channel metadata with Ethereum bridge context - #113
Merged
Merged
Conversation
bandrivskiy
marked this pull request as ready for review
October 12, 2026 20:39
This was referenced Oct 12, 2026
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.
Opening a Lightning channel funded with BFA can fail when the receiving node registers the asset's metadata. Transfer acceptance already validates the bridge history, but
Wallet::save_new_asset()repeats validation with the default RGB VM. A funding consignment that includes a bridge mint requires theceainstruction and Ethereum event context, so this second validation rejects an otherwise valid consignment with an AluVM script failure. Normal on-chain receipt uses a separate path that already validates BFA with Ethereum context.Use the existing
validate_consignment_for_schema()helper insave_new_asset(). For BFA, it supplies the bridge'sFundsInevents and enablesIssuedAmountCheckExt; other schemas continue through ordinary RGB validation. Pass an emptyassumed_eventsslice so metadata registration validates against observed bridge events without assuming pending deposits. Extend the bridge mint regression test to register the asset in a fresh wallet and assert its BFA schema and known circulating supply.Validation:
dev(6e48f22), passedcargo clippy --lib --workspace --all-features --all-targets -- -D warnings, plus the no-default-features, electrum-only, and esplora-only library configurations.cargo fmt --all -- --checkandgit diff --checkpassed.devmerge, passed the localrgb-lightning-noderegtest/Anvil lifecycle test with840e22aand the companion Lightning changes: bridge mint, SDK and REST channel funding, payments across two channels, restart, cooperative and force close, and an on-chain burn with verification of the recipient in the exported proof.rgb-libregression case (wallet::test::bridge::success) compiles; its execution and the full test suite are pending GitHub Actions.