feat(CHAIN-3293) Migrate Multiproof Contracts to base/contracts#196
feat(CHAIN-3293) Migrate Multiproof Contracts to base/contracts#196
Conversation
…andling into a single function, improving code clarity and maintainability. Update tests accordingly to reflect the new verification structure.
…onventions for clarity in Nullify tests.
…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.
…date validation check to use this constant
…ier, updating documentation and logic to clarify its purpose as the L2 sequence number.
…rnal to public, enhancing accessibility for contract interactions.
…fier to emit event upon credit transfer
…er for consistency with internal function naming conventions.
…nsolidating the return statement for the first dispute game scenario.
…onfigs-and-scripts
Simplify storage and refactor
…kInterval to WithNitro script
Split deploy configs and scripts for no-nitro and with-nitro environments
Co-authored-by: Leopold Joy <leo@leopoldjoy.com>
use l1head for proofs after initialization
…ontracts-to-basecontracts
…ontracts-to-basecontracts
🟡 Heimdall Review Status
|
|
|
||
| - name: Run Forge tests | ||
| run: just test | ||
| run: just test && just test-multiproof |
There was a problem hiding this comment.
Temporary and should be removed once disputegame changes are made
There was a problem hiding this comment.
Could this be a multiproof directory inside of the existing test/ directory?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Not blocking for this PR, but these deploy config formats do not match the existing deploy configs in this repo
There was a problem hiding this comment.
We no longer need patch files - can just update the contracts. This can be a follow up PR though
There was a problem hiding this comment.
Oh i wasnt sure if we could update the contracts directly. ill make this change and that solves the testing issue as well
There was a problem hiding this comment.
Nit: this should be moved to a mocks folder somewhere (can be done in follow up PR)
| /// @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 { |
There was a problem hiding this comment.
Lets add the ISemver interface in a follow up PR
There was a problem hiding this comment.
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 |
| test: | ||
| forge test --ffi -vvv | ||
|
|
||
| .PHONY: test-multiproof |
There was a problem hiding this comment.
Remove this if possible. We don't need it in both the makefile and justfile anyways
| test/kontrol/logs | ||
| out | ||
| lib | ||
| multiproof-out |
| // 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. |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
Was this change necessary? The import worked before
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
initializeconstructor. This is done through agit patchfound inmultiproof_tests/optimism.patch. Because this patch is needed for the tests to pass, we keep all multiproof tests in the themultiproof_testsfolder and use a foundry profile to trigger it. This is abstracted into a make command:make test-multiproof