Skip to content

feat(CHAIN-3293) Migrate Multiproof Contracts to base/contracts#196

Open
jjtny1 wants to merge 91 commits intomainfrom
joby.thundil/CHAIN-3293-migrate-multiproof-contracts-to-basecontracts
Open

feat(CHAIN-3293) Migrate Multiproof Contracts to base/contracts#196
jjtny1 wants to merge 91 commits intomainfrom
joby.thundil/CHAIN-3293-migrate-multiproof-contracts-to-basecontracts

Conversation

@jjtny1
Copy link

@jjtny1 jjtny1 commented Feb 28, 2026

This PR migrates the contracts from https://github.com/base/multiproof-dispute-game to base contracts.

Multiproofs depend on a modified version of the DisputeGameFactory that takes arguments in the initialize constructor. This is done through a git patch found in multiproof_tests/optimism.patch. Because this patch is needed for the tests to pass, we keep all multiproof tests in the the multiproof_tests folder and use a foundry profile to trigger it. This is abstracted into a make command: make test-multiproof

…andling into a single function, improving code clarity and maintainability. Update tests accordingly to reflect the new verification structure.
…ild game in AggregateVerifier. Implement corresponding test case to verify this behavior.
…d rollup configuration. Update verification methods to use a journal hash instead of root claims. Modify MockVerifier and tests accordingly.
…ier, updating documentation and logic to clarify its purpose as the L2 sequence number.
…rnal to public, enhancing accessibility for contract interactions.
…er for consistency with internal function naming conventions.
…nsolidating the return statement for the first dispute game scenario.
@linear
Copy link

linear bot commented Feb 28, 2026

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Feb 28, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1


- name: Run Forge tests
run: just test
run: just test && just test-multiproof
Copy link
Author

Choose a reason for hiding this comment

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

Temporary and should be removed once disputegame changes are made

Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a multiproof directory inside of the existing test/ directory?

Copy link
Author

Choose a reason for hiding this comment

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

I originally had it like that but I couldnt figure out a way to tell forge test to skip the multiproof directory. The multiproof tests need the optimism.patch applied or else they fail and the other tests fail when that patch is applied so i separated them

Copy link
Contributor

Choose a reason for hiding this comment

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

Not blocking for this PR, but these deploy config formats do not match the existing deploy configs in this repo

Copy link
Contributor

Choose a reason for hiding this comment

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

We no longer need patch files - can just update the contracts. This can be a follow up PR though

Copy link
Author

Choose a reason for hiding this comment

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

Oh i wasnt sure if we could update the contracts directly. ill make this change and that solves the testing issue as well

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this should be moved to a mocks folder somewhere (can be done in follow up PR)

Copy link
Author

Choose a reason for hiding this comment

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

Ill move it 👍

/// @dev Signers are registered by providing a valid AWS Nitro attestation document.
/// Each signer is associated with the PCR0 (enclave image hash) from their attestation,
/// which allows TEEVerifier to validate that a signer was registered with a specific image.
contract SystemConfigGlobal is OwnableManagedUpgradeable, NitroValidator {
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets add the ISemver interface in a follow up PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. Also, note that this file will be significantly overhauled by my ZK verifier rework PR which I'll open shortly. (It switches to ZK verifying via the Automata SDK instead of the existing op-enclave-style onchain certificate attestation approach which is currently used here.)

abigen --abi out/FeeDisburser.sol/FeeDisburser.abi.json --pkg bindings --type FeeDisburser --out bindings/fee_disburser.go
cd bindings && go mod tidy

.PHONY: checkout-op-commit
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this

test:
forge test --ffi -vvv

.PHONY: test-multiproof
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this if possible. We don't need it in both the makefile and justfile anyways

test/kontrol/logs
out
lib
multiproof-out
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't need this

// Contract is not deployed as part of the standard deployment script.
excludes[j++] = "src/revenue-share/BalanceTracker.sol";

// Exclude Multiproof contracts as they are not part of standard deployment script.
Copy link
Contributor

Choose a reason for hiding this comment

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

They should be added to the standard deployment script


// Libraries
import { JSONParserLib } from "solady/src/utils/JSONParserLib.sol";
import { JSONParserLib } from "@solady/utils/JSONParserLib.sol";
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this change necessary? The import worked before

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.

5 participants