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

Fix authorized nodes unavailability #317

Merged
25 commits merged into from
Jun 2, 2022
Merged

Conversation

ghost
Copy link

@ghost ghost commented May 12, 2022

Description

This PR aims to resolve issue regarding nodes which become unavailable and try to rejoin later while the node shared secrets have been performed since.

But once the node is coming back it should be able to load missed transactions without issue regarding election or shared secrets

Fixes #318

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Start few nodes and wait they become authorized
  • Stop one
  • Wait this node becomes unavailable
  • Wait other nodes perform shared secrets transactions
  • Start the paused node
  • It should be able to decode the missed transactions and start validate transaction again

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ghost ghost added bug Something isn't working P2P Involve P2P networking mining Involve transaction validation and mining labels May 12, 2022
@ghost ghost force-pushed the fix_authorized_nodes_unavailability branch 4 times, most recently from 0daad8f to ffff4c2 Compare May 16, 2022 15:50
@ghost ghost marked this pull request as ready for review May 16, 2022 17:21
@ghost ghost requested a review from Neylix May 16, 2022 17:22
@ghost ghost force-pushed the fix_authorized_nodes_unavailability branch from ffff4c2 to a874ade Compare May 17, 2022 19:43
@ghost ghost force-pushed the fix_authorized_nodes_unavailability branch 3 times, most recently from 731484a to a8a5726 Compare May 25, 2022 22:47
@ghost ghost requested a review from Neylix May 27, 2022 08:46
@apoorv-2204
Copy link
Contributor

@Neylix I think We can test this on 3 node network.

@ghost ghost force-pushed the fix_authorized_nodes_unavailability branch from a8a5726 to 75e3e48 Compare May 31, 2022 16:09
@apoorv-2204
Copy link
Contributor

Soo many changes and Soo many commits.

@ghost ghost force-pushed the fix_authorized_nodes_unavailability branch from c25bd62 to 366d0dd Compare June 2, 2022 08:47
Samuel added 2 commits June 2, 2022 10:48
We want to list the previous authorized nodes in the node shared secrets
to ensure the distribution of the daily nonce.
So in case of unavailability a previous authorized node will be able to
sync again when it joins back.
Because we are listing all the authorized nodes (previous + new) in
the shared secrets transaction, we want to avoid implication of
unavailable nodes in the transaction validation.
Samuel added 17 commits June 2, 2022 10:51
By using a custom FSM implementation instead of Connection based
we have more control of how the connection is managed and the message
transmitted

Switch to full asynchronous message and managing timeout differently
using gen_statem timeout and receive timeout.
If the node is disconnected for a certain time,
it should not load the last P2P summary view and prevent to emit
new transaction as authorized node
This prevent invalid replication attestation signature in case of
all the authorized nodes are down except one, so we have to keep
replicas position in match even if there are not present nodes
@ghost ghost force-pushed the fix_authorized_nodes_unavailability branch from 366d0dd to 347f43e Compare June 2, 2022 08:53
@ghost ghost merged commit 46ae7b6 into develop Jun 2, 2022
@ghost ghost deleted the fix_authorized_nodes_unavailability branch June 2, 2022 09:01
@apoorv-2204
Copy link
Contributor

Wait its done??? so fast?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mining Involve transaction validation and mining P2P Involve P2P networking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants