Skip to content

Add a prt option to rollupsContracts, and move to rollups-contracts 3.0.0-alpha.10 - #162

Merged
tuler merged 5 commits into
prerelease/v2-alphafrom
claude/rollups-prt-contracts-import-202p0s
Sep 2, 2026
Merged

Add a prt option to rollupsContracts, and move to rollups-contracts 3.0.0-alpha.10#162
tuler merged 5 commits into
prerelease/v2-alphafrom
claude/rollups-prt-contracts-import-202p0s

Conversation

@tuler

@tuler tuler commented Aug 14, 2026

Copy link
Copy Markdown
Member

Three commits, reviewable in order.

1. Default rollups-contracts → 3.0.0-alpha.10

Version and three hashes. Additive in its ABIs — it now publishes the ERC-165/20/721/1155 interfaces its contracts compile against (12 names), and no existing ABI changed. Every deployment address changed, though, so this breaks @cartesi/client, @cartesi/codec and @cartesi/react for anyone reading an address off them; hence their major changesets.

2. rollupsContracts({ prt: true })

Following review: not a second plugin, an option. A PRT (Permissionless Refereed Tournaments) deployment is a rollups deployment — same InputBox, portals and factories, at the same addresses — plus the consensus and tournament contracts that settle epochs by tournament rather than by authority.

export default defineConfig({
    out: "src/generated.ts",
    plugins: [rollupsContracts({ prt: true })],
});

So what it generates is a strict superset of rollupsContracts(), verified on the output: all 52 contracts present with identical ABIs and identical addresses, plus 31 PRT-only, for 83 total. It is one or the other in a config, never both.

Where each piece comes from

dave publishes the PRT contracts and the deployment addresses, but does not rebuild the rollups contracts — 44 of them have no artifact in its release, InputBox, Inputs, Outputs and all five portals among them. So Release.artifacts takes a list, and prt reads:

Source Provides
rollups-contracts artifacts ABIs of the rollups contracts
dave contract artifacts ABIs of the PRT contracts
dave deployments + anvil addresses for both, livenets and devnet

The union covers every address dave publishes: the only deployment without an artifact is TestUsdWithdrawalOutputBuilder, which the existing interface alias already handles.

What this retires

Modelling PRT as a superset rather than a sibling removed two workarounds the separate plugin needed:

  • SHARED_CONTRACTS and excludeSharedContracts are gone. One plugin emitting a merged set cannot collide with itself, so the seven-name exclusion list — and its standing instruction to re-check on every version bump — disappears.
  • externalDeployments is gone. With merged artifacts every dave address resolves to an ABI, so "deployment without a build artifact" goes back to being a plain error.

The one constraint the option must carry is that the releases pair: dave alpha.4 is built and deployed against rollups-contracts alpha.10, so prt: true picks both defaults together, and the docs flag it for anyone overriding prt alone.

Review fixes folded in

  • ABI comparison is now order-insensitive (thread). Entries are compared as sets of canonicalized entries, with keys sorted recursively — JSON.stringify was order-sensitive both across entries and within them. This check matters more now that the shared interfaces land in one merged set instead of being excluded from one of two plugins.
  • Extractions are cleaned up when a sibling download fails (thread). Pre-existing on the base branch: the try only began after Promise.all resolved, so a rejection stranded whatever had already extracted.

3. modern-tar → 0.8.4

0.8.0 is breaking only in the web entrypoint. This package imports unpackTar from modern-tar/fs, whose signature, options and path-traversal guards are byte-identical between the two versions.

Verification

Each commit was verified independently, so the history bisects.

  • rollupsContracts(): 52 contracts. prt: true: 83, a verified strict superset (no ABI or address differs). prt: { anvil: false }: no chain 31337.
  • A JSON-only dave release still fails with … predates dave 3.0.0-alpha.4, and rollups-contracts alpha.7 with … predates rollups-contracts 3.0.0-alpha.8.
  • Order-shuffled equivalent ABIs compare equal; genuinely different ones still raise a conflict.
  • A run whose second download 404s leaves 0 temp directories.
  • All 8 packages build and lint, docs build, suites pass (client 12, codec 70, react 122), changeset version accepts all four changesets.

One caveat about the sandbox, not the diff: turbo run build hits fetch failed when several packages download release tarballs concurrently. It reproduces on the base branch with this diff stashed; building packages one at a time succeeds.

🤖 Generated with Claude Code

https://claude.ai/code/session_017dyPxGkLKcxgyECXkVKqae

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 298f0f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@cartesi/client Major
@cartesi/codec Major
@cartesi/react Major
@cartesi/wagmi-plugin Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tuler
tuler force-pushed the claude/wagmi-plugin-version-bump-e8wqpt branch from 5fbf1fc to 0c9a591 Compare August 17, 2026 12:44
@brunomenezes brunomenezes moved this to 🧑‍💻 In Progress in Rollups Tooling Aug 19, 2026
Base automatically changed from claude/wagmi-plugin-version-bump-e8wqpt to prerelease/v2-alpha August 19, 2026 19:24
@tuler
tuler force-pushed the claude/rollups-prt-contracts-import-202p0s branch 3 times, most recently from b7fa215 to b524656 Compare August 24, 2026 19:57
@tuler
tuler force-pushed the claude/rollups-prt-contracts-import-202p0s branch from b524656 to 4b33b74 Compare August 31, 2026 22:47
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cartesi-playground Ready Ready Preview Sep 2, 2026 3:17pm UTC

Request Review

@tuler tuler changed the title Add the rollupsPrtContracts wagmi plugin Add the rollupsPrtContracts wagmi plugin, and move to rollups-contracts 3.0.0-alpha.10 Sep 1, 2026
…a.10

The release is additive in its ABIs: it publishes the ERC-165, ERC-20,
ERC-721 and ERC-1155 interfaces its contracts are compiled against, 12
names in all, and no existing ABI changed. `@cartesi/client` and
`@cartesi/react` generate those alongside what they generated before;
`@cartesi/codec` keeps its own `include` list and is unaffected.

Every deployment address changed, though, on the livenets and the devnet
alike, so regenerating breaks all three for anyone reading an address off
them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dyPxGkLKcxgyECXkVKqae
@tuler
tuler force-pushed the claude/rollups-prt-contracts-import-202p0s branch from 9d48ba7 to 43b0253 Compare September 1, 2026 01:46
@tuler
tuler requested a review from guidanoli September 1, 2026 01:50
@tuler
tuler marked this pull request as ready for review September 1, 2026 01:51
Comment thread apps/docs/pages/wagmi-plugin/prt.mdx Outdated
Comment thread packages/wagmi-plugin/src/release.ts Outdated
Comment thread packages/wagmi-plugin/src/release.ts Outdated
Comment thread packages/wagmi-plugin/src/release.ts Outdated
Generate the contracts of a PRT (Permissionless Refereed Tournaments)
deployment from a dave release, defaulting to v3.0.0-alpha.4.

A PRT deployment *is* a rollups deployment: it runs against the same
InputBox, portals and factories, at the same addresses, and adds the
consensus and tournament contracts that settle epochs by tournament rather
than by authority. So this is not a second plugin but an option, and what
it generates is a strict superset of `rollupsContracts()` — every contract
it generated before, with the same ABI and the same address, plus 31 more.
It is one or the other in a config, never both.

dave publishes the PRT contracts and the deployment addresses, but does
not rebuild the rollups contracts: 44 of them, `InputBox` and the portals
among them, have no artifact in its release. So `Release.artifacts` takes
a list of tarballs, and `prt` reads the rollups ABIs from the
rollups-contracts one and everything else from dave, whose addresses
cover both. The two releases have to pair — dave alpha.4 is built and
deployed against rollups-contracts alpha.10 — which is why one `prt: true`
picks the defaults for both rather than letting them drift apart.

Modelling it this way retires two workarounds the separate plugin needed:
the shared-contract exclusion list, since one plugin emitting a merged set
cannot collide with itself, and the "deployment without an artifact"
escape hatch, since the merged artifacts now cover every address dave
publishes.

The tarball reading shared with a plain rollups release moves to
release.ts, and grows what the dave layout needs: `.sol` directories are
searched at any depth, so a tarball holding one foundry build per contracts
project works as well as one holding a single `out`; and a contract several
tarballs build is generated once, its copies compared as unordered sets of
canonicalized ABI entries so that compiler ordering does not make
equivalent ABIs look like a conflict.

Extractions are also collected as they land rather than awaited together,
so the directories of the downloads that succeeded are removed when a
sibling download fails.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dyPxGkLKcxgyECXkVKqae
0.8.0 is a breaking release, but only for the web entrypoint: it dropped
the gzip helpers, changed what `createTarDecoder()` returns, and narrowed
some packing result types. This package imports `unpackTar` from
`modern-tar/fs` and nothing else, whose signature, `UnpackOptionsFS` and
path-traversal guards are byte-identical between 0.7.7 and 0.8.4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dyPxGkLKcxgyECXkVKqae
@tuler
tuler force-pushed the claude/rollups-prt-contracts-import-202p0s branch from 29d96ce to 8c4eb9d Compare September 1, 2026 18:37
@tuler tuler changed the title Add the rollupsPrtContracts wagmi plugin, and move to rollups-contracts 3.0.0-alpha.10 Add a prt option to rollupsContracts, and move to rollups-contracts 3.0.0-alpha.10 Sep 1, 2026
@tuler
tuler requested a review from guidanoli September 1, 2026 18:53
Comment thread packages/wagmi-plugin/README.md Outdated
Comment thread packages/wagmi-plugin/README.md Outdated
Comment thread packages/wagmi-plugin/README.md Outdated
Comment thread apps/docs/pages/wagmi-plugin/index.mdx Outdated
Comment thread apps/docs/pages/wagmi-plugin/index.mdx Outdated
Comment thread apps/docs/pages/wagmi-plugin/prt.mdx Outdated
Comment thread apps/docs/pages/wagmi-plugin/prt.mdx Outdated
Comment thread apps/docs/pages/wagmi-plugin/prt.mdx Outdated
Comment thread apps/docs/pages/wagmi-plugin/prt.mdx Outdated
Take @guidanoli's review suggestions on the PRT documentation. They give
the context the pages were missing — what PRT is, and why an application
would want it over Authority or Quorum — and drop the low-level framing
where the higher-level statement is what matters: that the ABIs of a
contract several projects build have to match, not how they are compared.

They also settle the wording. `prt` reads as additive throughout now
rather than as a choice between two things: PRT Rollups is a superset of
the core rollups contracts, so the option generates code for them "as
well" rather than "instead". The plugin's own doc comment, CLAUDE.md and
the changeset followed, since they carried the contrasting phrasing the
suggestions removed from the docs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dyPxGkLKcxgyECXkVKqae
Comment thread packages/wagmi-plugin/src/release.ts Outdated
Comment thread packages/wagmi-plugin/src/release.ts Outdated
Comment thread packages/wagmi-plugin/src/release.ts Outdated
Comment thread packages/wagmi-plugin/src/release.ts Outdated
Comment thread packages/wagmi-plugin/src/release.ts Outdated
A PRT deployment includes the rollups one, so dave and rollups-contracts
both publish the addresses they share. Only dave's were read, which made
the union a superset by happenstance of the current pins rather than by
construction: a rollups-contracts release deploying something dave's
tarball does not list would have gone missing from `prt`, and a pairing
that had drifted would have silently taken dave's addresses.

`deployments` and `anvil` now take a list of tarballs like `artifacts`
does, and `mergeDeployments` raises on an address two of them disagree on
instead of letting the last one win. The public options are unchanged —
`Release` is internal, and the plugin passes both releases' sources when
`prt` is set.

`anvil: false` still drops the devnet entirely; `prt.anvil: false` now
drops only dave's half of it, leaving the core contracts their devnet
addresses.

Also from review: `collapseAddress` compares with viem's `isAddressEqual`
rather than lowercasing strings, and the fallback for a deployments
tarball whose addresses sit at the root is gone — every release the
plugin accepts, back to rollups-contracts 3.0.0-alpha.8 and dave
3.0.0-alpha.3, nests them under `deployments/`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dyPxGkLKcxgyECXkVKqae

@guidanoli guidanoli left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for taking my suggestions into consideration.
Looks good to me!

@github-project-automation github-project-automation Bot moved this from 🧑‍💻 In Progress to 👍 Waiting Merge in Rollups Tooling Sep 2, 2026
@tuler
tuler merged commit 243b37a into prerelease/v2-alpha Sep 2, 2026
6 checks passed
@tuler
tuler deleted the claude/rollups-prt-contracts-import-202p0s branch September 2, 2026 19:47
@github-project-automation github-project-automation Bot moved this from 👍 Waiting Merge to 📦 Done in Rollups Tooling Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📦 Done

Development

Successfully merging this pull request may close these issues.

4 participants