snarkOS icon indicating copy to clipboard operation
snarkOS copied to clipboard

Allow the node to auto-forward its listnening port using UPnP

Open ljedrz opened this issue 3 years ago • 6 comments

The testnet2 equivalent of https://github.com/AleoHQ/snarkOS/pull/1218; the only difference is that the external address is not registered, but it can be extended with that functionality if need be.

Supersedes https://github.com/AleoHQ/snarkOS/pull/1218. Closes https://github.com/AleoHQ/snarkOS/issues/423.

ljedrz avatar Jan 18 '22 14:01 ljedrz

The CI error is unrelated:

running 1 test
test helpers::block_requests::tests::test_block_requests_case_2cbb ... FAILED

failures:

---- helpers::block_requests::tests::test_block_requests_case_2cbb stdout ----
thread 'helpers::block_requests::tests::test_block_requests_case_2cbb' panicked at 'assertion failed: `(left == right)`
  left: `AbortAndDisconnect(TwoCBA, "exceeded fork range")`,
 right: `Proceed(TwoCBB, BlockRequestHandlerProceed { start_block_height: 904, end_block_height: 1153, ledger_is_on_fork: true })`', src/helpers/block_requests.rs:572:13

ljedrz avatar Jan 18 '22 15:01 ljedrz

Rebased.

ljedrz avatar Jan 28 '22 09:01 ljedrz

I think this is worth including. Question: is there a way to harmonize this feature with the design, so that we adhere to an implicit design for using upnp (as opposed to having the user explicitly set a upnp flag)?

For example, is there a concept of using this first, then defaulting to basic tcp/ip if it does not hold?

howardwu avatar Feb 12 '22 07:02 howardwu

There's a reason why I proposed this functionality to be opt-in rather than being automatic; if for whatever reason someone is changing their listening port on a regular basic, or if they are using internal nodes that are communicating with the network only via a single proxy exposed to it, or if there are any other reasons why someone wouldn't want their port to be opened automatically (e.g. a complex network configuration), it would potentially break their setups and/or eventually leave them with many open ports that they might not be aware about.

That being said, this functionality only requires the user to run with the --upnp flag once, after which they can forget about it even being there.

ljedrz avatar Feb 14 '22 10:02 ljedrz

Rebased against testnet3.

ljedrz avatar Mar 01 '22 10:03 ljedrz

Admin: Please respond with "build this" in order to build this PR.

aleo-svc-exp avatar Aug 01 '22 23:08 aleo-svc-exp