Skip to content

Conversation

@JustXxx
Copy link

@JustXxx JustXxx commented May 30, 2024

forge test --mc FaultDisputeGame3_Test
forge test --mc FaultDispute3_1v1_Actors_Test

@JustXxx JustXxx requested a review from qizhou May 30, 2024 16:15
Comment on lines +1037 to +1047
function _traceAncestorV2(Position _position, uint256 _intervalDepth)
internal
pure
returns (Position ancestor_)
{
if (_position.depth() % _intervalDepth != 0) {
revert InvalidPosition();
}
ancestor_ = _position.traceAncestor();
return _firstValidRightIndex(ancestor_, _intervalDepth);
}

Check failure

Code scanning / Slither

Weak PRNG

FaultDisputeGame._traceAncestorV2(Position,uint256) (src/dispute/FaultDisputeGame3.sol#1037-1047) uses a weak PRNG: "_position.depth() % _intervalDepth != 0 (src/dispute/FaultDisputeGame3.sol#1042)"
Comment on lines +1053 to +1062
function _firstValidRightIndex(Position _position, uint256 _intervalDepth)
internal
pure
returns (Position first_)
{
first_ = _position;
for (uint64 start = first_.depth(); start % _intervalDepth != 0; start++) {
first_ = first_.right();
}
}

Check failure

Code scanning / Slither

Weak PRNG

FaultDisputeGame._firstValidRightIndex(Position,uint256) (src/dispute/FaultDisputeGame3.sol#1053-1062) uses a weak PRNG: "start % _intervalDepth != 0 (src/dispute/FaultDisputeGame3.sol#1059)"
@JustXxx JustXxx merged commit 6e072b3 into ethstorage:develop Jun 1, 2024
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.

2 participants