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

Fixed the node redundancy mechanism #3465

Merged
merged 3 commits into from
Sep 28, 2021

Conversation

iulianpascalau
Copy link
Contributor

@iulianpascalau iulianpascalau commented Sep 24, 2021

  • fixed the node redundancy mechanism by providing a new private key

Testing scenario:

  1. Start a new testnet, choose a validator node (we call this node A). Store its validatorKey.pem.
  2. Stop another node (doesn't matter the node - we will call it B). Provide it with the stored public key file (node's A key).
  3. Change the B's prefs.toml file, set the RedundancyLevel value to 1.
  4. Start the B node. Grep the log by the broadcasting message heartbeat message message. Should not use the public key from the provided file (should not broadcast A's public key), but a random BLS key (you can find this random key by grepping on generated BLS private key for redundancy handler).
  5. Stop node A for ~30 rounds. Grep node B's log for broadcasting message heartbeat message, should find A's public key for a couple of times.
  6. Start node A. Node B should no longer broadcast the public key of the A node.


nodeSkBytes, err := cryptoComponents.PrivateKey().ToByteArray()
require.Nil(t, err)
observerSkBytes, err := managedProcessComponents.NodeRedundancyHandler().ObserverPrivateKey().ToByteArray()
Copy link
Contributor

Choose a reason for hiding this comment

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

Go lint

@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

Merging #3465 (2e63b50) into master (203003b) will decrease coverage by 0.00%.
The diff coverage is 62.50%.

❗ Current head 2e63b50 differs from pull request most recent head 277a377. Consider uploading reports for the commit 277a377 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3465      +/-   ##
==========================================
- Coverage   73.85%   73.85%   -0.01%     
==========================================
  Files         579      579              
  Lines       73400    73407       +7     
==========================================
+ Hits        54209    54213       +4     
- Misses      14824    14825       +1     
- Partials     4367     4369       +2     
Impacted Files Coverage Δ
factory/processComponents.go 62.97% <62.50%> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 203003b...277a377. Read the comment docs.

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

System test passed.
image

@iulianpascalau iulianpascalau merged commit ac00df9 into master Sep 28, 2021
@iulianpascalau iulianpascalau deleted the fix-node-redundancy-private-key branch September 28, 2021 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants