Skip to content

feat(contracts-rootstock): carry the dispute-game init bond as an ABI argument - #52

Merged
asoto-iov merged 1 commit into
rsk/developfrom
rsk/payrollup-191-init-bond-env
Sep 9, 2026
Merged

feat(contracts-rootstock): carry the dispute-game init bond as an ABI argument#52
asoto-iov merged 1 commit into
rsk/developfrom
rsk/payrollup-191-init-bond-env

Conversation

@asoto-iov

@asoto-iov asoto-iov commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Makes the dispute-game init bond an explicit argument to an RSK-owned entry point, so oprsk-deployer can deploy a configured value. PAYROLLUP-191 ships 0 on regtest, which stops a permissioned network parking proposer capital.

Paired with rsksmart/rootstack#129, which supplies the value.

Merge order: this PR first, as a squash merge (the model in AGENTS_rsk.md for feature PRs). Then repin rootstack's submodule gitlink to the resulting rsk/develop SHA — a squash merge creates a new commit, so this branch's head is not reachable from rsk/develop afterwards and the old pin would dangle.

Layering

runSplitWithBond(input, bond)   implementation
runSplit(input)                 applies DEFAULT_INIT_BOND (upstream parity)
runWithBytes(bytes)             unchanged
runSplitWithBytes(bytes)        decodes (DeployOPChainInput, uint256)

Upstream's Types.DeployOPChainInput is untouched — the extra element lives in this entry point's own tuple, so byte-compatibility with DeployOPChain.run is unaffected and the four parity tests pass unmodified.

The script has no notion of "unset": the caller resolves the effective value, matching how Go already owns every other dispute parameter. Disabled game types keep a literal 0 regardless of the argument, which the splitter's config validation requires.

Rejected alternative: an environment variable

An earlier draft (#49, closed unmerged) carried the bond as RSK_DISPUTE_GAME_INIT_BOND_WEI. Recorded here because PAYROLLUP-191 asks for the rejected alternatives and their reasons:

  • No script on op-deployer's productive path reads vm.env; the one that does (VerifyOPCM) verifies rather than deploys.
  • It needed a nosemgrep bypass of this repo's own rule, a virtual initBond() plus a harness, a vm.setEnv pin in the shared fixture, a quarantined test/isolated/ directory and a second CI invocation.

None of that machinery exists in this diff — the env channel never landed on rsk/develop, so this is the first mechanism to reach it.

Tests

The bond tests are ordinary tests: no environment, no harness, no quarantined invocation, so CI stays a single forge test. 26/26 locally (forge build + forge test), including the four upstream-parity tests. A new assertion pins DEFAULT_INIT_BOND to the Go-side DefaultDisputeGameInitBondWei so an upstream bump has to be reconciled deliberately instead of drifting apart on a merge.

Validated end to end on the rootstack side: just verify-regtest PASS with this pin, receipt linked in PAYROLLUP-191.

PAYROLLUP-191

@github-actions github-actions Bot added the risk/high Touches a sensitive area; review carefully label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

PR Triager kept risk/high. It was already set, so the model was not consulted again for this revision. It came either from a path listed in .github/rsk-pr-triager.yml or from an earlier revision's assessment.

@github-actions github-actions Bot added the triaged This revision was risk-triaged label Sep 3, 2026
… argument

RSKDeployOPChain gains an RSK-owned entry point that takes the init bond for
the enabled permissioned game as an explicit argument, so oprsk-deployer can
supply a configured value — PAYROLLUP-191 ships 0 on regtest, which stops a
permissioned network parking proposer capital.

    runSplitWithBond(input, bond)   implementation
    runSplit(input)                 applies DEFAULT_INIT_BOND (upstream parity)
    runWithBytes(bytes)             unchanged
    runSplitWithBytes(bytes)        decodes (DeployOPChainInput, uint256)

Upstream's Types.DeployOPChainInput is untouched: the extra element lives in
this entry point's own tuple, so byte-compatibility with DeployOPChain.run is
unaffected and the four parity tests pass unmodified. The script has no notion
of "unset" — the caller resolves the effective value, matching how Go already
owns every other dispute parameter.

Disabled game types keep a literal 0 bond regardless of the argument, which
the splitter's config validation requires.

The bond tests are ordinary tests: no environment, no harness, no quarantined
invocation, so CI stays a single forge test run. A new assertion pins
DEFAULT_INIT_BOND to the Go-side constant so an upstream bump has to be
reconciled deliberately instead of drifting apart on a merge.

PAYROLLUP-191
@asoto-iov
asoto-iov force-pushed the rsk/payrollup-191-init-bond-env branch from d0aff8e to e49152d Compare September 7, 2026 19:48
@github-actions github-actions Bot added triaged This revision was risk-triaged and removed triaged This revision was risk-triaged labels Sep 7, 2026
@asoto-iov asoto-iov changed the title refactor(contracts-rootstock): carry the dispute-game init bond as an ABI argument feat(contracts-rootstock): carry the dispute-game init bond as an ABI argument Sep 7, 2026
@github-actions github-actions Bot added triaged This revision was risk-triaged and removed triaged This revision was risk-triaged labels Sep 7, 2026
@asoto-iov
asoto-iov marked this pull request as ready for review September 7, 2026 21:19
@asoto-iov
asoto-iov requested a review from a team as a code owner September 7, 2026 21:19
@asoto-iov
asoto-iov requested review from fedejinich and a balanced review from Copilot September 7, 2026 21:19
@github-actions github-actions Bot added triaged This revision was risk-triaged and removed triaged This revision was risk-triaged labels Sep 7, 2026

Copilot AI 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.

🟡 Changes recommended

Add coverage verifying custom-bond behavior for the super-permissioned deployment mode.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds an ABI argument for configuring dispute-game initialization bonds while preserving upstream-compatible defaults.

Changes:

  • Adds bond-aware deployment entry points.
  • Applies the bond only to the enabled permissioned game.
  • Adds bond configuration, ABI-decoding, and lifecycle tests.
File summaries
File Description
packages/contracts-rootstock/test/RSKOPCMSplitter.t.sol Tests zero-bond game creation and resolution.
packages/contracts-rootstock/test/RSKDeployOPChainInitBond.t.sol Tests custom, default, zero, and ABI-decoded bonds; lacks super-root-enabled coverage.
packages/contracts-rootstock/script/RSKDeployOPChain.s.sol Accepts and applies an explicit initialization bond.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/contracts-rootstock/script/RSKDeployOPChain.s.sol
@asoto-iov
asoto-iov merged commit a4155a6 into rsk/develop Sep 9, 2026
13 checks passed
@asoto-iov
asoto-iov deleted the rsk/payrollup-191-init-bond-env branch September 9, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/high Touches a sensitive area; review carefully triaged This revision was risk-triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants