Skip to content

feat(contracts): UPDATE-1, one in-place update of all three contracts, applied on sakura - #390

Merged
PastaPastaPasta merged 6 commits into
masterfrom
feat/contract-update-1
Oct 5, 2026
Merged

PastaPastaPasta merged 6 commits into
masterfrom
feat/contract-update-1

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

UPDATE-1 (roadmap D4, owner decision 2026-10-04) is one batched, in-place DataContractUpdate of the three forge-v2 contracts. This PR has the schemas, the tooling, and the record of the live update on devnet sakura, with the refreshed contract snapshot. The design and the decision for each item are in dash-forge-qa design/v5/CONTRACT-UPDATE-1.md.

What the update adds

Each item is a build.py flag (UPDATE1_FLAGS). None of them adds a rule or index to an existing type, and none adds a required field.

forge-core

  • release.targetOid (optional)
  • config.movedTo
  • a new type, packMirror

forge-collab

  • transition.closedByPr
  • a new type, ban (the maintainer ban list)

forge-community

  • profile.keyProofs
  • profile.bot
  • authorEvent kind 8, plus value
  • policy.requireCodeOwners

Rules that an update cannot add are mainnet-only MAINNET_FLAGS (build.py --mainnet): the public-publish target, the retarget value, a public-only movedTo, public-only mirrors, the consensus archive and the epoch-only sealed writes. They are documented in docs/contracts/forge-v2.md §9.1.

In this PR

  • Schemas: forge-contracts/contracts/*.json built with UPDATE-1. contracts/registered/*.v1.json are the schemas sakura registered.
  • CI: contracts.yml now checks all three contracts with contract-validate --expect-update.
  • Vectors and variants: vectors for every new field and type. variants.py covers UPDATE-1 whole and with each item left out.
  • Deploy: deploy-v2.mjs --update core|collab|community|all does an in-place update. It can be resumed (a pending update is recorded before the broadcast) and is idempotent.
  • Probe and live cases: update1-probe.mjs, the fee and compatibility probe, and an update1 group in rc1-live.mjs.
  • forge-core: the cost audit and layout know the two new types.
  • Live record: deployments/devnet-sakura.json records each update, and deployments/contracts/devnet-sakura.json is the version-2 snapshot that forge-web seeds.

Live on sakura (2026-10-05 05:41 UTC)

Before the update, a dry run showed all three contracts on chain at version 1. Client tolerance (#367) was merged and deployed first: the live site served 555bbb6.

Contract Version Signed transition Fee
forge-core EfLLbz… 1 → 2 17,533 B 0.680503 DASH
forge-collab 6scu1j… 1 → 2 17,704 B 0.460424 DASH
forge-community 6fVegR… 1 → 2 17,584 B 0.570287 DASH

The live vectors (rc1-live.mjs --only update1) passed 32 of 32. Every new field and type lands, and the uniqueness, maintainer-only, author-only, https/ipfs-only and repo-must-exist refusals all hold. Per-write fees in credits:

Write Fee
release with targetOid 86.2 M
release without it 77.2 M
packMirror 73.6 M
ban 48.0 M
transition with closedByPr 74.2 M
retarget 58.7 M

Reads after the update:

Gates

  • build.py, vectors.py and wherecheck all pass.
  • contract-validate --expect-update reports ALLOWED v1 → v2 for all three contracts, and all vectors pass.
  • negative.sh rejects every mutation.
  • variants passes 77 of 77.
  • The deploy-v2 self-test passes.
  • cargo fmt, clippy -D warnings and cargo test --workspace pass.
  • forge-web tsc, lint, copy lint and vitest pass, including the contract-seed snapshot test.

🤖 Generated with Claude Code

PastaPastaPasta and others added 6 commits October 4, 2026 13:15
Roadmap D4 (owner decision 2026-10-04). Each addition is a build.py flag
(UPDATE1_FLAGS); with every one off the build reproduces the schemas sakura
registered, now frozen for all three contracts in contracts/registered/, and
CI validates each contract as an update of its own (--expect-update).

forge-core: release.targetOid (optional, not requiredSince), config.movedTo,
and a packMirror type. forge-collab: transition.closedByPr and a maintainer
ban type. forge-community: profile.keyProofs, profile.bot, authorEvent kind 8
with value (the author's retarget), policy.requireCodeOwners.

The rules an update cannot add are a mainnet flag set (MAINNET_FLAGS; build.py
--mainnet builds a fresh registration with them): a public publish names its
target, kind 8 carries a value, no plaintext movedTo beside a sealed config,
public-only mirrors; consensus archive and current-epoch sealed writes are
declared, not built. Documented in forge-v2.md 9.1.

Sizes 17,381 / 17,633 / 17,513 B (under the 17,832 B ceiling); 77/77 variant
combinations valid. The layout maps (Rust and web) know the new types.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…probe and live vectors

deploy-v2.mjs --update core|collab|community|all updates each recorded
contract in place, in registration order, with the recorded ids substituted.
update1-probe.mjs measures the update and the per-write costs on a throwaway
contract and what a reader that still holds version 1 gets (a refused read
and a refused write wait: "trailing bytes ... refetch the contract").
rc1-live.mjs gains an update1 group for every addition.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
From review:
- packMirror.uris take https:// (no credentials) or ipfs:// only, the logUrl
  pattern; no later update can add a pattern
- profile.keyProofs items hold up to 1,200 characters (an RSA-3072 sshsig or
  an RSA-4096 OpenPGP signature) and may be empty (no proof for that key)
- mainnet_mirror_public stamps a public-only vis, so the where refuses a
  stranger's mirror of a private repo
- deploy-v2 --update settles a pending update only for the schema and version
  it broadcast, and stops instead of broadcasting another
- rc1-live's profile cases replace an existing profile on a rerun
- forge-core: packMirror and ban are optional types (absent before the
  update), audited by the cost audit, and ban is maintainer-only in E601

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…snapshot

deploy-v2.mjs --update all took forge-core, forge-collab and
forge-community to version 2 on devnet sakura (2026-10-05 05:41 UTC).
The deployment record gains each update; the web app's seed snapshot
now holds the version-2 contracts, so a fresh page load decodes
documents written after the update without a refetch.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b5fba2a3-fedb-4eda-bc9c-79178d47c94b
📥 Commits

Reviewing files that changed from the base of the PR and between 40da852 and 2b23b3d.

📒 Files selected for processing (25)
  • .github/workflows/contracts.yml
  • crates/forge-core/src/cost_audit.rs
  • crates/forge-core/src/layout.rs
  • crates/forge-core/src/user_error.rs
  • docs/contracts/forge-v2.md
  • forge-contracts/contracts/forge-collab.json
  • forge-contracts/contracts/forge-community.json
  • forge-contracts/contracts/forge-core.json
  • forge-contracts/contracts/registered/forge-collab.v1.json
  • forge-contracts/contracts/registered/forge-community.v1.json
  • forge-contracts/deployments/contracts/devnet-sakura.json
  • forge-contracts/deployments/devnet-sakura.json
  • forge-contracts/schema/build.py
  • forge-contracts/schema/variants.py
  • forge-contracts/schema/vectors.py
  • forge-contracts/scripts/deploy-v2.mjs
  • forge-contracts/scripts/rc1-live.mjs
  • forge-contracts/scripts/update1-probe.mjs
  • forge-contracts/vectors/rc1/forge-collab.indices.json
  • forge-contracts/vectors/rc1/forge-collab.json
  • forge-contracts/vectors/rc1/forge-community.json
  • forge-contracts/vectors/rc1/forge-core.indices.json
  • forge-contracts/vectors/rc1/forge-core.json
  • forge-web/lib/layout.ts
  • forge-web/lib/sdk/deploy-v2.test.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PastaPastaPasta
PastaPastaPasta merged commit 7177d17 into master Oct 5, 2026
30 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the feat/contract-update-1 branch October 5, 2026 06:46
PastaPastaPasta added a commit that referenced this pull request Oct 5, 2026
Brings #390's contract snapshot (sakura runs UPDATE-1) and the latest master; conflicts resolved keeping both sides.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta added a commit that referenced this pull request Oct 5, 2026
Brings #390's contract snapshot (sakura runs UPDATE-1) and the latest master; conflicts resolved keeping both sides.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta added a commit that referenced this pull request Oct 5, 2026
Brings #390's contract snapshot (sakura runs UPDATE-1) and the latest master; conflicts resolved keeping both sides.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.

1 participant