Skip to content

SYN-37: serve NodeTypeFileV2 nodes in NetworkConfiguration - #130

Closed
cheggaaa wants to merge 11 commits into
mainfrom
files-v2
Closed

cheggaaa wants to merge 11 commits into
mainfrom
files-v2

Conversation

@cheggaaa

@cheggaaa cheggaaa commented Jul 2, 2026

Copy link
Copy Markdown
Member

Maps nodeconf.NodeTypeFileV2 to coordinatorproto.NodeType_FileV2API in the NetworkConfiguration response, so clients discover the fileV2 broker fleet through the coordinator like every other node type. Additive and back-compatible: networks without fileV2 nodes are unaffected, and older clients treat the unknown enum value as an unknown node type.

Covered by rpchandler_test.go (fileV2 nodes appear in the response with the right type) and the nodeconfsource fixture; full suite green. Running in the local files-v2 dev network since 2026-07-02 (coordinator db28c31), where it serves the SDK's files byte layer end to end.

Draft until any-sync ships: the mapping needs NodeTypeFileV2/FileV2API, which today exist only on any-sync files-v2 — so this PR pins any-sync v0.12.14-0.20260702125210-fd5ee1f7 (a branch pseudo-version), while main pins released v0.11.20. Before marking ready: land any-sync files-v2 in a tagged release and bump the pin here to that release.

🤖 Generated with Claude Code

…ileV2 in NetworkConfiguration

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@socket-security

socket-security Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub.com/​anyproto/​any-sync@​v0.12.15 ⏵ v0.13.0-alpha.5.0.20260715171821-b76e9c632c8a74 +110010010070
Updatedgithub.com/​ipfs/​go-cid@​v0.6.1 ⏵ v0.6.2100100100100100

View full report

@socket-security

socket-security Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: golang golang.org/x/tools is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ? → golang/go.mongodb.org/mongo-driver@v1.17.9 → golang/github.com/ipfs/go-cid@v0.6.2 → golang/github.com/anyproto/any-sync@v0.13.0-alpha.5.0.20260715171821-b76e9c632c8a → golang/github.com/anyproto/go-chash@v0.1.0 → golang/go.uber.org/mock@v0.6.0 → golang/github.com/prometheus/client_golang@v1.23.2 → golang/golang.org/x/tools@v0.48.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore golang/golang.org/x/tools@v0.48.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@github-actions

github-actions Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

New Coverage 59.3% of statements
Patch Coverage 67.9% of changed statements (89/131)

Coverage provided by https://github.com/seriousben/go-patch-cover-action

cheggaaa and others added 10 commits July 3, 2026 11:45
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The fileV2 fleet signs durability receipts with one shared key; clients
verify against its public identity, the fileNetworkId, delivered via
NetworkConfiguration. Carry it through the whole mongo path:

- ConfModel gains fileNetworkId (bson, omitempty) — confapply picks it
  up from the network yml via nodeconf.Configuration and Add persists it
- GetLast returns it, the NetworkConfiguration RPC serves it
- any-sync v0.13.0-alpha.2 (proto field + client-side mapping)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…FileLimitsGet/FileUsageReport (SYN-19)

fileV2 brokers push absolute per-(space, identity) durable usage rows
and pull account-pool bounds to authorize uploads locally:

- fileusage component: (spaceId, identity)-keyed docs with per-node
  reports; slice usage = MAX over unexpired (1h) reports from the
  current chash pair, falling back to the newest report so resharding
  or expiry never under-counts; identity total summed on read.
- membership enforced coordinator-side: rows from non-responsible
  nodes are dropped (a stale-nodeconf node can't pin usage).
- RPC handlers restricted to NodeTypeFileV2 peers.
- spacestatus: RegisterSpaceRemoveHook runs in the StatusRemove
  transaction; fileusage drops the space's rows atomically with the
  deletion-log entry. Ownership change stays a quota no-op.
- accountlimit: config default fileStorageLimitBytes for identities
  without an explicit accountLimit document.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoLHZmQFxyhxDkkwJ7Y1jX
feat(fileusage): files-v2 storage limits — usage store, aggregation, limits RPCs (SYN-19)
… into files-v2

# Conflicts:
#	coordinator/rpchandler.go
#	go.mod
#	go.sum
@cheggaaa

Copy link
Copy Markdown
Member Author

Superseded — the SYN-37 work landed on main in db28c31 (NodeTypeFileV2 → NodeType_FileV2API in NetworkConfiguration) and shipped in v0.13.0. The only commits left on this branch are a 4-line inboxrpctest mock that main already carries and an any-sync pin to a dev commit, now superseded by the released v0.13.1.

@cheggaaa cheggaaa closed this Aug 18, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants