smite: drive commitment tests from JSON vectors - #245
Merged
morehouse merged 2 commits intoSep 28, 2026
Merged
Conversation
erickcestari
approved these changes
Sep 11, 2026
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
NishantBansal2003
force-pushed
the
refactor-commitment-tests
branch
from
September 21, 2026 07:29
54fb5db to
97fa452
Compare
morehouse
approved these changes
Sep 25, 2026
Comment on lines
+147
to
+154
| // Acceptor signs opener's commitment. | ||
| if !channel_config.verify_counterparty_signature( | ||
| &commitment_state, | ||
| &opener_holder, | ||
| &vector.remote_signature, | ||
| ) { | ||
| failures.push(format!("{}: remote signature does not verify", vector.name)); | ||
| } |
Collaborator
There was a problem hiding this comment.
It looks like we could also compute the remote_signature and compare against vector.remote_signature here.
Contributor
Author
There was a problem hiding this comment.
Added, and it flagged that the LDK oracle we used to add vector.remote_signature creates the signature in low r form, while we sign it normally. So I used the Eclair oracles from #181 (comment) with the appropriate oracle params to get these signatures, since Eclair does not use low r signatures
Each BOLT 3 vector was a hand-written test repeating the same channel setup and the same three signature assertions. Move the vectors into JSON files under test_vectors/, split by channel type (Appendix C legacy, Appendix F anchors, plus custom files for edge cases the appendices miss), and run them through a shared harness. Adding a vector is now a JSON entry, not a new test. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
NishantBansal2003
force-pushed
the
refactor-commitment-tests
branch
from
September 26, 2026 17:52
97fa452 to
56797ac
Compare
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.
The first commit moves all the tests in
commitment.rsinto a submodule, and the second migrates the commitment signature verification tests to JSON verification.Pros:
Cons:
If more than one test vector fails, we only see the first test failure instead of all of them: Fixed in 54fb5db