Skip to content

[Certora] settlement fee spread assumption#989

Open
QGarchery wants to merge 7 commits into
mainfrom
certora-settlement-fee-spread
Open

[Certora] settlement fee spread assumption#989
QGarchery wants to merge 7 commits into
mainfrom
certora-settlement-fee-spread

Conversation

@QGarchery

@QGarchery QGarchery commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Fixes:

Also:

  • removes occurrences of onRatify (now renamed isRatified)
  • make settlementFeeSpread use havoc all by default

@QGarchery QGarchery self-assigned this Jun 15, 2026
@QGarchery QGarchery linked an issue Jun 15, 2026 that may be closed by this pull request

// take calls touchMarket see rule takeCallsTouchMarket.
// Thus calling settlementFee (in particular checking if the market is touched) doesn't prune meaningful take paths.
uint256 fee = settlementFee(id, timeToMaturity);

@QGarchery QGarchery Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I tried this

Suggested change
uint256 fee = settlementFee(id, timeToMaturity);
touchMarket(e, offer.market);
uint256 fee = settlementFee@withrevert(id, timeToMaturity);
assert !lastReverted;

but it was causing a long running time in this run. Also it wasn't proving exactly that it's not pruning meaningful paths, because storeInCode is summarized to not revert in this file

@QGarchery QGarchery Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

as is, it feels like TouchMarketIsCalled.spec is a bit redundant with the marketIsCreatedAfter* rules, but it's actually not proving exactly the same thing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

would it work to call settlementFee after take or does the take change the settlementFee?

After take it should not revert, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I tried calling settlementFee after and the HAVOC_ALL summary of the callbacks set tickSpacing to 0 😦

With HAVOC_ECF it works, though.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes basically we can either:

  • have it before which uses havoc all by default, but there is this question of whether it prunes a path
  • have it after which requires to have havoc ecf for all callbacks

I like the first solution better, since it has no unrelated assumptions about callbacks (you need to prove something about the settlement fee, which makes sense since this rule is about settlement fee)

chatgpt-codex-connector[bot]

This comment was marked as low quality.

@jhoenicke jhoenicke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The TouchMarketIsCalled looks fine, the rest is just a comment update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Certora] side effect of calling settlementFee in a rule

2 participants