-
Notifications
You must be signed in to change notification settings - Fork 27
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
client: Added code that implements the lnurl lud06 spec. #226
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.
Wow arti
is huge :-) Slowly getting concerned about the binary size that we have to ship to various bindings. As promised I went through it with a really fine-toothed comb, so there are a lot of comments, but feel free to ignore them.
The mix of async
and blocking
is a bit strange, and some operations, such as initializing Tor circuits, could be deferred a bit so we don't pay the costs even though we don't use it later.
address_filter.build()?; | ||
config_builder.build()?; | ||
|
||
let tor_client = TorClient::create_bootstrapped(config_builder.build().unwrap()).await?; |
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.
let tor_client = TorClient::create_bootstrapped(config_builder.build().unwrap()).await?; | |
let tor_client = TorClient::create_bootstrapped(config_builder.build()?).await?; |
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.
Notice too that create_bootstrapped
is actually going out and establishing Tor circuits, which can take considerable time. If we then end up not using that circuit all of that work is wasted. It'd likely be a better idea to keep the builder around, and defer bootstrapping to when we know we need the circuit.
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.
Great cleanup @Randy808 👍
fn convert_to_async_return_value<T: Send + 'static>( | ||
value: T, | ||
) -> Pin<Box<dyn std::future::Future<Output = T> + Send>> { | ||
let ready_future: Ready<_> = future::ready(value); | ||
Pin::new(Box::new(ready_future)) as Pin<Box<dyn std::future::Future<Output = T> + Send>> | ||
} |
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.
Very clever, definitely something I need to remember 👍
41fbf1d
to
4ce559f
Compare
6838ad2
to
e631b19
Compare
The build is failing after rebasing. I'm still looking into what it could be |
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.
Adding rustls-tls-native-roots
to the reqwest
features frees us from the openssl-dev
dependency
libs/gl-client/Cargo.toml
Outdated
log = "^0.4" | ||
pin-project = "*" | ||
prost = "0.11" | ||
reqwest = {version="0.11.18", features=["json"]} |
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.
This is implicitly pulling in openssl-sys
which depends on the openssl headers. We already use rustls
through tonic
, so we likely want to use the rustls-tls-native-roots
feature.
…nc to remove the tokio runtime.
…method parameter.
… methods needed to manually resolve an lnurl to an invoice.
@@ -679,7 +679,6 @@ mod tests { | |||
signer_state: vec![], | |||
requests: Vec::new(), | |||
}, | |||
vec![], |
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.
Removing this line since it's preventing the tests from building.
The method signature change was causing it to fail:
https://github.com/Blockstream/greenlight/pull/227/files#diff-8d5abc718d7a05d6432918246fcf5f9919681ca385b057f72a2117e9878e1932R284
No description provided.