Skip to content

refactor: remove act from chunk and soc api - #5572

Open
akrem-chabchoub wants to merge 2 commits into
masterfrom
act-removal-5469
Open

refactor: remove act from chunk and soc api#5572
akrem-chabchoub wants to merge 2 commits into
masterfrom
act-removal-5469

Conversation

@akrem-chabchoub

@akrem-chabchoub akrem-chabchoub commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Remove ACT support from /chunks and /soc

ACT never worked correctly on these two endpoints, the data isn't encrypted and, for /soc, there's no way to decrypt the reference back. Removed Swarm-Act handling from both, bumped the API version, and updated tests accordingly.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

#5469

Screenshots (if appropriate):

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

@akrem-chabchoub akrem-chabchoub self-assigned this Aug 24, 2026
@akrem-chabchoub akrem-chabchoub added this to the 2026 milestone Aug 24, 2026
@akrem-chabchoub akrem-chabchoub linked an issue Aug 24, 2026 that may be closed by this pull request
Comment thread openapi/Swarm.yaml Outdated
Comment thread pkg/api/chunk.go
return
}

address := paths.Address

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.

We removed ACT from POST /chunks, but GET /chunks/{address} and HEAD /chunks/{address} are still wrapped with s.actDecryptionHandler() in pkg/api/router.go, and chunkGetHandler / hasChunkHandler still have the context address resolution:

if v := getAddressFromContext(r.Context()); !v.IsZero() {
    address = v
}

Additionally, openapi/Swarm.yaml still lists Swarm-Act-Timestamp, Swarm-Act-Publisher, and Swarm-Act-History-Address on GET /chunks/{address} and HEAD /chunks/{address}.

If ACT is fundamentally unsupported on raw chunks because they are unencrypted and low-level, shouldn't we remove ACT middleware and parameters from GET and HEAD /chunks/{address} as well? Otherwise, we have an asymmetrical API that accepts ACT on download/head but not upload, without any test coverage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The ACT headers remain on GET/HEAD /chunks/{address} by design. These requests go through actDecryptionHandler, the same middleware used by GET/HEAD /bytes/{address} and /bzz/{address}/{path}.

This middleware is required to resolve ACT wrapped addresses to their actual addresses when the content was encrypted during upload through POST /bytes or POST /bzz.

Accessing chunks from such encrypted uploads through the low level chunk API is still a valid use case, so the decryption path must remain.

Comment thread openapi/Swarm.yaml
default:
description: Default response

"/chunks/{address}":

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.

Under GET /chunks/{address} and HEAD /chunks/{address}, the ACT parameters are still present:

SwarmActTimestamp
SwarmActPublisher
SwarmActHistoryAddress
If we are cleaning up ACT from the chunks API, these should be removed from the OpenAPI spec as well (along with removing actDecryptionHandler from router.go).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as above:
The ACT headers remain on GET/HEAD /chunks/{address} by design. These requests go through actDecryptionHandler, the same middleware used by GET/HEAD /bytes/{address} and /bzz/{address}/{path}.

This middleware is required to resolve ACT wrapped addresses to their actual addresses when the content was encrypted during upload through POST /bytes or POST /bzz.

Accessing chunks from such encrypted uploads through the low level chunk API is still a valid use case, so the decryption path must remain.

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.

Remove ACT support from SOC and chunk endpoints

4 participants