-
Notifications
You must be signed in to change notification settings - Fork 38
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
Host: replace sequencer ID config with sequencer p2p address #1885
Conversation
02f65e5
to
8766344
Compare
attestedKey *ecdsa.PublicKey | ||
storage storage.Storage | ||
} | ||
|
||
func NewSignatureValidator(seqID gethcommon.Address, storage storage.Storage) (*SignatureValidator, error) { | ||
func NewSignatureValidator(storage storage.Storage) (*SignatureValidator, error) { |
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.
This obviously v dodgy atm. Working on PR to validate the sigs against the sequencer enclave ID(s) from management contract.
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.
looks good.
Left a couple of questions
@@ -370,6 +354,15 @@ func (p *Service) handle(conn net.Conn) { | |||
} | |||
// this is an incoming request, p2p service is responsible for finding the response and returning it | |||
go p.handleBatchRequest(msg.Contents) | |||
case msgTypeRegisterForBroadcasts: |
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.
is there a mechanism to clean up the peers, in case they drop off the network?
Also, what about restarts and persistence?
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.
No persistence, I've tried to keep it quite tolerant to validators coming and going with these rules:
- if broadcast to a validator fails 3 times then the validator is removed from the pool (this cleans up validators that drop off)
- if validator doesn't receive a broadcast in a 2min period it requests to the sequencer to add it back to the pool (this would account for the sequencer getting restarted, the validators would re-register)
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.
Sounds good. But this mechanism should be highlighted or commented on in the code.
This behaviour was not obvious to me at all.
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.
LGTM!
Why this change is needed
We are removing the host p2p addresses from management contract, instead validators must be provided with the sequencer p2p address.
Also they no longer need sequencer ID in config since they will use the management contract as the source of truth for what enclave IDs are allowed to produce batches.
What changes were made as part of this PR
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks