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

test(medusa): handlers and setup #51

Draft
wants to merge 12 commits into
base: dev
Choose a base branch
from
Draft

Conversation

simon-something
Copy link
Member

@simon-something simon-something commented Nov 10, 2024

Need review esp for the bond escalation handlers (nbd if faulty, but maybe annoying to debug in the long run).
Sanity check of the setup passes.

+ Might still add some extra-constraints in some handlers

Comment on lines +75 to +76
"platformConfig": {
"target": "test/invariants/FuzzTest.t.sol",
Copy link
Member

Choose a reason for hiding this comment

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

Observation: there's no path branching with regards to fuzz or symbolic within test/invariants.

Copy link
Member Author

Choose a reason for hiding this comment

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

symbolic exec is a bit too optimistic timing-wise, we can reorg if we do get there':)

test/invariants/Setup.t.sol Show resolved Hide resolved
test/invariants/handlers/BaseHandler.t.sol Outdated Show resolved Hide resolved
test/invariants/handlers/BaseHandler.t.sol Outdated Show resolved Hide resolved
test/invariants/handlers/BaseHandler.t.sol Outdated Show resolved Hide resolved
test/invariants/handlers/BaseHandler.t.sol Outdated Show resolved Hide resolved
Comment on lines +28 to +29
// Calculate request ID using same logic as Oracle
bytes32 requestId = keccak256(abi.encode(requestData));
Copy link
Member

Choose a reason for hiding this comment

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

A getId() util would come in handy.

Copy link
Contributor

Choose a reason for hiding this comment

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

prophet-core/solidity/libraries/ValidatorLib.sol is at hand.

Comment on lines 110 to 111
IOracle.Response memory response = _ghost_responseData[dispute.responseId];
oracle.updateDisputeStatus(_ghost_requestData[requestId], response, dispute, status);
Copy link
Member

@0xJabberwock 0xJabberwock Nov 12, 2024

Choose a reason for hiding this comment

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

Can the call to Oracle::updateDisputeStatus ever bypass the error Oracle_NotDisputeOrResolutionModule, as a part of handleUpdateDisputeStatus()?

Comment on lines +48 to +49
if (_ghost_activeResponses[requestId].length == 0) return (bytes32(0));
bytes32 responseId = _ghost_activeResponses[requestId][0];
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't _getRandomActiveResponse() be used in these situations (seen in handleDisputeResponseOracle() and handleFinalize()) so to fuzz _ghost_activeResponses?

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.

3 participants