Repository navigation
feat(workspace): merge sponsord into the decdn workspace - #2544
Merged
Merged
Conversation
Adds the persistent Store mapping (client, node_id) -> channel_id idempotently and tracking per-client monthly spend, per task-3-brief. redb 2.6.3 has no Value impl for Vec<u8> (only &[u8], fixed-size arrays, and primitives), so the channels table uses &[u8] as its value type instead of the brief's Vec<u8>; on-disk encoding and the public interface are unchanged.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Adds the Treasury trait (mocked by FakeTreasury in HTTP-layer tests) and DecdnTreasury, which reuses decdn's client-pull open/allowance kernel to open and top up USDC payment channels from a hot wallet. Reading the real client-pull source confirmed two things the brief left approximate: PaymentChannel.getChannel's escrow field is ch.deposit (the guess was right), but decdn_client_pull::buyer_channel::top_up requires a BuyerChannelStore this crate doesn't have, so top_up_to calls the generated PaymentChannel.topUp binding directly instead of that helper.
Split crates/server into a lib (sponsord) + thin bin so integration tests can import money/store/cap/topup_auth/captcha/treasury. Add a feature-gated (anvil-e2e) chain_treasury.rs that launches decdn_e2e::ChainFixture, onboards a bonded provider operator, funds a treasury wallet, connects DecdnTreasury, and asserts open()/top_up_to() move the on-chain PaymentChannel deposit. Co-Authored-By: Claude Opus 4.8 <[email protected]>
ServerConfig::from_env loads SPONSOR_* vars; build_treasury bridges to Task 7's TreasuryConfig/connect without changing that signature. AppState omits discovery (Task 10 adds it).
Task 11: implement the frozen HTTP contract over injectable fakes. CaptchaVerifier and ProviderResolver traits let AppState hold trait objects (matching Treasury's existing shape) so the new http_contract integration test can exercise /fund, /channel, and /topup against FakeTreasury/FakeCaptcha/FakeResolver instead of live Cloudflare/chain calls. main.rs now serves the router instead of the Task-8 spike.
…ut of release Retry insert_channel after a successful treasury.open to close the double-spend window on a failed persist, add real-signer topup happy-path coverage, move test_support out of the shipped lib/bin via tests/-only #[path] inclusion, and log discarded cap_refund failures.
Deny unwrap_used/expect_used/panic/indexing_slicing workspace-wide, matching decdn's mechanical anti-panic policy. All fallout was confined to test code (no production violations found); scoped allows added at the narrowest test module/file level. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ties Replace the per-user PaymentChannel open/topup/reclaim model with a single config-provided pool: POST /fund signs an EIP-712 capability and returns a dcap1: token, GET /capability polls for it, and pool_watch tops the pool up when its on-chain balance drops below the low-water mark. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
…nt + captcha/hex guards Co-Authored-By: Claude Opus 4.8 <[email protected]>
…er check Co-Authored-By: Claude Opus 4.8 <[email protected]>
…#73) * feat(onramp): pass flags after -- to bundle pull and accept decdn:// URIs decdn.sh and decdn.ps1 append everything after `--` (quoted as '--' in PowerShell) to the `decdn bundle pull` call unchanged, so users can set flags such as --jobs or --include. `pull decdn://<namespace>/<hash>` is shorthand for `<hash> --namespace <namespace>`, so a website can print a single link. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(onramp): pass unknown flags to bundle pull without a separator The first flag the installers do not take, and everything after it, goes to `decdn bundle pull`, so users write `pull <hash> --jobs 8` instead of `pull <hash> -- --jobs 8`. This also removes the PowerShell caveat of quoting the separator. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(onramp): drop the decdn:// shorthand from the installers A decdn:// scheme is decdn's to define, and once the installers accept it, published commands depend on it for good. `<hash> --namespace <id>` says the same, so the installers keep only the flag passthrough. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(onramp): pass every installer argument but the hash to bundle pull The installers find the first hash-shaped argument, add `-o .` when no output flag is given, and hand everything else to `decdn bundle pull`, which already checks -o and --namespace. The hash can appear anywhere, so every command that worked before builds the same call. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(onramp)!: require the hash as the installers' first argument The installers no longer search the arguments for a hash: it must follow `pull`, and everything after it goes to `decdn bundle pull`. This rules out a 64-hex flag value being taken for the hash. A command that puts -o or --namespace before the hash is now refused. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
#2449 replaces decdn fetch and decdn bundle pull with decdn get, which takes a decdn: URI. The installers follow: the one-liner is get 'decdn:<hash>/[<path>][?ns=<id>]' [-o <dir>] [<decdn get flags>]. The URI goes to decdn get as given; the installer reads only its hash, which keys the download's state, and requires the trailing / of a bundle URI. Co-authored-by: Claude Opus 5.5 <[email protected]>
* build: pin decdn to v0.1.0 Lock the decdn crates at decdn's v0.1.0 release tag (538bf31) instead of v0.0.4 (2a75f66), and require 0.1.0, which is on crates.io. * test: pass no UnconfirmedOpens handle to decdn 0.1's open_pool decdn v0.1.0 added an `opens: Option<&UnconfirmedOpens>` argument to `decdn_client::buyer_pool::open_pool`. The anvil tests never drop the future, so they pass None; the fixture's provider already uses simple nonce management, as the new docs require. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
* build: take the decdn crates from crates.io
decdn-client, decdn-common and decdn-incentive become crates.io
dependencies at a caret requirement ("0.1"), so CI builds what
`cargo install` users get and a published sponsord takes every
compatible decdn release. Cargo.lock still decides which one builds.
decdn-e2e, the anvil fixture decdn does not publish, stays a dev-only
git dependency at the release tag of the locked version, and a
[patch."https://github.com/decdn/decdn"] takes its own decdn
dependencies from crates.io too, so no decdn crate builds twice.
check_decdn_pin.py now checks that model: crates.io requirements, the
[patch], one locked version with no crate from both sources and no
unused patch, and the e2e tag matching the locked version.
bump_decdn.py and open-decdn-bump.sh follow it (plus `locked-crates`
and a `canary` subcommand the decdn main CI job now uses), and
publish-crates.sh drops its decdn gate along with registry_deps.py.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(ci): check every locked decdn entry and the requirement against the lock
check_decdn_pin.py kept one version and one commit per crate name, so a
second lock entry for a name (0.1.x beside 0.2.x, or a second commit)
replaced the first and went unseen. It also never compared the
requirement with the locked release. The requirement must now equal the
caret range of the locked version, as `bump-decdn.sh rewrite` writes it.
The changelog entry the bump writes gains its missing verb, and joins an
existing Changed list without a blank line that split it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(ci): lock exactly the bumped decdn release, and close pin-check gaps
From the PR review:
- open-decdn-bump.sh pins the requirements to `=<version>` while it runs
`cargo update` (`bump-decdn.sh rewrite --exact`), then restores the
caret range. cargo allows one release per range and source, so every
decdn crate moves to exactly the tag, not crates.io's newest; and a
release the crates.io API serves before the index cargo reads does is
waited out and ends in exit 3, not a PR that does not check out.
- check_decdn_pin.py refuses a member that declares a decdn crate itself
(git, path or a renamed package), a member path that does not resolve
(a glob), a decdn crate locked from a local path, and git crates with
no [workspace.dependencies] git alias.
- The decdn main canary runs `bump-decdn.sh canary-check` after its
update, so a [patch.crates-io] entry cargo did not use cannot leave a
crate on crates.io with the job green; `canary` also moves a `version`
on the git alias.
- `compare` lets an unreadable locked version fail instead of reporting
it as untagged, which moved the pin unconditionally.
- Docs and comments: the [patch] covers only the crates decdn-e2e shares
with the crates.io dependencies; CONTRIBUTING restores the lock with
`git checkout`; RELEASING's by-hand steps use --exact; why the publish
dry run stays out of CI; stale "untagged" wording.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(ci): read the crates.io index for bump readiness, and refuse renamed decdn aliases
- `bump-decdn.sh ready` asks the sparse index cargo resolves from
(index.crates.io) instead of the crates.io API, which can serve a
release first. open-decdn-bump.sh no longer retries `cargo update` on
"failed to select a version", which cargo also prints for permanent
resolver conflicts: once `ready` passes, a failing update is an error.
- check_decdn_pin.py refuses a [workspace.dependencies] alias that
renames a decdn crate (`client = { package = "decdn-client", … }`),
which it classified by key and so never checked.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.38.2 to 4.38.3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v4.38.2...v4.38.3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.38.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the cargo-minor group with 3 updates: [tokio-util](https://github.com/tokio-rs/tokio), [serde_json](https://github.com/serde-rs/json) and [syn](https://github.com/dtolnay/syn). Updates `tokio-util` from 0.7.19 to 0.7.20 - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](tokio-rs/tokio@tokio-util-0.7.19...tokio-util-0.7.20) Updates `serde_json` from 1.0.151 to 1.0.154 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](serde-rs/json@v1.0.151...v1.0.154) Updates `syn` from 3.0.6 to 3.0.8 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](dtolnay/syn@3.0.6...3.0.8) --- updated-dependencies: - dependency-name: tokio-util dependency-version: 0.7.20 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo-minor - dependency-name: serde_json dependency-version: 1.0.154 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo-minor - dependency-name: syn dependency-version: 3.0.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [rui314/setup-mold](https://github.com/rui314/setup-mold) from 10ca16bf91dc22e05ebdc935cad9c75ea248f621 to da13e0b42e392e3a45d1215033a2270b849d7d36. - [Commits](rui314/setup-mold@10ca16b...da13e0b) --- updated-dependencies: - dependency-name: rui314/setup-mold dependency-version: da13e0b42e392e3a45d1215033a2270b849d7d36 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.87.26 to 2.87.27. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](taiki-e/install-action@f7e5d7c...ab68953) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.87.27 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.87.27 to 2.87.28. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](taiki-e/install-action@ab68953...1168f68) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.87.28 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat(onramp): installers download a decdn: blob URI to -o <file> decdn.sh and decdn.ps1 take `get decdn:<hash>[?ns=<id>] -o <file>` alongside bundle and entry URIs, so a single file published as a blob downloads straight to its name without fetching a manifest. The hash keys the download's state as before. A blob URI without -o stops before installing anything, since a blob carries no file name; a bundle URI without one still gets `-o .`. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(onramp): changelog entry for blob URI downloads Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
* build: pin decdn to v0.2.0 Lock the decdn crates at 0.2.0 from crates.io instead of v0.1.0, and the anvil fixtures (decdn-e2e) at decdn's v0.2.0 release tag (5c830ea) instead of 538bf31. * fix(core): follow decdn v0.2.0's buyer_pool escrow handles decdn v0.2.0 makes `top_up` and `open_pool` take an escrow set and a receipt bound, and return the on-chain result with an `UnrecordedEscrow` that must be resolved. The daemon keeps no local pool record for decdn to reconcile and reports the credit to the keeper, so it releases the handle at once with `recorded()`, and passes no bound so the keeper's hold on decdn's `TopUpUnconfirmed` works as before. `open_pool` no longer takes the owner's signer; the anvil tests follow. Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
…ates (#85) Bumps the cargo-minor group with 2 updates in the / directory: [tokio](https://github.com/tokio-rs/tokio) and [syn](https://github.com/dtolnay/syn). Updates `tokio` from 1.53.2 to 1.53.3 - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](tokio-rs/tokio@tokio-1.53.2...tokio-1.53.3) Updates `syn` from 3.0.8 to 3.0.9 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](dtolnay/syn@3.0.8...3.0.9) --- updated-dependencies: - dependency-name: syn dependency-version: 3.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo-minor - dependency-name: tokio dependency-version: 1.53.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#83) * fix(onramp)!: stop adding -o . so decdn get keeps its overwrite guard An explicit `-o` turns off `decdn get`'s default-destination guard, so the one-liner replaced any same-named file in the current directory. Pass the arguments through unchanged and let `decdn get` pick the destination: a bundle still lands in `.`, now guarded. One file of a bundle without `-o` lands at `./<name>`, as `decdn get` documents. Needs a decdn release with an optional `get -o` (#2466) and the guard (#2476); v0.1.0 requires `-o`. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(onramp)!: refuse a decdn pin below v0.2.0 and ship the v0.2.0 example The installers now pass `decdn get` no `-o` for a bundle or entry URI, which v0.1.x's `decdn get` refuses, so `ReleasePin::new` rejects an `ONRAMP_DECDN_RELEASE` below v0.2.0 (a pre-release of it included) at startup rather than serving a script every download would fail on. The fixtures pin v0.2.0, the deploy example names decdn v0.2.0 with its SHA256SUMS digest, and the docs name the minimum. Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Imports the decdn/sponsord repository with its history rewritten so every path already sits where it belongs in this workspace: crates/sponsord*, docs/sponsord/, deploy/sponsord/, crates/sponsord-api/openapi/. Files that collide with this repo's root files are parked under _sponsord/ for the integration commits that follow to port and delete. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The sponsorship daemon and its onramp, which were the decdn/sponsord repository, are workspace members: sponsord, sponsord-onramp, sponsord-core, sponsord-api and the unpublished sponsord-e2e. They depend on decdn-client, decdn-common and decdn-incentive by path and ship with every release. Workspace - Five members; internal aliases for the four that other members use, plus decdn-e2e for the sponsord anvil tests. Every manifest inherits the workspace package metadata and lints. - The sponsord crates take the workspace alloy and reqwest entries, so both servers link ring and no aws-lc-rs; reqwest gains `form` and `query`. axum, alloy-primitives and tower are workspace deps. - sponsord-core installs the rustls provider before it builds a provider; the onramp (`sponsord_onramp::tls`) before its first client; `test_config()` for every test that builds one. - The OpenAPI snapshots live inside sponsord-api, so its test no longer reaches outside the package. Guards - check_crate_edges.py: rows for the five crates, `sponsord` and `sponsord-e2e` are sinks, `sponsord` and `sponsord-onramp` are footprint-guarded. - no_inline_test_modules: a module gated on `feature = "test-support"` (or an `any(…)` of test and that feature) is a test module, as the sponsord crates' `test_support.rs` are; decdn-protocol's `test_block_size` moves to its own file under the same rule. - check_toolchain_pin.py also reads `FROM rust:X.Y.Z-…` in the source-build Dockerfile under deploy/sponsord/. - check-image-name.sh holds a stage|image|script-image triple per image; the sponsord images are named under the organisation. - CodeQL skips crates/sponsord-e2e; nextest gives chain_pool and binary_anvil the anvil row. Release and CI - release.yml builds sponsord and sponsord-onramp on the two Linux targets (fifteen archives), and two more Dockerfile stages push ghcr.io/<owner>/sponsord and ghcr.io/<owner>/sponsord-onramp; sign-release.sh signs, tags and mirrors them, security.yml scans them, docker/README.<stage>.md gives each a Docker Hub overview. - ci.yml gains anvil-e2e-sponsord and the installers matrix (macOS decdn.sh, Windows decdn.ps1); docker-build covers the new stages. - publish-crates.sh no longer opens a sponsord bump PR; sponsord's decdn-pin tooling, canary and duplicate tooling are gone. Docs - Guides under docs/sponsord/, Compose and systemd under deploy/sponsord/, per-crate changelogs folded into CHANGELOG.md. CLAUDE.md, README.md, RELEASING.md, SECURITY.md, CONTRIBUTING.md and adr/appendix-binaries.md describe the sixteen-member workspace. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Gas snapshotNo gas changes vs base. |
Code coverage overviewLanguages: Rust, Solidity Rust / code-coverage/cargo-llvm-cov
View coverage of the 10 most impacted files.
Solidity / code-coverage/forge
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…sord crates package cargo strips a dev-dependency from the published manifest only when it has no version requirement. With `version = "0.2.0"` on the `decdn-e2e` alias, `cargo package -p sponsord-core` kept the dev-dependency and looked for `decdn-e2e` on crates.io, where it never is (`publish = false`). check_workspace_manifests.py now requires an alias to a `publish = false` member to carry no version, and keeps the equal-to-workspace rule for the rest. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Guards - check_toolchain_pin.py: a missing source-build Dockerfile, or one with no `FROM rust:` line, is an error, not one site fewer; `--platform`, a `docker.io/library/` prefix, lowercase `from` and a digest suffix are read through. The pre-commit `toolchain-pin` hook watches the file. - check_workspace_manifests.py: `publish = []` is unpublished like `publish = false`, and a publishable member may reach an unpublished one only through `dev-dependencies`. - check_crate_edges.py: a FOOTPRINT_GUARDED root that is not a member is an error. Tests cover every sink, the onramp not being one, a leak under `sponsord-api`, and a misspelt root. - check-image-name.sh: a missing file is named as such; a pytest drives the script to each failure it exists to catch. - no_inline_test_modules: nested cfg combinations; and `test-support` may be enabled only by tests and dev-dependencies, so a module gated on it stays test code. Release - sign-release.sh refuses a repository without an owner, and a rehearsal from another repository under `decdn`, which would promote the production `ghcr.io/decdn/sponsord*` tags. - RELEASING.md names the one-time step the org-owned sponsord packages need before the first release that ships them: `decdn/decdn` gets the Write role under each package's Actions access. - SECURITY.md counts eleven signatures and four binaries on crates.io. CI - The `rust` path filter covers the onramp's installer assets and sponsord-api's OpenAPI snapshots, which no `.rs` change touches. - `binary_boot` runs the `sponsord-onramp` binary against a closed daemon port: it reaches the daemon read without a TLS-provider panic. Docs: the counts and wording in guard docstrings, CLAUDE.md, CONTRIBUTING.md, the codeql config, the binaries appendix, release.yml, the Dockerfiles and the Docker Hub overviews describe four images, four leaves and four sinks; the source-build dockerignore excludes nested `.env` files. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The sponsord crates asked for `decdn-e2e`'s `anvil-e2e` feature on their dev-dependency. A feature named on a dev-dependency is unified into every `cargo nextest run --workspace`, so the `test` job, which has no Foundry, ran all of `decdn-e2e`'s anvil-gated targets and failed on `spawn anvil`. `sponsord` and `sponsord-core` now enable `decdn-incentive/redb` through their own `anvil-e2e` features, as `decdn-e2e` does, and take `decdn-e2e` without features. The plain workspace run lists no anvil target again; the `anvil-e2e-sponsord` job still selects both sponsord tests through `--features sponsord-core/anvil-e2e,sponsord/anvil-e2e`. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Docker Hub rehearsal overrides can overwrite production sponsorship image tags, and the security guide understates trust in the onramp.
2 open issues
What changed in this PR
Integrates sponsord into the deCDN workspace so shared development, testing, and releases happen in one repository.
Changes:
- Adds five sponsorship crates using workspace dependencies.
- Extends releases to fifteen archives and four container images.
- Imports deployment guides and strengthens packaging, dependency, and toolchain checks.
| File | Description |
|---|---|
| SECURITY.md | Documents four-image release verification. |
| scripts/tests/test_sign_release_publish.py | Adds sponsorship signing fixtures. |
| scripts/tests/test_publish_crates_env.py | Removes obsolete bump switch coverage. |
| scripts/tests/test_dockerhub_description.py | Covers four image descriptions. |
| scripts/sign-release.sh | Signs and promotes sponsorship images. |
| scripts/publish-crates.sh | Removes separate sponsord bump automation. |
| README.md | Introduces integrated sponsorship components. |
| docs/sponsord/security.md | Documents sponsorship trust boundaries. |
| docs/sponsord/installer.md | Explains installation and download behavior. |
| docs/sponsord/architecture.md | Describes sponsorship components and flow. |
| Dockerfile | Adds sponsorship release-image stages. |
| docker/README.sponsord.md | Adds daemon image overview. |
| docker/README.sponsord-onramp.md | Adds onramp image overview. |
| deploy/sponsord/systemd/sponsord.service | Adds daemon service configuration. |
| deploy/sponsord/systemd/sponsord-onramp.service | Adds onramp service configuration. |
| deploy/sponsord/sponsord.env.example | Provides daemon configuration example. |
| deploy/sponsord/sponsord-onramp.env.example | Provides onramp configuration example. |
| deploy/sponsord/Dockerfile.dockerignore | Filters source-build context. |
| deploy/sponsord/Dockerfile | Builds sponsorship images from source. |
| deploy/sponsord/compose.yaml | Deploys both sponsorship services. |
| crates/sponsord/tests/startup_redacts_rpc_url.rs | Tests startup secret redaction. |
| crates/sponsord/src/metrics.rs | Exposes daemon metrics. |
| crates/sponsord/src/main.rs | Runs daemon and pool keeper. |
| crates/sponsord/src/lib.rs | Exports daemon modules. |
| crates/sponsord/src/http.rs | Implements authenticated daemon API. |
| crates/sponsord/src/config/tests.rs | Tests daemon configuration. |
| crates/sponsord/README.md | Introduces daemon crate. |
| crates/sponsord/Cargo.toml | Integrates daemon dependencies. |
| crates/sponsord-onramp/tests/startup.rs | Tests startup validation. |
| crates/sponsord-onramp/tests/binary_boot.rs | Tests binary TLS initialization. |
| crates/sponsord-onramp/src/tls.rs | Installs ring crypto provider. |
| crates/sponsord-onramp/src/state.rs | Assembles shared onramp state. |
| crates/sponsord-onramp/src/net/tests.rs | Tests request rate limits. |
| crates/sponsord-onramp/src/net.rs | Resolves client addresses and limits requests. |
| crates/sponsord-onramp/src/main.rs | Runs public onramp server. |
| crates/sponsord-onramp/src/lib.rs | Exports embeddable onramp modules. |
| crates/sponsord-onramp/src/installer.rs | Renders installer templates. |
| crates/sponsord-onramp/src/http/mod.rs | Defines public HTTP routes. |
| crates/sponsord-onramp/src/http/fund.rs | Handles gated capability issuance. |
| crates/sponsord-onramp/src/http/capability.rs | Serves capability polling requests. |
| crates/sponsord-onramp/src/grants/tests.rs | Tests capability cache lifetime. |
| crates/sponsord-onramp/src/grants.rs | Caches browser-to-installer capabilities. |
| crates/sponsord-onramp/src/gate/turnstile/tests.rs | Tests Turnstile integration. |
| crates/sponsord-onramp/src/gate/turnstile.rs | Implements Turnstile gate. |
| crates/sponsord-onramp/src/gate/tests.rs | Tests HTML escaping. |
| crates/sponsord-onramp/src/gate/mod.rs | Defines pluggable gate interface. |
| crates/sponsord-onramp/src/daemon.rs | Abstracts daemon capability access. |
| crates/sponsord-onramp/README.md | Introduces onramp crate. |
| crates/sponsord-onramp/Cargo.toml | Integrates onramp dependencies. |
| crates/sponsord-onramp/assets/turnstile.html | Provides browser gate page. |
| crates/sponsord-e2e/src/lib.rs | Describes cross-component tests. |
| crates/sponsord-e2e/Cargo.toml | Adds unpublished integration-test crate. |
| crates/sponsord-core/src/sponsor/tests.rs | Tests sponsorship issuance rules. |
| crates/sponsord-core/src/lib.rs | Exports sponsorship library API. |
| crates/sponsord-core/src/issuer/tests.rs | Tests capability signing and limits. |
| crates/sponsord-core/README.md | Introduces core library. |
| crates/sponsord-core/Cargo.toml | Integrates core dependencies. |
| crates/sponsord-api/tests/openapi.rs | Checks crate-local API snapshots. |
| crates/sponsord-api/src/time.rs | Provides runtime and test clocks. |
| crates/sponsord-api/src/secret/tests.rs | Tests secret handling. |
| crates/sponsord-api/src/secret.rs | Wraps and loads secrets. |
| crates/sponsord-api/src/onramp.rs | Defines public onramp wire types. |
| crates/sponsord-api/src/money/tests.rs | Tests monetary value behavior. |
| crates/sponsord-api/src/money.rs | Defines micro-USDC amounts. |
| crates/sponsord-api/src/lib.rs | Exports shared API types. |
| crates/sponsord-api/src/error/tests.rs | Tests error serialization. |
| crates/sponsord-api/src/error.rs | Defines shared API errors. |
| crates/sponsord-api/src/daemon/tests.rs | Tests daemon wire formats. |
| crates/sponsord-api/src/daemon.rs | Defines daemon API contract. |
| crates/sponsord-api/README.md | Introduces API crate. |
| crates/sponsord-api/Cargo.toml | Integrates API dependencies and snapshots. |
| crates/protocol/src/coverage/test_block_size.rs | Houses extracted test-support module. |
| crates/protocol/src/coverage.rs | Declares test-support module out of line. |
| CONTRIBUTING.md | Documents sponsorship development checks. |
| CHANGELOG.md | Records workspace integration. |
| Cargo.toml | Adds workspace members and dependencies. |
| adr/appendix-binaries.md | Documents expanded binary distribution. |
| .pre-commit-config.yaml | Extends affected-file checks. |
| .gitignore | Excludes deployment secrets and staged binaries. |
| .github/workflows/security.yml | Scans sponsorship images. |
| .github/workflows/release.yml | Builds sponsorship archives and images. |
| .github/scripts/tests/test_check_workspace_manifests.py | Tests unpublished dependency aliases. |
| .github/scripts/tests/test_check_toolchain_pin.py | Tests Dockerfile toolchain checks. |
| .github/scripts/tests/test_check_image_name.py | Tests image-name consistency guards. |
| .github/scripts/check-image-name.sh | Validates four image mappings. |
| .github/scripts/check_workspace_manifests.py | Guards unpublished dependency usage. |
| .github/scripts/check_toolchain_pin.py | Checks source-image Rust pin. |
| .github/scripts/check_crate_edges.py | Enforces sponsorship dependency boundaries. |
| .github/dependabot.yml | Tracks source-build Docker dependencies. |
| .github/codeql/codeql-config.yml | Excludes sponsorship test fixtures. |
| .config/nextest.toml | Configures sponsorship integration-test timeouts. |
Review effort: Balanced
Comment on lines
+70
to
+73
| `decdn` verifies every byte against the content hash, so | ||
| a malicious node or onramp can't change what is downloaded; a malicious | ||
| onramp could only point the installer at a different pool or chain, or pin | ||
| a different `decdn` release. |
| die "DECDN_REPO=$REPO is under the decdn organisation but is not decdn/decdn: the | ||
| sponsord images are named per owner, so this run would promote the production | ||
| ghcr.io/decdn/sponsord tags. Rehearse from a fork under another owner." | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
The
decdn/sponsordrepository joins this workspace. Its five crates are members atcrates/sponsord,crates/sponsord-core,crates/sponsord-api,crates/sponsord-onrampandcrates/sponsord-e2e, with their full history (117 commits, imported through agit filter-repopath rewrite and merged with--allow-unrelated-histories;git log --followworks on every moved file).Why: every decdn release needed a sponsord bump PR against crates.io plus a
decdn-e2egit pin; sponsord ran its own CI, release pipeline and a mirror of this repository's tooling; and a change to a shared type was two PRs in two repositories. Now the sponsord crates depend ondecdn-client,decdn-commonanddecdn-incentiveby path, ship with every decdn release, and a shared-type change is one PR.Decisions:
sponsordandsponsord-onrampbuild on the two Linux targets only (as before): 15 archives, oneSHA256SUMS. Their images stayghcr.io/decdn/sponsordandghcr.io/decdn/sponsord-onramp(named under the organisation, not the repository) sodeploy/sponsord/compose.yaml, the devops roles and operator docs keep working. They are two more stages of the root Dockerfile, sharing itsbase(userdecdn, uid 1000).alloy(nofull) andreqwest(rustls-no-provider, plusform/query) entries, so both servers link ring and no aws-lc-rs.sponsord-coreinstalls the rustls provider before it builds a provider, the onramp before its firstreqwest::Client, andtest_config()for the tests.cargo treeon both binaries reaches no aws-lc/iroh-blobs/AWS SDK, andcheck_crate_edges.pynow guards their closures likedecdn-cli's.docs/sponsord/, Compose/systemd underdeploy/sponsord/, OpenAPI snapshots insidecrates/sponsord-api/openapi/(the test used to reach../../docs/openapi, which breaks in the packaged crate). The per-crate changelogs are deleted (their[Unreleased]sections were empty; released history stays in git and in the archived repo's releases), andCHANGELOG.mdcarries the one entry for the move.bump_decdn.py,check_decdn_pin.py,open-decdn-bump.sh, thedecdn-maincanary), its duplicate repo tooling, and the sponsord bump inpublish-crates.sh.Guard changes worth a look:
crates/e2e/tests/no_inline_test_modules.rs: a module gated onfeature = "test-support"(orany(test, feature = "test-support")) is now a test module, which is what the sponsord crates'test_support.rsare and what the CodeQL skip list relies on.decdn-protocol's inlinetest_block_sizemoves to its own file under the same rule.check_toolchain_pin.pyreads theFROM rust:X.Y.Z-…tag indeploy/sponsord/Dockerfileas a pin site.check-image-name.shholds astage|image|script-imagetriple per image, because the sponsord images are${{ github.repository_owner }}/…while the decdn images are${{ github.repository }}…. A pytest now drives it to each failure.check_workspace_manifests.py: an alias to apublish = falsemember carries noversion(a versioned dev-dependency survives packaging and then resolves on crates.io), and only a dev-dependency may reach an unpublished member.sign-release.shrefuses a rehearsal from another repository underdecdn: the sponsord images are named per owner, so it would promote the production tags.rustCI path filter now coverscrates/**/assets/**and the OpenAPI snapshots.Before the first release that ships sponsord (one-time, needs an org admin): the
sponsordandsponsord-onrampGHCR packages are linked todecdn/sponsord; adddecdn/decdnwith the Write role under each package's Manage Actions access, or the releasedockerjob fails withpermission_denied: write_package. RELEASING.md § One-time setup step 6 records it. Also expect that release'sgit cliff --latestnotes to list the imported sponsord commits (everything reachable from the tag and not from v0.2.0); edit them once.Not in this PR (follow-ups after merge): transferring the open sponsord issues here, archiving
decdn/sponsord, and repointingdevops/(roles, Compose,upstream-drift.yml) andwebsite/fromdecdn/sponsordreleases to this repository's once a release ships the sponsord archives.Reviewer notes
Read in this order: root
Cargo.toml, the fivecrates/sponsord*/Cargo.toml,.github/scripts/check_crate_edges.py,Dockerfile,.github/workflows/release.yml(build matrix + docker matrix),scripts/sign-release.sh,.github/workflows/ci.yml(anvil-e2e-sponsord,installers,docker-build). The sponsord source itself is unchanged apart from the TLS provider installs, the OpenAPI path and theworkspace = truedependency rewrites.The first commit is the history merge and does not build on its own; the second commit is the integration. CI runs on the head.
The release matrix change is the risk: fifteen archives are asserted by count, and the four digest files by name in
sign-release.sh.check-image-name.shand thescripts/testssuite exercise those tables.Verification
cargo fmt -- --checkCARGO_BUILD_WARNINGS=deny cargo clippy --workspace --all-targetsand--all-featurescargo nextest run --workspace: 5528 run, all pass (one pre-existing flakyclient_loopbacktest passed on retry)cargo doc --workspace --no-deps --document-private-itemswith warnings denied;cargo deny checkcargo package --workspace --no-verify --lockedandcargo publish --workspace --dry-run --locked(all 14 publishable crates, after thedecdn-e2ealias fix in the second commit)uvx --with pyyaml pytest .github/scripts/tests scripts/tests: 282 passpre-commit run --all-filescargo tree -p sponsord/-p sponsord-onramp(--all-features --target all): noaws-lc,iroh-blobs,aws-sdk-*,jsonrpsee-serverdocker buildof thesponsordandsponsord-onrampstages with placeholder binaries: entrypoints run the copied binary, userdecdn, ports 8090/8080, no volumes;decdn-nodestill the default stagegit log --follow crates/sponsord-core/src/pool.rsshows the imported historycontracts/unchangedCHANGELOG.mdentry addedadr/appendix-binaries.md§ Distribution updated🤖 Generated with Claude Code