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): disputer properties #58

Merged
merged 6 commits into from
Nov 27, 2024

Conversation

simon-something
Copy link
Member

🤖 Linear

Closes GRT-XXX

Comment on lines 30 to 33
assertEq(_ghost_disputes[_requestId].length, 0, 'property 6: new dispute duplicate');

// add to ghost disputes
_ghost_disputes[_responseId].push(_disputeId);
Copy link
Member

Choose a reason for hiding this comment

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

Is _ghost_disputes key the request ID or the response ID? 😵‍💫

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm, it's request id everywhere (should be here) but I'm wondering if it shouldn't be the response actually (ie all disputes for a response, and it should always be 1 as subsequent are going to the resolution/arbitrator, right?)

Copy link
Member

Choose a reason for hiding this comment

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

Each response may have only one dispute at maximum—I'd stick to request ID being the key, as Oracle::disputeOf already tracks the response to which each dispute is tied to.

and it should always be 1 as subsequent are going to the resolution/arbitrator, right?

That reasoning was correct though, if you meant to track bond-escalated disputes and resolution-escalated disputes separately.

Comment on lines +87 to +88
try bondEscalationModule.pledgeForDispute(_requestData, _disputeData) {
assertTrue(_ghost_escalatedDisputes[_disputeId], 'property 8a: pledging for a dispute not escalated');
Copy link
Member

@0xJabberwock 0xJabberwock Nov 26, 2024

Choose a reason for hiding this comment

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

Beware there are two types of escalation processes: the bond escalation – only initiated for the first dispute of a request, by default – and the resolution escalation – started by default for subsequent disputes of the request, and available for the first one.

Pledging can only be performed for or against the first dispute of a request during the bond escalation process.

Copy link
Member Author

@simon-something simon-something Nov 26, 2024

Choose a reason for hiding this comment

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

hmm, I think there is indeed an issue with the ghost tracking "escalated" disputes, which doesn't really make a difference (ie some escalated aren't accounted as escalated).

Double checking, this is correct?

graph TD
    request[request]
    responseA[responseA]
    responseB[responseB]
    dispute3A[dispute3A]
    dispute2A[dispute2A]
    dispute1A[dispute1A]
    dispute3B[dispute3B]
    dispute2B[dispute2B]
    dispute1B[dispute1B]
    bondEscalation[bondEscalation]
    arbitrator[arbitrator]

    request --> responseA
    request --> responseB
    
    responseA --> dispute2A
    responseA --> dispute3A
    responseA --> dispute1A
    
    responseB --> dispute1B
    responseB --> dispute2B
    responseB --> dispute3B
    
    dispute1A & dispute1B --> bondEscalation
    bondEscalation --> arbitrator
    
    dispute2A & dispute2B --> arbitrator
    dispute3A & dispute3B --> arbitrator
Loading

Copy link
Member

Choose a reason for hiding this comment

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

The diagram is not correct in the following:

  • dispute1B cannot go through bond escalation, as only the first dispute of the request – not of each response – can (previous comment of mine edited to further clarify this).
  • dispute2A, dispute3A, dispute2B and dispute3B cannot be created, as each response may have a maximum of one dispute.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, got it, misunderstood the "Technically, every subsequent disputer escalates their own dispute upon creation, automatically.", this is for other responses

graph TD
    request[request]
    responseA[responseA]
    responseB[responseB]
    disputeA[disputeA]
    disputeB[disputeB]
    bondEscalation[bondEscalation]
    arbitrator[arbitrator]

    request --> responseA
    request --> responseB
    
    responseA --> disputeA
    
    responseB --> disputeB
    
    disputeA --> bondEscalation
    bondEscalation --> arbitrator
    
    disputeB --> arbitrator
Loading

Comment on lines +41 to +43
/// @custom:property-id 7
/// @custom:property A disputer can only escalate the first disputed response
function prop_disputerEscalateFirstDisputedResponse(
Copy link
Member

Choose a reason for hiding this comment

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

Technically, every subsequent disputer escalates their own dispute upon creation, automatically. 🤔

# 🤖 Linear

Closes GRT-XXX

---------

Co-authored-by: drgorillamd <83670532+drgorillamd@users.noreply.github.com>
@simon-something simon-something marked this pull request as ready for review November 27, 2024 15:34
@simon-something simon-something merged commit 3730d59 into test/property-ebo-request-creator Nov 27, 2024
2 of 7 checks passed
@simon-something simon-something deleted the test/prop-disputer branch November 27, 2024 15:35
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