feat: descope dependency manager#242
Conversation
| _chainId = bound(_chainId, 1, type(uint128).max); | ||
| vm.assume(_chainId != block.chainid); | ||
| vm.assume(_chainId <= type(uint128).max); | ||
| vm.assume(_chainId + 1 != block.chainid); |
There was a problem hiding this comment.
It was that or fuzzing another chainId
| /// @dev Tests that current chain is always in dependency set | ||
| function testFuzz_isInDependencySet_currentChain_succeeds(uint256 _chainId) public { | ||
| vm.assume(_chainId <= type(uint8).max); | ||
| _chainId = bound(_chainId, 1, type(uint8).max); |
There was a problem hiding this comment.
why uint8 here and uint128 in the test_addDependency_portalAlreadyAuthorized_reverts test.
There was a problem hiding this comment.
this, it could be fuzzed using type(uint256).max I think
0xDiscotech
left a comment
There was a problem hiding this comment.
If removing the vm.skip() on DependencyManager tests, they fail with
[FAIL: revert: Proxy: implementation not initialized.
Is this expected or out of scope? Or should we ensure the contract is properly tested and covered even though it won't be part of the first version of the system?
| function testFuzz_dependencySet_succeeds(uint256[] memory _chainIds) public { | ||
| vm.assume(_chainIds.length <= type(uint8).max); | ||
| // Limit array size to prevent too many rejections | ||
| _chainIds = new uint256[](bound(_chainIds.length, 0, 32)); |
There was a problem hiding this comment.
If 0, loops and assertions will never be reached
| _chainIds = new uint256[](bound(_chainIds.length, 0, 32)); | |
| _chainIds = new uint256[](bound(_chainIds.length, 1, 32)); |
| function testFuzz_dependencySet_succeeds(uint256[] memory _chainIds) public { | ||
| vm.assume(_chainIds.length <= type(uint8).max); | ||
| // Limit array size to prevent too many rejections | ||
| _chainIds = new uint256[](bound(_chainIds.length, 0, 32)); |
There was a problem hiding this comment.
This won't work. The fuzzed array is being overwritten by an empty array of the bounded length - so all the values will be 0.
If you want to fuzz the values on the array, but limit its size, you need to fuzz one and create another one, then copy its values:
function testFuzz_dependencySet_succeeds(uint256[32] memory _chainIdsValues) public {
// Limit array size to prevent too many rejections
uint256[] memory chainIds = new uint256[](bound(_chainIdsValues.length, 1, 32));
// Loop over the values and add them to the array
for (uint256 i = 0; i < chainIds.length; i++) {
chainIds[i] = _chainIdsValues[i];
}There was a problem hiding this comment.
The same can be applied on the other 2 tests where this behavior is repeated
0xDiscotech
left a comment
There was a problem hiding this comment.
Approved since there will be one task to revisit the DependencyManager test once is included in the next release scope and vm.skip() is removed.
* feat: add shared lockbox (#126) * feat: create shared lockbox contract with its interface and unit tests * chore: polish tests and interfaces * chore: run pre-pr * chore: improve natspec * chore: run pre-pr * chore: update compiler version * feat: integrate portal to lockbox (#139) * feat: integrate portal to lockbox * fix: pr fixes * test: refactor assert * feat: add liquidity migrator contract with its unit test and interface (#128) * feat: create shared lockbox contract with its interface and unit tests * chore: polish tests and interfaces * chore: run pre-pr * chore: improve natspec * chore: run pre-pr * feat: add liqudity migrator contract with its unit test and interface * chore: remove underscore on stack var * chore: add todo * chore: run pre-pr * chore: add contract title natspec and proxied * refactor: integrate testing suite with common test * chore: pre-pr * chore: add spec test * feat: integrate system config with superchain config (#140) * feat: integrate portal to lockbox * fix: pr fixes * test: refactor assert * feat: integrate system config with superchain config * fix: remove OPCM interop * test: add dependency counter test * feat: manage dependency set on superchain config (#138) * chore: add zero dependencies check (#142) * fix: pre pr * feat: Add pause check (#145) * feat: Add pause check Co-authored-by: 0xParticle <particle@defi.sucks> Co-authored-by: gotzenx <78360669+gotzenx@users.noreply.github.com> Co-authored-by: Joxess <joxes@defi.sucks> * test: add tests natspecs --------- Co-authored-by: 0xParticle <particle@defi.sucks> Co-authored-by: gotzenx <78360669+gotzenx@users.noreply.github.com> Co-authored-by: Joxess <joxes@defi.sucks> * fix: pre pr and interfaces imports * feat: add upgrader role to superchain config (#163) * feat: use superchain config lockbox in portal (#164) * feat: use superchain config lockbox in portal * test: add new sharedlockbox test * fix: pre pr * feat: liquidity migrator deployment (#166) * feat: liquidity migrator deployment * test: fix comment * test: fix internal variables names * feat: dependency set refactor (#170) * feat: dependency set refactor * fix: deploy script variable name * fix: pr * fix: pr * fix: pre pr * fix: semgrep * fix: merge conflict * [WIP] feat: new lockbox (#192) * chore: partial implementation comments * feat: new lockbox * feat: introduce dependency manager predeploy * feat: remove timestamp check from CrossL2Inbox * feat: introduce cluster manager role and remove immutables * fix: remove unnecessary code, fix tests and setup * feat: use unstructured storage and OZ v5 * fix: L2ToL2CDM dependency set check * fix: dependency manager gas limit * feat: refactor interop feature contracts (#200) * feat: refactor interop feature contracts * fix: add noops comment * feat: adds OptimismPortal migrated flag * test: add missing tests * fix: portal interop storage naming --------- Co-authored-by: Skeletor Spaceman <skeletorspaceman@gmail.com> * fix: pre pr, setup and tests * fix: remove system config interop and add interop portal target check (#205) * fix: remove system config interop and add interop portal check * fix: interop portal target check order * fix: remove wrong comment * fix: refactor portal noops function (#206) * test: add dependency manager and portal interop tests (#209) * feat: initialize shared lockbox in interop portal (#211) * feat: initialize shared lockbox in interop portal * fix: refactor shared lockbox storage getter * fix: lockbox pr fixes (#214) * fix: pre pr * fix: semver lock * fix: semver lock * feat: descope dependency manager (#242) * feat: descope dependency manager * test: fix tests * test: fix tests * chore: improve eth liquidity test (#248) * fix: internal review fixes (#243) * fix: I-0 * fix: I-1 * fix: I-2 * fix: I-3 * fix: I-6 * fix: I-7 * fix: I-9 * fix: pre pr * fix: pre pr * fix: portal withdrawal checks (#255) * fix: portal withdrawal checks * fix: include current withdrawal check * fix: remove unused interop contracts (#256) * test: fix flake tests (#257) * fix: adjust op-deployer interop scripts (#262) * fix: pre pr * fix op-deployer tests * remove dependency code * fix lint * use Bob account --------- Co-authored-by: Disco <131301107+0xDiscotech@users.noreply.github.com> Co-authored-by: AgusDuha <81362284+agusduha@users.noreply.github.com> Co-authored-by: agusduha <agusnduha@gmail.com> Co-authored-by: 0xParticle <particle@defi.sucks> Co-authored-by: gotzenx <78360669+gotzenx@users.noreply.github.com> Co-authored-by: Joxess <joxes@defi.sucks> Co-authored-by: Skeletor Spaceman <skeletorspaceman@gmail.com>
No description provided.