forked from ethstorage/optimism
-
Notifications
You must be signed in to change notification settings - Fork 1
Develop #17
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
Merged
Merged
Develop #17
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
merge from optimism
merge from optimism develop
Copy FaultDisputeGame2.sol and FaultDisputGame2.t.sol and FaultDisputeActors2.sol
modify Nary, adapted to version 1.2.0
add LibDA.sol
Support Nary=4, draft version
…d a test for last attack branch
rename _verifyExecBisectionRoot to _verifyExecMultisectionRoot and add a test for last attack branch…
fix ancestor search bugs and support DA in stepV2()
…non-root-claim ancestor
Add _findExecTraceAncestor() test for attacking the last branch with non-root-claim ancestor
fix the unit test of bond
fix the unit test of clock
fix the unit test of move
…dLocalData fix the unit test of addLocalData
…solve fix the unit test of resolve
…st contract has been added to minimize changes in the testing code
…ontract The "attack" has been modified to support "da" and the "FaultDisputeGameTest" contract has been added to minimize changes in the testing code
fix the unit test of resolve
Added an attack test with the da type as calldata.
Comment on lines
+1142
to
+1169
| uint256 _intervalDepth | ||
| ) | ||
| internal | ||
| pure | ||
| returns (Position first_) | ||
| { | ||
| first_ = _position; | ||
| for (uint64 start = first_.depth(); start % _intervalDepth != 0; start++) { | ||
| first_ = first_.right(); | ||
| } | ||
| } | ||
|
|
||
| function attackV2(Claim _disputed, uint256 _parentIndex, uint64 _attackBranch, uint256 _daType, bytes memory _claims) public payable { | ||
| Claim claim = Claim.wrap(LibDA.getClaimsHash(_daType, MAX_ATTACK_BRANCH, _claims)); | ||
| moveV2(_disputed, _parentIndex, claim, _attackBranch); | ||
| } | ||
|
|
||
| function step( | ||
| uint256 _claimIndex, | ||
| bool _isAttack, | ||
| bytes calldata _stateData, | ||
| bytes calldata _proof | ||
| ) | ||
| public | ||
| virtual | ||
| { | ||
| revert NotSupported(); | ||
| } |
Check failure
Code scanning / Slither
Weak PRNG
FaultDisputeGame._findTraceAncestorRoot(Position,uint256,bool) (src/dispute/FaultDisputeGameN.sol#1142-1169) uses a weak PRNG: "offset = ancestorPos_.raw() % (1 << N_BITS) (src/dispute/FaultDisputeGameN.sol#1156)"
Comment on lines
+1171
to
+1177
| function move(Claim _disputed, uint256 _challengeIndex, Claim _claim, bool _isAttack) public payable virtual { | ||
| revert NotSupported(); | ||
| } | ||
|
|
||
| function getClaim(bytes32 _claimRoot, Position _pos, LibDA.DAItem memory _daItem) internal view returns (Claim claim_) { | ||
| LibDA.verifyClaimHash(_daItem.daType, _claimRoot, MAX_ATTACK_BRANCH, _pos.raw() % (MAX_ATTACK_BRANCH + 1), _daItem.dataHash, _daItem.proof); | ||
| claim_ = Claim.wrap(_daItem.dataHash); |
Check failure
Code scanning / Slither
Weak PRNG
FaultDisputeGame._traceAncestorV2(Position,uint256) (src/dispute/FaultDisputeGameN.sol#1171-1177) uses a weak PRNG: "_position.depth() % _intervalDepth != 0 (src/dispute/FaultDisputeGameN.sol#1172)"
Comment on lines
+1183
to
+1195
Check failure
Code scanning / Slither
Weak PRNG
FaultDisputeGame._firstValidRightIndex(Position,uint256) (src/dispute/FaultDisputeGameN.sol#1183-1195) uses a weak PRNG: "start % _intervalDepth != 0 (src/dispute/FaultDisputeGameN.sol#1192)"
Comment on lines
+1218
to
+1221
Check failure
Code scanning / Slither
Weak PRNG
FaultDisputeGame.getClaim(bytes32,Position,LibDA.DAItem) (src/dispute/FaultDisputeGameN.sol#1218-1221) uses a weak PRNG: "LibDA.verifyClaimHash(_daItem.daType,_claimRoot,MAX_ATTACK_BRANCH,_pos.raw() % (MAX_ATTACK_BRANCH + 1),_daItem.dataHash,_daItem.proof) (src/dispute/FaultDisputeGameN.sol#1219)"
JustXxx
pushed a commit
that referenced
this pull request
Sep 11, 2024
* feat: add L2 standrad bridge interop contract * test: add L2 standard bridge interop unit tests (#13) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: unit tests fixes * fix: super to legacy tests failing * fix: mock and expect mint and burn * fix: add generic factory interface (#14) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: add generic factory interface * feat: modify OptimismMintableERC20Factory for convert (#17) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: add generic factory interface * feat: modify OptimismMintableERC20Factory for convert * fix: use only a public function for create3 * feat: rollback interop factory, modify legacy one * fix: delete local token return variable * fix: PR fixes * test: fix address assuming * test: fix view warning * fix: snapshots * test: small fixes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.