-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade v0.20.0 #33
Upgrade v0.20.0 #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My big concern is why there is a uniffi
feature separate from what integration tests appear to be using. If the feature is to distinguish between the uniffi bindings here and the flutter (and other language bindings?) Then I wonder why they live in this crate rather than where they're consumed. Perhaps this is the well reasoned best design and some repetition is ok. I don't know, it just smelled to me on first blush.
Other than this this looks ok to me. I can't believe how complete these bindings seem to be 🔥
@@ -0,0 +1,46 @@ | |||
## [0.18.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this include an [0.20.0] at the top? or am I confusing payjoin-ffi version with payjoin crate version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the changelog has been updated to include 0.20.0
Cargo.toml
Outdated
payjoin = {version = "=0.20.0", features = ["send", "receive", "base64", "v2", "io"] } | ||
#payjoin={ git = "https://github.com/payjoin/rust-payjoin", rev = "941a6798f52f60d72061fc0a02b5b42146321453", features = ["send", "receive", "base64", "v2", "io"]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we follow semver faithfully, you could put "0.20.0" here and it would automatically upgrade to patch versions. This would be helpful in the case a security patch was released. Then, you can use payjoin-ffi patch versions for your own patches separate from the underlying dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
bitcoincore-rpc = "0.19.0" | ||
http = "1" | ||
payjoin-directory = { git = "https://github.com/payjoin/rust-payjoin", features = ["danger-local-https"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you deserve a release from us if you're using payjoin-directory in tests
@@ -0,0 +1,36 @@ | |||
## [0.18.0] | |||
This release updates the python library to `payjoin` version `0.18.0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.20.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.20.0 has been added now 👍
- `V2PayjoinProposal` exposes `process_res`, `extract_v1_req`, `extract_v2_req`, `is_output_substitution_disabled`, `owned_vouts`, `psbt` & | ||
`utxos_to_be_locked`. | ||
#### io module | ||
- Exposed `fetch_ohttp_keys()` to fetch the `ohttp` keys from the specified `payjoin` directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetch_ohttp_keys includes a whole http client. I might consider releasing this io stuff as a separate payjoin-ffi feature and downstream as a separate package (e.g. payjoin and payjoin-io pypy packages) since if I were a downstream user it'd be a lot of bloat to bring in a whole foreign http and tls stack just to make a single request instead of writing it in my target language. Just an optimization for later. Maybe this comment turns into its own issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fetch_ohttp_keys
function is particularly valuable when working with v2, especially for those who prefer not to implement it from scratch. If we proceed with moving it into payjoin-io
, we may consider creating a dedicated uniffi
crate for it as well and then importing it in this uniffi
package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you want to commit and not ignore compiled binaries (I think that's what these and the .so and .dll files are)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, we've only released a Python pre-release using uniffi
and have been using the bindings and binaries for testing Payjoin in Python. For the stable release, we plan to ignore the compiled binaries and bindings. Instead, we'll bundle it similarly tobdk-ffi
and provide instructions for users to generate the bindings themselves if they need to.
python/src/payjoin/payjoin_ffi.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like bdk-ffi does not commit the generated bindings. Assuming that's what this is, why do you choose to commit them in this repo rather than leave instructions to generate bindings? Is this part of the release process to show the completed, released source code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in the above comment.
generate_script: impl Fn() -> Result<Vec<u8>, PayjoinError>, | ||
generate_script: Box<dyn GenerateScript>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume making the trait is necessary to produce bindings, but I'm not sure because this change is only happening now. Do I understand correctly? Was this just a stub before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you’ve understood correctly. The trait is essential for uniffi
. Initially, the function was only implemented for Flutter. With this commit, I've separated the function to accommodate both use cases.
@@ -18,7 +18,7 @@ jobs: | |||
override: true | |||
profile: minimal | |||
- name: Build on Rust ${{ matrix.toolchain }} | |||
run: cargo build --color always --all-targets | |||
run: cargo build --color always --all-targets --features enable-danger-local-https |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this isn't testing the code path used with the uniffi
feature, what is it testing? Why have a second implementation for many functions like pj_uri_builder
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, we weren’t planning to test the code in Rust itself but rather in the platform code. However, we encountered an issue with signing using v2 in Flutter recently, which prompted us to create this integration test code as part of the debugging process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for having a second implementation for functions like pj_uri_builder
is that we encountered a cannot move out of Arc error when using the uniffi
version of the code on the Flutter side.
src/receive/v2.rs
Outdated
#[cfg(feature = "uniffi")] | ||
#[cfg(feature = "uniffi")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dup
The separation of the |
Thanks! 🧡 |
[0.20.0]
APIs added
v2
tov1
sends possible.APIs changed
contribute_non_nitness_input
fromv1
&v2
.payjoins
out of sweep transactions (#259).