Skip to content
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

(Requires merge by @wiz) Feat: Unix sockets for Electrum RPC #50

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

junderw
Copy link
Member

@junderw junderw commented Sep 28, 2023

Edit: Since this PR changes fundamentally how ops works, only @wiz should merge it. The timing of this merge is important, and only @wiz should control it.


The Rust library doesn't support Unix socket connections, so I was unable to test it... however, I was able to confirm that the Tcp code hasn't broken. (No leaked threads or sockets)

Note:

When "electrum-discovery" feature is enabled, originally the add_peer request would upgrade a client to a peer by looking at their TcpStream's IpAddr... with UnixStream we have no IpAddr, so I just respond with an error saying that "sorry we couldn't add you as a peer because...... reasons."

@junderw junderw force-pushed the junderw/http-socket-electrum branch from 4205fd1 to 1043fd2 Compare September 28, 2023 06:26
mononaut
mononaut previously approved these changes Sep 28, 2023
Copy link
Contributor

@mononaut mononaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK @ 1043fd2a

Nothing seems to break in TCP mode.

I tested the new unix socket RPC mode by relaying TCP requests through socat:

socat TCP-LISTEN:50001,fork UNIX-CONNECT:/tmp/esplora-bitcoin-mainnet-rpc

and it handled both the pummeller test and regular wallet requests successfully.

@junderw junderw force-pushed the junderw/http-socket-electrum branch from 1043fd2 to 4ad4001 Compare September 28, 2023 23:50
@junderw junderw requested a review from mononaut September 29, 2023 02:46
@junderw junderw dismissed mononaut’s stale review September 29, 2023 02:47

Refactored, please re-test. Thanks

@junderw
Copy link
Member Author

junderw commented Sep 29, 2023

I tested TCP and Unix versions and they still work post-refactor.

Self tested ACK 4ad40012d0f9723220af50f08cab2280c5f94d32 using mononaut's Unix forwarding with socat.

@junderw junderw force-pushed the junderw/http-socket-electrum branch from 4ad4001 to 941cae1 Compare September 29, 2023 03:01
@junderw
Copy link
Member Author

junderw commented Sep 29, 2023

Self tested ACK 941cae186adc145011c89c35d83c2bb121c4715a

(The changes since the last ACK are all just startup scripts)

@junderw junderw changed the title Feat: Unix sockets for Electrum RPC (Requires merge by @wiz) Feat: Unix sockets for Electrum RPC Sep 29, 2023
@junderw junderw force-pushed the junderw/http-socket-electrum branch from 941cae1 to 8c5cd7e Compare September 30, 2023 04:45
Copy link
Member

@wiz wiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK @ mempool-electrs 3.0.0-dev-8c5cd7e

@junderw junderw force-pushed the junderw/http-socket-electrum branch from 8c5cd7e to 4339a51 Compare September 30, 2023 13:57
Copy link
Member

@wiz wiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK @ mempool-electrs 3.0.0-dev-4339a51

@wiz wiz merged commit e663693 into mempool Oct 3, 2023
7 checks passed
@wiz wiz deleted the junderw/http-socket-electrum branch October 3, 2023 04:07
SatoKentaNayoro pushed a commit to boolnetwork/mempool-electrs that referenced this pull request Nov 29, 2024
(Requires merge by @wiz) Feat: Unix sockets for Electrum RPC
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.

3 participants