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

refactor(iroh-net): generalize derp naming to relay to prepare for future refactors #2091

Merged
merged 10 commits into from
Mar 21, 2024

Conversation

ramfox
Copy link
Contributor

@ramfox ramfox commented Mar 19, 2024

Description

We have been making breaking changes to the DERP protocol and are planning future changes that will better take advantage of / integrate with QUIC in our hole-punching schemes.

Some notable changes:

CLI Config changes:

derp_nodes -> relay_nodes

API Changes

NodeAddr::with_derp_url -> NodeAddr::with_relay_url
NodeAddr::derp_url -> NodeAddr::relay_url
AddrInfo::derp_url -> AddrInfo::relay_url
DerpUrl -> RelayUrl
EndpointInfo::derp_url -> EndpointInfo::relay_url
DerpMode -> RelayMode
DerpMap -> RelayMap
MagicEndpointBuilder::derp_mode -> MagicEndpointBuilder::relay_mode
MagicEndpoint::my_derp -> MagicEndpoint::my_relay
default_eu_derp_node -> default_eu_relay_node
default_na_derp_node -> default_na_relay_node

CLI command changes

iroh-cli blob get --derp_url -> iroh-cli blob get --relay_url
iroh-cli doctor accept --local_derper -> iroh-cli doctor accept --local_relay_server
iroh-cli doctor connect --local_derper -> iroh-cli doctor connect --local_relay_server
iroh-cli doctor derp_urls -> iroh-cli doctor relay_urls

Derper Changes

  • now called iroh-relay
  • feature is iroh-relay
    To run a relay server: cargo run --bin iroh-relay --features="iroh-relay"

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

@ramfox ramfox self-assigned this Mar 19, 2024
@ramfox ramfox force-pushed the ramfox/relay-rename branch 2 times, most recently from bce1fcf to d28b385 Compare March 19, 2024 19:29
@ramfox ramfox marked this pull request as ready for review March 19, 2024 20:23
Copy link
Collaborator

@Arqu Arqu left a comment

Choose a reason for hiding this comment

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

Left some quick comments regarding the CI.

name: derper
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should probably also be iroh-relay but will break regardless. Need to update infra once it lands. Will file an issue for myself.

@@ -97,7 +97,7 @@ jobs:
- name: Copy binaries to right location
run: |
cp target/optimized-release/iroh ../chuck/netsim/bins/iroh
cp target/optimized-release/derper ../chuck/netsim/bins/derper
cp target/optimized-release/iroh-relay ../chuck/netsim/bins/iroh-relay
Copy link
Collaborator

Choose a reason for hiding this comment

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

To cheat for now you can do cp target/optimized-release/iroh-relay ../chuck/netsim/bins/derper given commands/args have remained the same. I can do another pass to bring all the other infra in line with the rename.

@@ -132,7 +132,7 @@ jobs:

- name: Cleanup
run: |
sudo kill -9 $(pgrep derper) || true
sudo kill -9 $(pgrep iroh-relay) || true
Copy link
Collaborator

Choose a reason for hiding this comment

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

cheat code derper instead of iroh-relay

@Arqu
Copy link
Collaborator

Arqu commented Mar 20, 2024

The logs indicate that they fail to set up a connection (given it's mostly a rename PR, functionality should remain the same). I did a manual run and saw it trying to reach default derpers which those tests shouldn't. Which pointed me to https://github.com/n0-computer/chuck/blob/main/fixtures/derp.config.toml which we feed into the iroh binary at run time.

To make things work with the current state of the PR we just need to rename [[derp_nodes]] into [[relay_nodes]] and it correctly picks up the config and works fine from there.

We can potentially roll this back to the first version you pinged me where we had everything renamed to iroh-relay and I can cook up a netsim branch that lines everything up with it. Then we just merge in succession.

@ramfox ramfox force-pushed the ramfox/relay-rename branch from 5313507 to 7312c5f Compare March 20, 2024 14:08
@Arqu
Copy link
Collaborator

Arqu commented Mar 20, 2024

/netsim branch iroh-relay-cfg

1 similar comment
@Arqu
Copy link
Collaborator

Arqu commented Mar 20, 2024

/netsim branch iroh-relay-cfg

Copy link
Collaborator

@Arqu Arqu left a comment

Choose a reason for hiding this comment

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

And we need to update the release ci script

.github/ansible/redeploy-derper.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/test_relay_server.yml Outdated Show resolved Hide resolved
@ramfox ramfox force-pushed the ramfox/relay-rename branch from f1733fa to c8854b1 Compare March 21, 2024 18:42
@ramfox ramfox requested a review from Arqu March 21, 2024 19:50
@ramfox ramfox added this pull request to the merge queue Mar 21, 2024
Merged via the queue into main with commit 07c29f0 Mar 21, 2024
20 checks passed
@ramfox ramfox deleted the ramfox/relay-rename branch March 21, 2024 20:15
matheus23 pushed a commit that referenced this pull request Nov 14, 2024
…r future refactors (#2091)

## Description

We have been making breaking changes to the DERP protocol and are
planning future changes that will better take advantage of / integrate
with QUIC in our hole-punching schemes.

## Change checklist

- [x] Self-review.
- [x] Documentation updates if relevant.
- [x] Tests if relevant.

---------

Co-authored-by: Asmir Avdicevic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants