Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Improve the way a node load the nodes into the memtable.
Currently when a node bootstraps, it request the node view from the bootstrapping nodes and add this view into the memtable. But if the node needs to do a bootstrap sync to repair the missed beacon summaries, this view may not be the good one and the self repair verification crashes. Also the node may have into its memtable some nodes that doesn't exists according to the last beacon summaries the node has synchronized.
To fix this I assumed that a node or its informations should be in the memtable only if the according transaction has been replicated. So when a node bootstrap it now request the current node view to be able to download what it needs, but only connect to these node but doesn't add them into the memtable. The only needed node in the memtable is the first enrolled node (to pass the self repair verification)
Here is major changes:
P2P.authorized_and_available_nodes
(since the memtable is empty)ListNodes
now has an parameter to return only the authorized and available nodes (do not need other node when bootstrapping)/!\ Attention: This PR breaks a control that avoid an already connected node to overwrite the node connection informations and restart the connection with old informations. This will be fixed in other PR (to simplify review)
Type of change
Bug fix (non-breaking change which fixes an issue)
Starts 4 nodes and wait authorized and available
Stop one in beginning of summary (the transaction of this summary will be signed by the other 3 nodes)
At beginning of next summary stop another node
When the other node goes globally unavailable, restart the first stopped node
Without the fix the restarted node cannot do its bootstrap_sync as it has only 2 available nodes in it's view (the 2 remaining up node) but the summary contains transaction signed by 3 nodes
With the fix it restart using it's last known P2P view (3 nodes) but use only the 2 remaining nodes to download thing. And the self repair verification works well
Checklist: