Skip to content

Add retry mechanism for payload envelope DB persistence #9072

Open

Description

@lodekeeper

Context

In persistPayloadEnvelopeInput(), a DB write failure causes the in-memory PayloadEnvelopeInput to be pruned via .finally(), losing data from both DB and memory with no recovery path. This is the same pattern as persistBlockInput().

Current behavior

await writePayloadEnvelopeInputToDb.call(this, payloadInput)
  .catch((e) => {
    this.logger.error("Error persisting payload envelope in hot db", {...}, e);
  })
  .finally(() => {
    this.seenPayloadEnvelopeInput.prune(payloadInput.blockRootHex);
    // ...
  });

On a transient DB error (disk full, I/O timeout), .catch() logs the error but .finally() still prunes the in-memory data. The envelope is now gone from both DB and memory — irrecoverable.

Proposed fix

  1. Only prune on success (move prune from .finally() to .then())
  2. Add a retry mechanism for transient failures (exponential backoff, bounded retries)
  3. Apply the same fix to persistBlockInput() which has the identical pattern

References

/cc @nflaig @twoeths

Activity

  1. changed the title [-]EPBS: add retry mechanism for payload envelope DB persistence[/-] [+]Add retry mechanism for payload envelope DB persistence[/+] on Mar 20, 2026
  2. added this to the Glamsterdam milestone on Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions