Skip to content

vault: poll for DKG result in NewReportingPlugin (~12s startup speedup)#21710

Merged
prashantkumar1982 merged 1 commit intodevelopfrom
vault-plugin-poll-dkg
Mar 26, 2026
Merged

vault: poll for DKG result in NewReportingPlugin (~12s startup speedup)#21710
prashantkumar1982 merged 1 commit intodevelopfrom
vault-plugin-poll-dkg

Conversation

@prashantkumar1982
Copy link
Copy Markdown
Contributor

@prashantkumar1982 prashantkumar1982 commented Mar 25, 2026

Summary

Performance improvement: saves ~12 seconds from vault oracle startup.

When the vault OCR3.1 oracle starts before DKG completes, NewReportingPlugin fails immediately because the DKG result isn't in the DB yet. This triggers libocr's exponential backoff (1s, 2s, 4s, 8s, 13s…), wasting ~12s even after DKG finishes.

Change

Add pollForKeyMaterial() that polls the DB every 2s within libocr's MaxDurationInitialization window (10s), instead of failing immediately. The vault oracle now starts within ~2s of DKG completion rather than waiting for the next backoff cycle.

Impact

From local CRE log analysis:

  • Before: DKG result available at T+69s, vault oracle ready at T+81s (12s wasted in backoff)
  • After: DKG result available at T+69s, vault oracle ready at ~T+71s

Eliminates the occasional first-request timeout in vault E2E tests.

…mmediately

When the vault OCR3.1 oracle starts before DKG completes, NewReportingPlugin
fails because the DKG result package is not yet in the database. This triggers
libocr exponential backoff (1s, 2s, 4s, 8s... up to 2min), wasting ~12s even
after the DKG result becomes available.

Add pollForKeyMaterial() that polls the DB every 2s within the
MaxDurationInitialization context window (10s). The vault oracle now starts
within seconds of DKG completion instead of waiting for the next retry cycle.

Made-with: Cursor
@github-actions
Copy link
Copy Markdown
Contributor

👋 prashantkumar1982, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@prashantkumar1982 prashantkumar1982 changed the title vault: poll for DKG result in NewReportingPlugin to eliminate startup delay vault: poll for DKG result in NewReportingPlugin (~12s startup speedup) Mar 25, 2026
@cl-sonarqube-production
Copy link
Copy Markdown

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Mar 25, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@prashantkumar1982 prashantkumar1982 added this pull request to the merge queue Mar 26, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 26, 2026
@prashantkumar1982 prashantkumar1982 added this pull request to the merge queue Mar 26, 2026
Merged via the queue into develop with commit e1debcf Mar 26, 2026
208 of 210 checks passed
@prashantkumar1982 prashantkumar1982 deleted the vault-plugin-poll-dkg branch March 26, 2026 00:52
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.

3 participants