Add Want-Repr-Digest / Repr-Digest support to ledger-chunk endpoints#7651
Add Want-Repr-Digest / Repr-Digest support to ledger-chunk endpoints#7651eddyashton merged 19 commits intomainfrom
Conversation
…loses #7650) Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
|
@achamayou - Is there a reason this is |
No specific reason, but it's a bit of a questionable coupling, because that behaviour is specifically not affect by the Range? So it seems like a bit of functionality we want for both snapshot and ledger endpoints perhaps (probably more for the latter, where there is a clear use case). |
|
@copilot could you try to integrate with the And in case where it's a subset, you should be able to use the update_hash() to read what comes before the range, update the digest, what's in range and needs to be set in the body, update the digest, and after the range and update the digest with that too. That avoids duplicate reads, and means the snapshot endpoint download benefits from the same feature. It will needs it own test as well of course. |
|
@achamayou Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
|
@copilot can you try again please? |
…e; add snapshot test Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Moved the |
There was a problem hiding this comment.
Pull request overview
Adds RFC 9530 representation digest negotiation to snapshot and ledger-chunk download endpoints so clients can verify downloaded content (and avoid re-downloads) via Want-Repr-Digest / Repr-Digest.
Changes:
- Introduces
want-repr-digest/repr-digestheader constants and implements digest computation + selection logic in file-serving handlers. - Updates file-serving responses to include
Repr-DigestforGET/HEADwhen requested (digest covers full file even withRange). - Adds E2E tests for snapshots and ledger chunks, plus public documentation and changelog entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
include/ccf/http_consts.h |
Adds header name constants for Want-Repr-Digest / Repr-Digest. |
src/node/rpc/file_serving_handlers.h |
Parses Want-Repr-Digest, computes digest, and injects Repr-Digest header for file-serving endpoints. |
tests/e2e_operations.py |
Adds E2E coverage for Repr-Digest behavior on snapshot and ledger-chunk endpoints. |
doc/operations/ledger_snapshot.rst |
Documents new request/response header behavior and supported algorithms. |
CHANGELOG.md |
Records feature addition in the changelog. |
|
@achamayou Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: eddyashton <6000239+eddyashton@users.noreply.github.com>
- Resolve merge conflicts with Want-Repr-Digest (#7651) changes - Fix ETag check to handle both HTTP 200 OK (no Range) and 206 Partial Content (with Range) from fill_range_response_from_file() - Merge CHANGELOG, docs, and header constant additions Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Closes #7650
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.