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

Implement peer re-negotiation #2868

Closed
Geod24 opened this issue Jan 18, 2022 · 2 comments · Fixed by #3080
Closed

Implement peer re-negotiation #2868

Geod24 opened this issue Jan 18, 2022 · 2 comments · Fixed by #3080
Assignees
Labels
C. Network Communication An issue which is related to network communication

Comments

@Geod24
Copy link
Collaborator

Geod24 commented Jan 18, 2022

It is possible for one of our peers to change stake:

auto enroll_key = this.enroll_man.getEnrollmentKey();
Identity id = Identity(this.config.validator.key_pair.address,
enroll_key == Hash.init ? this.getFrozenUTXO() : enroll_key);

For example, in the following set of events:

At any point, the node might establish connections, meaning it can be seen from different clients with different, potentially outdated, stakes.
Currently there is no way to re-negotiate a connection (re-do the 'handshake'), nor is there a clean way to tear-down all connections and restart them.

@Geod24 Geod24 added the C. Network Communication An issue which is related to network communication label Jan 18, 2022
@Geod24 Geod24 added this to the 6. Stabilization milestone Jan 18, 2022
@Geod24
Copy link
Collaborator Author

Geod24 commented Jan 18, 2022

To do this, we might have to dig into both the RPC client and Vibe.d.
It's acceptable to only implement it for the RPC client for now if necessary, but it will need to also work with Localrest.

The first step I was looking into was subclassing RestInterfaceClient, but it's only useful if we can have a persistent connection, which means storing the HTTPClient, which is not currently the case:
https://github.com/vibe-d/vibe.d/blob/b3818391b397616b20dd0c9b842e369b1e74a6d6/web/vibe/web/rest.d#L2051-L2053

Called from:
https://github.com/vibe-d/vibe.d/blob/b3818391b397616b20dd0c9b842e369b1e74a6d6/web/vibe/web/rest.d#L822-L824

Which is a method we could override, but currently we'd need to copy-paste a lot of code to make it work.

@omerfirmak
Copy link
Contributor

nor is there a clean way to tear-down all connections and restart them.

I am wondering if LocalRest channels could be used to make this easier to implement, a dynamic set of peers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C. Network Communication An issue which is related to network communication
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants