Skip to content

stamp-revision: bound the lookups outside certifyTransaction by --timeout #18

Backlog

Description

@ahtotruu

Follow-up from the review of #16, where the conflict lookups inside certifyTransaction were brought under --timeout (2654c60).

stamp-revision makes three more proof lookups outside certifyTransaction. Each gets only the Ctrl-C signal, so a gateway that stalls on one keeps the command running past --timeout until fetch's own defaults give up:

Lookup Where When
Is this genesis already certified? createOrRecoverLineage (src/lib/LineageClient.ts) Before submitting a new lineage
Has a recovered genesis's lineage moved on? findSuccessor (src/lib/LineageClient.ts), called from assertNotSuperseded After recovering a genesis, before writing it
Was a journaled revision certified? recoverRevision (src/lib/LineageClient.ts), called from recoverKept At the start of an append for each kept journal, and again after ALREADY_CERTIFIED

--timeout is documented as the wait for the inclusion proof, so this isn't a contract violation, but a user who sets it would reasonably expect the whole command to be bounded.

Possible approach:

  • Give each of these lookups a deadline from --timeout, combined with the Ctrl-C signal, the way certifyTransaction does. Either one deadline per lookup, or one budget for the whole command; the latter is simpler to explain but changes what --timeout means.
  • Keep the outcome of a cut-off lookup the same as today's failure of that lookup:
    • createOrRecoverLineage: a timeout (SleepError, exit 3); nothing was submitted.
    • findSuccessor: the existing warning ("Could not check whether the lineage has later revisions"), and the genesis is written.
    • recoverRevision at start: a timeout, with every journal kept. After ALREADY_CERTIFIED, the journal is kept and the run still reports ALREADY_CERTIFIED, as the tolerant branch does now.
  • Tests can reuse tests/support/StallingClient.ts, whose lookups hang until their signal aborts.
  • Update the --timeout help text and the README to say what it bounds.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions