Skip to content

Conversation

@luisschwab
Copy link
Contributor

@luisschwab luisschwab commented Jun 15, 2025

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other:

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other:

Description

Closes #522.

This PR introduces the use of different ports for the Electrum Server, conditional on bitcoin::Network and TLS status:

Network sans-TLS TLS
Bitcoin 50001 50002
Signet 60001 60002
Testnet4 40001 40002
Testnet3 30001 30002
Regtest 20001 20002

I also changed the naming from SSL to TLS (a big misnomer that still lingers).

Changelog

  • Refactor Electrum Server section.
  • Use TLS naming instead of SSL; SSL has been deprecated for over 10 years (since the POODLE attack, in 2015), and everything uses TLS now, but the misnaming still happens a lot.
  • Removed ssl_electrum_address: this argument is redundant, as we don't have two Electrum servers running.
  • Renamed ssl_key_path to tls_key_path.
  • Renamed ssl_cert_path to tls_cert_path.
  • Renamed no_ssl to enable_electrum_tls: in my opinion, the Electrum server shouldn't use TLS by default; it's more common to do TLS termination elsewhere.
  • Renamed gen_selfsigned_cert to generate_cert: more concise.
  • Adjusted tests accordingly.
  • Adjusted documentation accordingly.

@luisschwab
Copy link
Contributor Author

Why doesn't just test-functional-uv-fmt actually format the tests?

@luisschwab luisschwab force-pushed the feat/unique-electrum-ports branch 2 times, most recently from 9d0ec20 to cb75535 Compare June 16, 2025 00:00
@jaoleal
Copy link
Collaborator

jaoleal commented Jun 16, 2025

Why doesn't just test-functional-uv-fmt actually format the tests?

black is in --check mode for some reason, would you mind ?

@Davidson-Souza Davidson-Souza added documentation Improvements or additions to documentation enhancement New feature or request chore Cleaning, refactoring, reducing complexity labels Jun 16, 2025
@luisschwab luisschwab force-pushed the feat/unique-electrum-ports branch from cb75535 to cc72c79 Compare June 16, 2025 22:14
@qlrd
Copy link
Contributor

qlrd commented Jun 17, 2025

Why doesn't just test-functional-uv-fmt actually format the tests?

Because some editors (specially neovim) could conflict. When you save after format, it could edit the things you already edited. So a check is more guaranteed and if you wanna a formate uv run black ./tests.

@luisschwab
Copy link
Contributor Author

Because some editors (specially neovim) could conflict. When you save after format, it could edit the things you already edited. So a check is more guaranteed and if you wanna a formate uv run black ./tests.

I don't agree, most projects have commands that format the code. This behavior should be on a test-functional-uv-check recipe.

@qlrd
Copy link
Contributor

qlrd commented Jun 17, 2025

Because some editors (specially neovim) could conflict. When you save after format, it could edit the things you already edited. So a check is more guaranteed and if you wanna a formate uv run black ./tests.

I don't agree, most projects have commands that format the code. This behavior should be on a test-functional-uv-check recipe.

fair enough, maybe in another PR?

@luisschwab
Copy link
Contributor Author

Sure, feel free to to do it if you want.

@Davidson-Souza
Copy link
Member

You've removed the option to run both clear/ssl at the same time. I like that feature, not sure it should be removed

@luisschwab
Copy link
Contributor Author

luisschwab commented Jun 17, 2025

It does not make a lot of sense to me. What is your rationale?

For me it makes sense to either not enable TLS (and use it insecurely or terminate TLS elsewhere), or enable it and always use TLS.

@Davidson-Souza
Copy link
Member

Some wallets doesn't support TLS. I also use nc and jq to request some suff manually. But I also like TLS for my main wallets, specially if I'm accessing them remotely.

@luisschwab
Copy link
Contributor Author

So you mean always serving non-TLS and optionally serving TLS?

@Davidson-Souza
Copy link
Member

So you mean always serving non-TLS and optionally serving TLS?

Yes. That's the behavior we have now.

@luisschwab luisschwab force-pushed the feat/unique-electrum-ports branch 2 times, most recently from e28b263 to 0cb4983 Compare June 18, 2025 18:42
@luisschwab luisschwab requested a review from jaoleal June 18, 2025 18:53
@luisschwab
Copy link
Contributor Author

@JoseSK999 addressed your reviews.

Copy link
Member

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

Can you drop e2456c7? It's already addressed in #540

@luisschwab luisschwab force-pushed the feat/unique-electrum-ports branch from 7c800e6 to b1c6a87 Compare June 27, 2025 15:03
@luisschwab
Copy link
Contributor Author

Can you drop e2456c7? It's already addressed in #540

Dropped

@luisschwab luisschwab force-pushed the feat/unique-electrum-ports branch 2 times, most recently from 053ff8b to af5475b Compare June 28, 2025 18:48
@JoseSK999
Copy link
Contributor

Can you rebase now?

…LI arguments

Clean up Electrum Server section.

Use `TLS` naming instead of `SSL`; SSL has been deprecated for 10 years (since the POODLE attack, in 2015), and everything uses TLS now, but the misnaming still happens a lot.

Renamed `no_ssl` to `enable_electrum_tls`.
Renamed `ssl_electrum_address` to `electrum_address_tls`.
Renamed `ssl_key_path` to `tls_key_path`.
Renamed `ssl_cert_path` to `tls_cert_path`.
Renamed `gen_selfsigned_cert` to `generate_cert`: more concise.
@luisschwab luisschwab force-pushed the feat/unique-electrum-ports branch from af5475b to 1fedd11 Compare June 30, 2025 19:49
@luisschwab
Copy link
Contributor Author

Can you rebase now?

You got it

@luisschwab luisschwab force-pushed the feat/unique-electrum-ports branch from 1fedd11 to c58cadd Compare July 1, 2025 19:59
@luisschwab luisschwab force-pushed the feat/unique-electrum-ports branch from c58cadd to af432ab Compare July 2, 2025 00:14
@luisschwab luisschwab force-pushed the feat/unique-electrum-ports branch from af432ab to e2b69c4 Compare July 2, 2025 00:16
Copy link
Contributor

@JoseSK999 JoseSK999 left a comment

Choose a reason for hiding this comment

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

ACK e2b69c4

Copy link
Member

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

ACK e2b69c4

@Davidson-Souza Davidson-Souza merged commit d68edfd into vinteumorg:master Jul 2, 2025
10 checks passed
@luisschwab luisschwab deleted the feat/unique-electrum-ports branch July 25, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Cleaning, refactoring, reducing complexity documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Different networks use the same electrum port

5 participants