Skip to content

Add opt-in digest validation header to detect stale server parameters #958

@bitcoin-coder-bob

Description

@bitcoin-coder-bob

Summary

GetInfo already returns a digest field (SHA256 of the JSON-marshalled response). Clients should be able to send this digest as a header on subsequent API calls so arkd can detect when they're operating with stale server parameters.

Behavior

  • Clients optionally attach an X-Ark-Digest header (or x-ark-digest gRPC metadata) to any API call.
  • If arkd sees the header and the digest doesn't match the current one, it returns a structured DIGEST_MISMATCH error (FailedPrecondition, code 48) with the current_digest in metadata, telling
    the client to re-fetch GetInfo.
  • If the header is absent, no validation occurs — completely client opt-in.
  • GetInfo itself is always exempt from validation (clients need it to obtain the digest).
  • Only public service methods (ArkService, IndexerService) are validated — admin/wallet calls are unaffected.

Metadata

Metadata

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