Merged
Conversation
apoelstra
previously approved these changes
Sep 25, 2024
Member
apoelstra
left a comment
There was a problem hiding this comment.
ACK 3437f6c8b9d6797ca0543acfd77914b30ff8f258 successfully ran local tests
Member
Author
|
Merge please. This is holding up more |
Member
|
Needs rebase now. |
72c9096 to
e61d581
Compare
Member
Author
|
Rebase only, no other changes. (Took me two goes because I left |
In preparation for moving the `Witness` oven to `primitives` use the `len` function instead of accessing the `witness_elements` field. No logic change, `Witness::len()` returns `witness_elements`.
The `Witness::push_slice` function is called by `Witness::push` after calling `as_ref`, hence is equivalent for all types that implement `AsRef<[u8]>`. Also, `push_slice` is a private method on `Witness`. In preparation for moving `Witness` over to `primitives` stop using `push_slice` in favour of `push`. Internal change only.
We would like to move the `Witness` to `primitives` however in the `Encodable` implementation we are currently accessing the private `content` field. Instead of accessing `content` we can iterate over the witness elements and write each individually, this has the same result but does a bunch of additional calls to `Write::write_all` (via `emit_slice`). This patch effects performance negatively but makes no changes to the encoding.
e61d581 to
3f3f30d
Compare
shinghim
approved these changes
Oct 1, 2024
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.
Prepare
Witnessto be moved toprimitives.This is the first three patches out of #3406. Patch 1 and 2 are internal changes, path 3 is also internal but introduces a slight perf hit by doing multiple writes.