Skip to content

Review updates - #210

Merged
jgriffiths merged 205 commits into
masterfrom
review_updates
Jul 26, 2020
Merged

Review updates#210
jgriffiths merged 205 commits into
masterfrom
review_updates

Conversation

@jgriffiths

@jgriffiths jgriffiths commented Jul 14, 2020

Copy link
Copy Markdown
Contributor

A large set of fixes and updates encompassing:

Review and bug fixing of changes over the last year
Documentation improvements
Standardising of interfaces and consistency of implementation
Improved tests
Merging all outstanding PSBT changes required for current c-lightning master
Additional PSBT fixes and cleanups
Wrapper updates

Although there remains a significant amount of PSBT work to complete, I think this is worth merging now so that the lightning peeps can move back to wally master instead of their hacked/blessed branch, and further changes can be smaller and more easily reviewable.

Obsoletes or includes the following PRs: #208 #207 #206 #204 #201 #199 #198 #194 #193 #191

Fixes #205
Fixes #189
Fixes #184
Fixes #139

jgriffiths added 30 commits July 6, 2020 08:19
Doesn't affect functionality since SHA256_LEN is the same size, but this
reads better.
…heck

Checked in here to not lose it until this is pushed upstream.

Wally only uses v0 addresses at the time of commiting. Note that the
inverse function segwit_addr_decode() isn't affected as it implicitly
casts uint8 -> int32 so witver cannot be negative on return.
Also update version to uin32_t (currently always passed as 0).
…riable

This ensures we leave written as 0 in the case of an error.
For example, output being NULL should return WALLY_EINVAL.
Exposes the types used by the setters and renames some things so the
existing SWIG pattern matches work for types.
There were no calls that take these functions so removing them should
not cause any issues.

Modifying the PSBTs transaction inputs and outputs will be added, which
like psbt_set_global_tx() will update the PSBT to reflect the tx
status. Otherwise for all other operations the caller will only need to
set values within the existing PSBT inputs and outputs.

This will save a lot of boilerplate and wrapping code from being
required, and fits with e.g. c-lightnings view of how PSBTs will be
manipulated.
SWIG wrappers should use the indexed setters exposed through swig_int.h
to set values through the psbt, since they can't get pointers to the
input and output items.
This will be even cleaner once pubkey is converted to a ptr + length
from its current array form.
These should have followed the model of the transaction code; when
Elements support is compiled in, inputs and outputs *are* Elements
inputs and outputs and elements members can be set like any other
members.
The previous interface was unusable: no users should be affected,
so we just note that the new interface is final to fulfill the contract
we have w.r.t. updating CHANGES.md for API changes.
Comment thread src/psbt.c
@jgriffiths jgriffiths self-assigned this Jul 22, 2020
@LeoComandini

Copy link
Copy Markdown
Contributor

I went through the changed code and it looks good to me.
As said in the above comments other PRs will follow to cover some issues, add the missing tests and finalize the psbt interface.
So IMHO we should be good in merging this PR at this stage.

utACK 1b61666

The incorrect constant has the same size so this isn't an API change; it
just makes the code a little clearer.
This required changes to paramater names to match the transaction
fields, and includes documentation fixes and length checks for the
setter functions.
Also fix innteger setters to go through the setter function to get
proper error checking.
Note the definition of EC_FLAGS_ALL uses the hex values as the JS bindings
require this to compile.
libsecp always produces low-s signatures so this isn't required.
@LeoComandini

Copy link
Copy Markdown
Contributor

New changes looks good too,

utACK c9c45b6

@jgriffiths
jgriffiths merged commit c9c45b6 into master Jul 26, 2020
@jgriffiths
jgriffiths deleted the review_updates branch July 26, 2020 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants