Skip to content

feat: add the /ucan/revoke/batch command - #90

Closed
bajtos wants to merge 1 commit into
mainfrom
claude/hilt-swarf-batch-revocation-475ab8
Closed

bajtos wants to merge 1 commit into
mainfrom
claude/hilt-swarf-batch-revocation-475ab8

Conversation

@bajtos

@bajtos bajtos commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Written by Claude.

Add /ucan/revoke/batch, which revokes several delegations with one invocation.

Hilt revokes every delegation a bucket policy write replaces, inside an 8 s deadline. It sends one /ucan/revoke invocation per delegation today, and Swarf verifies and stores each one separately; on staging, 1,239 revocations took 10.05 s and the write failed. With one invocation per batch, Swarf can verify the whole list and store it with a single statement.

What changes

RevokeBatchArguments holds a list of RevokeArguments, so each entry has the same revoke and optional path as /ucan/revoke, and a witness-path revocation can be batched too. /ucan/revoke stays as the UCAN revocation spec defines it. The service rejects the batch when any revocation in it is invalid.

A codec test pins the DAG-JSON shape of a batch holding a direct revocation and a witness-path one.

Rollout

This is the first of four PRs. The others pin this branch's commit and re-pin to main once this merges:

  1. This PR.
  2. FIL-1646 Revoke a batch of delegations with one invocation swarf#28: Swarf serves the command and stores a batch with one statement.
  3. FIL-1646 Stream every record of a revocation batch ingot#329: Ingot takes the Swarf client that streams every record of a batch.
  4. FIL-1646 perf(grant): revoke a batch with one invocation hilt#120: Hilt publishes batches through the new client.

Hilt revokes dozens of delegations in one bucket policy write and today
sends one `/ucan/revoke` invocation per delegation. Swarf verifies and
stores each invocation separately, and that time counts against Hilt's
write deadline.

`/ucan/revoke/batch` carries a list of revocations, each with the same
`revoke` and optional `path` as `/ucan/revoke`, so the service can
verify the whole list and store it with one write. The service rejects
the batch when any revocation in it is invalid.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 17:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T17:24:47.448044Z c769768 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟢 Approval recommended

The change cleanly adds and wires a new batch revoke command with corresponding generated DAG-JSON/CBOR codecs and a round-trip wire-shape test, and the review notes no outstanding issues requiring further investigation.

No open issues 🎉

2 files not reviewed
  • commands/ucan/cbor_gen.go: Generated file
  • commands/ucan/json_gen.go: Generated file
What changed in this PR

Adds a new UCAN command, /ucan/revoke/batch, enabling multiple delegations to be revoked in a single invocation so downstream services can validate and persist the revocations as one unit (reducing per-revocation overhead vs repeated /ucan/revoke calls).

Changes:

  • Introduces RevokeBatchArguments to carry a list of RevokeArguments revocations.
  • Registers/binds the new /ucan/revoke/batch command alongside existing /ucan/revoke.
  • Extends generated DAG-JSON and CBOR codecs for RevokeBatchArguments, plus a codec test pinning the DAG-JSON wire shape for a mixed batch.

This pull request requires changes.

File Summary
commands/​ucan/​types.go Adds the RevokeBatchArguments wire type (batch of RevokeArguments).
commands/​ucan/​revoke.go Binds/registers the new /ucan/revoke/batch command.
commands/​ucan/​json_gen.go Adds generated DAG-JSON codec support for RevokeBatchArguments; fix needed where a value-range loop calls RevokeArguments.MarshalDagJSON (pointer receiver) on a non-addressable range variable—iterate by index or take addresses.
commands/​ucan/​gen/​main.go Registers RevokeBatchArguments for codec generation.
commands/​ucan/​codec_test.go Adds a test pinning the DAG-JSON shape and round-tripping codecs for a mixed (direct + witness-path) batch.
commands/​ucan/​cbor_gen.go Adds generated CBOR codec support for RevokeBatchArguments; fix needed where a value-range loop calls RevokeArguments.MarshalCBOR (pointer receiver) on a non-addressable range variable—iterate by index or take addresses.

Review effort: Balanced

@bajtos

bajtos commented Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

Closing in favour of fil-forge/ucantone#76

@bajtos bajtos closed this Nov 3, 2026
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.

2 participants