Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Don't add 1 weight to both sides of connections we're relaying #120

Open
Stebalien opened this issue Jun 5, 2020 · 6 comments
Open

Don't add 1 weight to both sides of connections we're relaying #120

Stebalien opened this issue Jun 5, 2020 · 6 comments
Assignees

Comments

@Stebalien
Copy link
Member

When relaying a connection between two peers, we currently add 1 weight in the connection manager to both connections involved. Instead, we should just give peers using us a flag weight of 1 total.

@vyzo
Copy link
Contributor

vyzo commented Jun 5, 2020

Not sure what you mean here -- shouldn't both connections get some weight?

@vyzo
Copy link
Contributor

vyzo commented Jun 5, 2020

Note that the rules for the relays themselves are quite different from normal node; we want to preserve the connections with the highest load.

@vyzo
Copy link
Contributor

vyzo commented Jun 5, 2020

Also note that we can't assign fractional values to tags (say 0.5), so this can't work.

@Stebalien
Copy link
Member Author

IMO, all users of a relay should be considered equal. Otherwise, an abuser could make a bunch of fake relay connections to boost their score.

Honestly, we should probably prefer peers with fewer connections.

@vyzo
Copy link
Contributor

vyzo commented Jun 6, 2020

I can make it upsert tags up to (say) 10, and above that overflow to an internal counter for house keeping activities (ie when to upser the tag to 0).
This way peers with a number of relay connections get a small boost, but once they have enough connections they are considered equal.

@Stebalien
Copy link
Member Author

SGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants