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

Host: replace sequencer ID config with sequencer p2p address #1885

Merged
merged 5 commits into from
Apr 29, 2024

Conversation

BedrockSquirrel
Copy link
Collaborator

@BedrockSquirrel BedrockSquirrel commented Apr 26, 2024

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

  • Remove sequencer ID from config
  • Add sequencer address to config
  • Update P2P to register for broadcasts with the sequencer
  • Update management contract to remove the host address references

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

@BedrockSquirrel BedrockSquirrel force-pushed the matt/seq-address-from-config branch from 02f65e5 to 8766344 Compare April 26, 2024 10:02
attestedKey *ecdsa.PublicKey
storage storage.Storage
}

func NewSignatureValidator(seqID gethcommon.Address, storage storage.Storage) (*SignatureValidator, error) {
func NewSignatureValidator(storage storage.Storage) (*SignatureValidator, error) {
Copy link
Collaborator Author

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.

Copy link
Collaborator

@tudor-malene tudor-malene left a 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:
Copy link
Collaborator

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?

Copy link
Collaborator Author

@BedrockSquirrel BedrockSquirrel Apr 29, 2024

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)

Copy link
Collaborator

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.

Copy link
Collaborator

@tudor-malene tudor-malene left a comment

Choose a reason for hiding this comment

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

LGTM!

@BedrockSquirrel BedrockSquirrel merged commit bd9a9cf into main Apr 29, 2024
3 checks passed
@BedrockSquirrel BedrockSquirrel deleted the matt/seq-address-from-config branch April 29, 2024 14:06
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.

2 participants