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

Use checkpoint sigs from batches without waiting for a commit #12880

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

mystenmark
Copy link
Contributor

On a local cluster this appears to reduce checkpoint_summary_age_ms p50 from ~2000ms to ~600ms

@mystenmark mystenmark requested review from andll and mwtian July 7, 2023 15:24
@vercel
Copy link

vercel bot commented Jul 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

6 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Jul 7, 2023 6:02pm
explorer-storybook ⬜️ Ignored (Inspect) Jul 7, 2023 6:02pm
multisig-toolkit ⬜️ Ignored (Inspect) Jul 7, 2023 6:02pm
sui-kiosk ⬜️ Ignored (Inspect) Jul 7, 2023 6:02pm
sui-wallet-kit ⬜️ Ignored (Inspect) Jul 7, 2023 6:02pm
wallet-adapter ⬜️ Ignored (Inspect) Jul 7, 2023 6:02pm

// All checkpoint sigs have been verified, forward them to the checkpoint service
for ckpt in ckpt_messages {
self.checkpoint_service
.notify_checkpoint_signature(&self.epoch_store, &ckpt)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unlike in consensus_handler, we have not verified that the sender matches the name in the checkpoint sig. Is this important? If so, I need some advice on how to find the originator of the batch here.

Copy link
Contributor

Choose a reason for hiding this comment

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

To be honest it don't seem that important to me - after all it's a valid signature, sure it's suspicious/odd that a node is distributing someone else's signature but I don't see a security issue or something. The batch it self doesn't contain the originator, so we'll need to inject that , off the top of my head, via two places:

  • when it gets broadcasted by the source
  • when is requested from the source

but it might not worth the effort

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think since we checked signature validity, it does not matter who sent it

Copy link
Contributor

@andll andll left a comment

Choose a reason for hiding this comment

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

Wow, that's a huge win!

Copy link
Contributor

@akichidis akichidis left a comment

Choose a reason for hiding this comment

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

Great improvement!

@mystenmark mystenmark enabled auto-merge (squash) July 7, 2023 16:13
@@ -1791,6 +1791,9 @@ impl AuthorityPerEpochStore {
kind: ConsensusTransactionKind::CheckpointSignature(info),
..
}) => {
// We usually call notify_checkpoint_signature in SuiTxValidator, but that step can
// be skipped when a batch is already part of a certificate, so we must also
Copy link
Contributor

@mwtian mwtian Jul 7, 2023

Choose a reason for hiding this comment

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

nit: since this file is part of Sui, maybe specify these are Narwhal batch and Narwhal certificate to avoid confusion with Sui certificate.

@mystenmark mystenmark force-pushed the mlogan-checkpoint-sig-latency branch from fbbacb8 to fbf9898 Compare July 7, 2023 18:02
@mystenmark mystenmark merged commit 2dfd307 into main Jul 7, 2023
@mystenmark mystenmark deleted the mlogan-checkpoint-sig-latency branch July 7, 2023 18:23
ebmifa pushed a commit that referenced this pull request Jul 12, 2023
On a local cluster this appears to reduce checkpoint_summary_age_ms p50
from ~2000ms to ~600ms
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.

4 participants