Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix code coverage - stack too deep issues #12843

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
40b771b
fix code coverage - stack too deep issues
AmadiMichael Nov 6, 2024
d496004
fix ci
AmadiMichael Nov 6, 2024
88a12fb
fix
AmadiMichael Nov 6, 2024
9102a55
fix safe call tests for forge coverage
AmadiMichael Nov 6, 2024
5ba910d
fix safe call tests for forge coverage
AmadiMichael Nov 6, 2024
204f9fc
fix failing cannon fuzz tests
AmadiMichael Nov 7, 2024
84db6cd
fix
AmadiMichael Nov 7, 2024
2910308
update lib-keccak dep
AmadiMichael Nov 7, 2024
48f4228
semver lock
AmadiMichael Nov 7, 2024
0e1476e
Merge branch 'develop' of https://github.com/ethereum-optimism/optimi…
AmadiMichael Nov 8, 2024
6409a48
add safe call test comment
AmadiMichael Nov 8, 2024
e7ae34f
fix failing coverage test
AmadiMichael Nov 8, 2024
dafad3c
pull develop in
AmadiMichael Nov 13, 2024
60f18c7
fixes
AmadiMichael Nov 13, 2024
316c93e
Merge branch 'develop' of https://github.com/ethereum-optimism/optimi…
AmadiMichael Nov 19, 2024
573cdef
pull develop and fix compilation fail
AmadiMichael Nov 19, 2024
4954115
Merge branch 'develop' of https://github.com/ethereum-optimism/optimi…
AmadiMichael Nov 20, 2024
adb5b4d
Merge branch 'develop' of https://github.com/ethereum-optimism/optimi…
AmadiMichael Nov 20, 2024
a1c23c6
Merge branch 'develop' of https://github.com/ethereum-optimism/optimi…
AmadiMichael Nov 24, 2024
d00ac35
Merge branch 'develop' of https://github.com/ethereum-optimism/optimi…
AmadiMichael Nov 25, 2024
7a2eb56
pull
AmadiMichael Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions packages/contracts-bedrock/scripts/deploy/DeployDisputeGame.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -441,18 +441,20 @@ contract DeployDisputeGame is Script {
abi.encodeCall(
IPermissionedDisputeGame.__constructor__,
(
args.gameType,
args.absolutePrestate,
args.maxGameDepth,
args.splitDepth,
args.clockExtension,
args.maxClockDuration,
args.gameVm,
args.delayedWethProxy,
args.anchorStateRegistryProxy,
args.l2ChainId,
args.proposer,
args.challenger
IPermissionedDisputeGame.PDGConstructorParams({
_gameType: args.gameType,
_absolutePrestate: args.absolutePrestate,
_maxGameDepth: args.maxGameDepth,
_splitDepth: args.splitDepth,
_clockExtension: args.clockExtension,
_maxClockDuration: args.maxClockDuration,
_vm: args.gameVm,
_weth: args.delayedWethProxy,
_anchorStateRegistry: args.anchorStateRegistryProxy,
_l2ChainId: args.l2ChainId,
_proposer: args.proposer,
_challenger: args.challenger
})
)
)
)
Expand Down
16 changes: 8 additions & 8 deletions packages/contracts-bedrock/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,20 @@
"sourceCodeHash": "0x0fa0633a769e73f5937514c0003ba7947a1c275bbe5b85d78879c42f0ed8895b"
},
"src/cannon/MIPS.sol": {
"initCodeHash": "0xa3cbf121bad13c00227ea4fef128853d9a86b7ec9158de894f99b58d38d7630a",
"sourceCodeHash": "0xd8467700c80b3e62fa37193dc6513bac35282094b686b50e162e157f704dde00"
"initCodeHash": "0xe96abd4c9213a19e47d097c325d91f22d2ed0f719d8bdb9b72d2db2c05280e19",
"sourceCodeHash": "0x8e420e17d49176eefc48ddcb92c50a37588778ef971eadd7d6af67f62c0d1e24"
},
"src/cannon/MIPS2.sol": {
"initCodeHash": "0xaedf0d0b0e94a0c5e7d987331d2fdba84230f5704a6ca33677e70cde7051b17e",
"sourceCodeHash": "0x9fa2d1297ad1e93b4d3c5c0fed08bedcd8f746807589f0fd3369e79347c6a027"
"initCodeHash": "0xcdfb22c6cec3598769132453bb236845a61547f3937aa4fd9a020a75a69fc5f6",
"sourceCodeHash": "0x1b09fbf9ce12ef95a98c8d61d80cb25ba40eb935fa2c275501dfbdc62ef4afdc"
},
"src/cannon/MIPS64.sol": {
"initCodeHash": "0x93aa8d7f9fd3c22276c0d303a3fefdf8f73cc55807b35e483bba64c92d02aaef",
"sourceCodeHash": "0x171d66c651fdad2ac9c287da92689815a5b09589945ada092179508ad2326306"
"initCodeHash": "0x2f26c72f7fadedb10d356c00f79108ee35140b990c6b8823c6e450b39c9104d1",
"sourceCodeHash": "0xe06dc48eb1b1f07455e44e5a4c447c773c2e3830a09f0792455bde07b3b85697"
},
"src/cannon/PreimageOracle.sol": {
"initCodeHash": "0x5d7e8ae64f802bd9d760e3d52c0a620bd02405dc2c8795818db9183792ffe81c",
"sourceCodeHash": "0x979d8595d925c70a123e72c062fa58c9ef94777c2e93b6bc3231d6679e2e9055"
"initCodeHash": "0x2bef439027c37c65dd8e7d9a987ff14e1dba94ee5fe5f316a77ecf46a8db4b3f",
"sourceCodeHash": "0x70965927d1cfcafa8975f3fdc98a138efe413c4a1585c0f60e0d21cfd396cc7c"
},
"src/dispute/AnchorStateRegistry.sol": {
"initCodeHash": "0x7bdbf9dc5125c953ea1833ccf0ad0e07d25b6f6c47e23da5374413324a38c5f9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,71 @@
{
"inputs": [
{
"internalType": "GameType",
"name": "_gameType",
"type": "uint32"
},
{
"internalType": "Claim",
"name": "_absolutePrestate",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "_maxGameDepth",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_splitDepth",
"type": "uint256"
},
{
"internalType": "Duration",
"name": "_clockExtension",
"type": "uint64"
},
{
"internalType": "Duration",
"name": "_maxClockDuration",
"type": "uint64"
},
{
"internalType": "contract IBigStepper",
"name": "_vm",
"type": "address"
},
{
"internalType": "contract IDelayedWETH",
"name": "_weth",
"type": "address"
},
{
"internalType": "contract IAnchorStateRegistry",
"name": "_anchorStateRegistry",
"type": "address"
},
{
"internalType": "uint256",
"name": "_l2ChainId",
"type": "uint256"
},
{
"internalType": "address",
"name": "_proposer",
"type": "address"
},
{
"internalType": "address",
"name": "_challenger",
"type": "address"
"components": [
{
"internalType": "GameType",
"name": "_gameType",
"type": "uint32"
},
{
"internalType": "Claim",
"name": "_absolutePrestate",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "_maxGameDepth",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_splitDepth",
"type": "uint256"
},
{
"internalType": "Duration",
"name": "_clockExtension",
"type": "uint64"
},
{
"internalType": "Duration",
"name": "_maxClockDuration",
"type": "uint64"
},
{
"internalType": "contract IBigStepper",
"name": "_vm",
"type": "address"
},
{
"internalType": "contract IDelayedWETH",
"name": "_weth",
"type": "address"
},
{
"internalType": "contract IAnchorStateRegistry",
"name": "_anchorStateRegistry",
"type": "address"
},
{
"internalType": "uint256",
"name": "_l2ChainId",
"type": "uint256"
},
{
"internalType": "address",
"name": "_proposer",
"type": "address"
},
{
"internalType": "address",
"name": "_challenger",
"type": "address"
}
],
"internalType": "struct PermissionedDisputeGame.PDGConstructorParams",
"name": "_params",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
Expand Down
24 changes: 13 additions & 11 deletions packages/contracts-bedrock/src/cannon/MIPS.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ contract MIPS is ISemver {
}

/// @notice The semantic version of the MIPS contract.
/// @custom:semver 1.2.1-beta.7
string public constant version = "1.2.1-beta.7";
/// @custom:semver 1.2.1-beta.8
string public constant version = "1.2.1-beta.8";

/// @notice The preimage oracle contract.
IPreimageOracle internal immutable ORACLE;
Expand Down Expand Up @@ -180,15 +180,17 @@ contract MIPS is ISemver {
});
(v0, v1, state.preimageOffset, state.memRoot,,) = sys.handleSysRead(args);
} else if (syscall_no == sys.SYS_WRITE) {
(v0, v1, state.preimageKey, state.preimageOffset) = sys.handleSysWrite({
_a0: a0,
_a1: a1,
_a2: a2,
_preimageKey: state.preimageKey,
_preimageOffset: state.preimageOffset,
_proofOffset: MIPSMemory.memoryProofOffset(STEP_PROOF_OFFSET, 1),
_memRoot: state.memRoot
});
(v0, v1, state.preimageKey, state.preimageOffset) = sys.handleSysWrite(
sys.SysWriteParams({
_a0: a0,
_a1: a1,
_a2: a2,
_preimageKey: state.preimageKey,
_preimageOffset: state.preimageOffset,
_proofOffset: MIPSMemory.memoryProofOffset(STEP_PROOF_OFFSET, 1),
_memRoot: state.memRoot
})
);
} else if (syscall_no == sys.SYS_FCNTL) {
(v0, v1) = sys.handleSysFcntl(a0, a1);
}
Expand Down
24 changes: 13 additions & 11 deletions packages/contracts-bedrock/src/cannon/MIPS2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ contract MIPS2 is ISemver {
}

/// @notice The semantic version of the MIPS2 contract.
/// @custom:semver 1.0.0-beta.21
string public constant version = "1.0.0-beta.21";
/// @custom:semver 1.0.0-beta.22
string public constant version = "1.0.0-beta.22";

/// @notice The preimage oracle contract.
IPreimageOracle internal immutable ORACLE;
Expand Down Expand Up @@ -427,15 +427,17 @@ contract MIPS2 is ISemver {
// Encapsulate execution to avoid stack-too-deep error
(v0, v1) = execSysRead(state, args);
} else if (syscall_no == sys.SYS_WRITE) {
(v0, v1, state.preimageKey, state.preimageOffset) = sys.handleSysWrite({
_a0: a0,
_a1: a1,
_a2: a2,
_preimageKey: state.preimageKey,
_preimageOffset: state.preimageOffset,
_proofOffset: MIPSMemory.memoryProofOffset(MEM_PROOF_OFFSET, 1),
_memRoot: state.memRoot
});
(v0, v1, state.preimageKey, state.preimageOffset) = sys.handleSysWrite(
sys.SysWriteParams({
_a0: a0,
_a1: a1,
_a2: a2,
_preimageKey: state.preimageKey,
_preimageOffset: state.preimageOffset,
_proofOffset: MIPSMemory.memoryProofOffset(MEM_PROOF_OFFSET, 1),
_memRoot: state.memRoot
})
);
} else if (syscall_no == sys.SYS_FCNTL) {
(v0, v1) = sys.handleSysFcntl(a0, a1);
} else if (syscall_no == sys.SYS_GETTID) {
Expand Down
24 changes: 13 additions & 11 deletions packages/contracts-bedrock/src/cannon/MIPS64.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ contract MIPS64 is ISemver {
}

/// @notice The semantic version of the MIPS64 contract.
/// @custom:semver 1.0.0-beta.4
string public constant version = "1.0.0-beta.4";
/// @custom:semver 1.0.0-beta.5
string public constant version = "1.0.0-beta.5";

/// @notice The preimage oracle contract.
IPreimageOracle internal immutable ORACLE;
Expand Down Expand Up @@ -501,15 +501,17 @@ contract MIPS64 is ISemver {
// Encapsulate execution to avoid stack-too-deep error
(v0, v1) = execSysRead(state, args);
} else if (syscall_no == sys.SYS_WRITE) {
(v0, v1, state.preimageKey, state.preimageOffset) = sys.handleSysWrite({
_a0: a0,
_a1: a1,
_a2: a2,
_preimageKey: state.preimageKey,
_preimageOffset: state.preimageOffset,
_proofOffset: MIPS64Memory.memoryProofOffset(MEM_PROOF_OFFSET, 1),
_memRoot: state.memRoot
});
(v0, v1, state.preimageKey, state.preimageOffset) = sys.handleSysWrite(
sys.SysWriteParams({
_a0: a0,
_a1: a1,
_a2: a2,
_preimageKey: state.preimageKey,
_preimageOffset: state.preimageOffset,
_proofOffset: MIPS64Memory.memoryProofOffset(MEM_PROOF_OFFSET, 1),
_memRoot: state.memRoot
})
);
} else if (syscall_no == sys.SYS_FCNTL) {
(v0, v1) = sys.handleSysFcntl(a0, a1);
} else if (syscall_no == sys.SYS_GETTID) {
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/src/cannon/PreimageOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ contract PreimageOracle is ISemver {
uint256 public constant PRECOMPILE_CALL_RESERVED_GAS = 100_000;

/// @notice The semantic version of the Preimage Oracle contract.
/// @custom:semver 1.1.3-beta.6
string public constant version = "1.1.3-beta.6";
/// @custom:semver 1.1.3-beta.7
string public constant version = "1.1.3-beta.7";
Comment on lines +54 to +55
Copy link
Contributor

Choose a reason for hiding this comment

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

accidental semver bump?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, lib-keccak was updated

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense, but do we normally bump semvers when a dependency bump happens? I'm supportive of it because it changes the bytecode, but I suspect historically we've been bad at this and need a way to better automate semver bumps (cc @smartcontracts)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah it's actually on the to-do @smartcontracts

Copy link
Contributor

Choose a reason for hiding this comment

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

CI will at least force you to semver bump when dependencies are changed

Copy link
Contributor

Choose a reason for hiding this comment

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

We are planning to simplify things and remove contract-specific semvers as part of the OPCM Upgrades work in ethereum-optimism/design-docs#159. That design review is today (at 1030am PT)


////////////////////////////////////////////////////////////////
// Authorized Preimage Parts //
Expand Down
Loading