-
Notifications
You must be signed in to change notification settings - Fork 204
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
Peer authentication sender factory #4414
Conversation
|
||
func (pasf *peerAuthenticationSenderFactory) createMultikeyPeerAuthenticationSender() (*multikeyPeerAuthenticationSender, error) { | ||
args := argMultikeyPeerAuthenticationSender{ | ||
argBaseSender: argBaseSender{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could have extracted a function createBaseSenderArgs
and use it in the both functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed anymore with latest push
return nil, fmt.Errorf("%w for peerAuthenticationSenderFactory, could not determine node's type", heartbeat.ErrInvalidConfiguration) | ||
_, _, err = args.nodesCoordinator.GetValidatorWithPublicKey(pkBytes) | ||
if err == nil { | ||
return createRegularSender(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a check here for len(keysMap)
and allow to create the regular peer only if that len is 0. Otherwise we should output error
…ests, partially integrated the sender parameters into heartbeat v2 components
factory/heartbeatV2Components.go
Outdated
@@ -142,6 +143,9 @@ func (hcf *heartbeatV2ComponentsFactory) Create() (*heartbeatV2Components, error | |||
HardforkTrigger: hcf.processComponents.HardforkTrigger(), | |||
HardforkTimeBetweenSends: time.Second * time.Duration(cfg.HardforkTimeBetweenSendsInSec), | |||
HardforkTriggerPubKey: hcf.coreComponents.HardforkTriggerPubKey(), | |||
KeysHolder: &testscommon.KeysHolderStub{}, // TODO: use the real component once it is completely integrated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use mock / test packages in production code. Please create a disabled
package somewhere, alongside with a disabledKeysHolder
and use this instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, let's pass the real component here. Should be created & stored in crypto components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed the integration into crypto components
cmd/node/config/config.toml
Outdated
@@ -486,6 +486,10 @@ | |||
MaxRoundsToKeepUnprocessedMiniBlocks = 300 # max number of rounds unprocessed miniblocks are kept in pool | |||
MaxRoundsToKeepUnprocessedTransactions = 300 # max number of rounds unprocessed transactions are kept in pool | |||
|
|||
[KeysHolderConfig] | |||
IsMainMachine = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we have a separate configuration? Couldn't this be determined based on the redundancy level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have this in prefs.toml file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the MaxRoundsWithoutReceivedMessages is actually the RedundancyLevel value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed
factory/cryptoComponents.go
Outdated
@@ -167,6 +174,19 @@ func (ccf *cryptoComponentsFactory) Create() (*cryptoComponents, error) { | |||
return nil, err | |||
} | |||
|
|||
blsKeyGenerator := signing.NewKeyGenerator(mcl.NewSuiteBLS12()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be created based on a config? similar to factory/cryptoComponents.getSuite()
cmd/node/config/config.toml
Outdated
@@ -486,6 +486,10 @@ | |||
MaxRoundsToKeepUnprocessedMiniBlocks = 300 # max number of rounds unprocessed miniblocks are kept in pool | |||
MaxRoundsToKeepUnprocessedTransactions = 300 # max number of rounds unprocessed transactions are kept in pool | |||
|
|||
[KeysHolderConfig] | |||
IsMainMachine = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have this in prefs.toml file
cmd/node/config/config.toml
Outdated
@@ -486,6 +486,10 @@ | |||
MaxRoundsToKeepUnprocessedMiniBlocks = 300 # max number of rounds unprocessed miniblocks are kept in pool | |||
MaxRoundsToKeepUnprocessedTransactions = 300 # max number of rounds unprocessed transactions are kept in pool | |||
|
|||
[KeysHolderConfig] | |||
IsMainMachine = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the MaxRoundsWithoutReceivedMessages is actually the RedundancyLevel value
factory/cryptoComponents.go
Outdated
@@ -167,6 +174,19 @@ func (ccf *cryptoComponentsFactory) Create() (*cryptoComponents, error) { | |||
return nil, err | |||
} | |||
|
|||
blsKeyGenerator := signing.NewKeyGenerator(mcl.NewSuiteBLS12()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of this, we should use the blockSignKeyGen
@@ -15,7 +15,7 @@ import ( | |||
"github.com/ElrondNetwork/elrond-go/config" | |||
) | |||
|
|||
const minRoundsWithoutReceivedMessages = 1 | |||
const minRoundsWithoutReceivedMessages = -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might refactor this in a future PR and re-check the logic.
Description of the reasoning behind the pull request (what feature was missing / how the problem was manifesting itself / what was the motive behind the refactoring)
Proposed Changes
Testing procedure