BOLT11 additional and negative tests#736
Merged
rustyrussell merged 5 commits intoMay 11, 2020
Merged
Conversation
rustyrussell
added a commit
to rustyrussell/lightning
that referenced
this pull request
Feb 3, 2020
See-also: lightning/bolts#736 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell
added a commit
to rustyrussell/lightning
that referenced
this pull request
Feb 3, 2020
Otherwise you can ask for a sub-millisatoshi amount, which is dumb and violates the spec. See-also: lightning/bolts#736 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell
added a commit
to rustyrussell/lightning
that referenced
this pull request
Feb 3, 2020
Otherwise you can ask for a sub-millisatoshi amount, which is dumb and violates the spec. See-also: lightning/bolts#736 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: We now reject invoices which ask for sub-millisatoshi amounts
t-bast
reviewed
Feb 3, 2020
Collaborator
t-bast
left a comment
There was a problem hiding this comment.
Thanks for doing this!
It made me realize that eclair is not currently skipping over p, h, s or n of invalid lengths but instead rejects such invoices. I'll fix that (I'm guessing it's a requirement to allow smooth upgrades of those fields right?).
t-bast
added a commit
to ACINQ/eclair
that referenced
this pull request
Feb 4, 2020
Correctly implement skipping over hashed tags with invalid length. See lightning/bolts#736.
cdecker
pushed a commit
to ElementsProject/lightning
that referenced
this pull request
Feb 5, 2020
See-also: lightning/bolts#736 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
cdecker
pushed a commit
to ElementsProject/lightning
that referenced
this pull request
Feb 5, 2020
Otherwise you can ask for a sub-millisatoshi amount, which is dumb and violates the spec. See-also: lightning/bolts#736 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: We now reject invoices which ask for sub-millisatoshi amounts
t-bast
added a commit
to ACINQ/eclair
that referenced
this pull request
Feb 10, 2020
pm47
added a commit
to ACINQ/eclair
that referenced
this pull request
Feb 10, 2020
* Ignore fields with invalid length As per the spec: > A reader: > * MUST skip over unknown fields, OR an f field with unknown version, OR p, h, s or n fields that do NOT have data_lengths of 52, 52, 52 or 53, respectively. * Add more Bolt 11 tests See lightning/bolts#699 and lightning/bolts#736 Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
This was referenced Feb 14, 2020
t-bast
approved these changes
Mar 2, 2020
Collaborator
|
@cfromknecht or @Roasbeef, do we have an ACK to merge this? |
18 tasks
17 tasks
We're going to extend the final case with negative test cases. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
One for uppercase, and one with should-be-ignored fields. The first of these addresses lightning#659 (lightning#677 directly changes the text to make it clear this is allowed, and should also be applied). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This tests various forms of malformed invoices (it's not exhaustive though). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We added a requirement on the writer, not the reader. We can't really add a test vector without a new requirement, though. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…trings. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1413c35 to
7dc4383
Compare
Collaborator
Author
|
OK, rebased: had to hoist the new pico-btc test higher, so we could put the new variants underneath the existing ones. |
Collaborator
Author
|
Merging as per meeting agreement: http://www.erisian.com.au/meetbot/lightning-dev/2020/lightning-dev.2020-05-11-20.08.html |
kafaichoi
added a commit
to RiverFinancial/bitcoinex
that referenced
this pull request
May 16, 2020
return error tuple instead of crashing when decoding a ln invoice with sub msat in amount new test vectors are copied from lightning/bolts#736
mononaut
pushed a commit
to bitfeed-project/bitfeed
that referenced
this pull request
Dec 2, 2021
return error tuple instead of crashing when decoding a ln invoice with sub msat in amount new test vectors are copied from lightning/bolts#736
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.
As per last meeting, this expands the BOLT11 test vectors. I've reproduced them with the c-lightning unit tests.