Skip to content

Backport slicing improvements to 0.25.x#280

Merged
apoelstra merged 13 commits into
ElementsProject:0.25.xfrom
philipr-za:backport-slicing-improvements-0.25.x
Jun 16, 2026
Merged

Backport slicing improvements to 0.25.x#280
apoelstra merged 13 commits into
ElementsProject:0.25.xfrom
philipr-za:backport-slicing-improvements-0.25.x

Conversation

@philipr-za

@philipr-za philipr-za commented Jun 15, 2026

Copy link
Copy Markdown

There are a number of useful improvements from #279 we would like to include in 0.25.x.

@apoelstra

Copy link
Copy Markdown
Member

In 33ca246:

This violates the MSRV.

@philipr-za philipr-za force-pushed the backport-slicing-improvements-0.25.x branch from 003617e to 45f2b3e Compare June 15, 2026 20:48
@philipr-za

Copy link
Copy Markdown
Author

Indeed, I only needed one helper from 278 actually so manually added that and dropped the rest of 278

@philipr-za philipr-za force-pushed the backport-slicing-improvements-0.25.x branch 6 times, most recently from 0dc08fa to 8b9431c Compare June 15, 2026 22:57
@philipr-za philipr-za force-pushed the backport-slicing-improvements-0.25.x branch from 8b9431c to 7d5f09c Compare June 15, 2026 23:11
These unwraps and indexing (which hide more panic paths) irritated me, and also
would need to be tweaked once we get rid of the Hash::from_slice methods. I
figured I'd preemptively get rid of them.
I don't *think* it's possible to create a rangeproof with a sidechannel smaller
than 64 bytes (if you create a 0-sized "proof of exact value" then unwinding
will fail entirely, and anything larger I think has at least one ring, so 128
bytes or more). Unsure.

But better not to assume this by indexing recklessly into the sidechannel
message.
We should redo the error types here as well at some point.
Currently we allow decoding segwit v0 programs which have uncompressed/hybrid
keys (not allowed) and I suspect that if you provide a too-short address then
you'll get a panic here.
@philipr-za philipr-za force-pushed the backport-slicing-improvements-0.25.x branch from 7d5f09c to 5969790 Compare June 15, 2026 23:27
@philipr-za philipr-za force-pushed the backport-slicing-improvements-0.25.x branch from 5969790 to 982a50f Compare June 15, 2026 23:37
@apoelstra

Copy link
Copy Markdown
Member

utACK 982a50f

@apoelstra apoelstra merged commit 4a38059 into ElementsProject:0.25.x Jun 16, 2026
6 checks passed
@apoelstra

Copy link
Copy Markdown
Member

Tagged and published.

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.

2 participants