Skip to content

[Certora] Only bad debt can desync credit from view - #1212

Merged
QGarchery merged 16 commits into
mainfrom
certora-only-bad-debt-desyncs-credit-from-view
Oct 7, 2026
Merged

QGarchery merged 16 commits into
mainfrom
certora-only-bad-debt-desyncs-credit-from-view

Conversation

@aehyvari

@aehyvari aehyvari commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Add onlyBadDebtDesyncsCreditFromView: if stored credit already matches the up-to-date view, they can diverge only when the market’s loss factor increases (bad debt socialization).
Related thread

@aehyvari aehyvari changed the title Only bad debt can desync credit from view [WiP] Only bad debt can desync credit from view Sep 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb0248f5ae

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread certora/confs/BalanceEffectsOnTake.conf Outdated
The liquidation lock's `tload/tstore` kept `onlyBadDebtDesyncsCreditFromViewOnTake`
from finishing, including when split into `buy` and `sell`.

Summarizing `tExchange` and `tGet` as `NONDET` is sound here: the lock only
gates take after the balance writes and liquidate before them, and no rule in
this spec asserts the lock.

The rule runs alone at depth 0; the parametric rule excludes take.  Using
configurations other than Depth 0 times out.  The only solver capable of
solving this is cvc5:nonlin (cvc4:nonlin for vacuity).
@aehyvari
aehyvari force-pushed the certora-only-bad-debt-desyncs-credit-from-view branch from fb0248f to c69d195 Compare September 24, 2026 16:02
@aehyvari aehyvari changed the title Only bad debt can desync credit from view [CertoraOnly bad debt can desync credit from view Sep 24, 2026
@aehyvari aehyvari changed the title [CertoraOnly bad debt can desync credit from view [Certora] Only bad debt can desync credit from view Sep 24, 2026
Comment thread certora/confs/BalanceEffects.conf
Comment thread certora/specs/BalanceEffects.spec
Comment thread certora/confs/BalanceEffectsOnTake.conf Outdated

Copy link
Copy Markdown
Contributor Author

The two failing Certora checks look like memouts rather than counterexamples. Healthiness also failed on the exact main base commit, so its failure does not appear to be caused by this PR. BalanceEffects passed on that base; this PR adds a rule there, and the prover may be scheduling memory-hungry checks together (possibly including the new rule), causing a job to be killed. One option is to split BalanceEffects.conf further so fewer checks run together, then rerun CI to see whether that resolves the memout. This is a hypothesis, not yet a confirmed root cause.

Comment thread certora/confs/BalanceEffectsOnTake.conf Outdated
Comment thread certora/confs/BalanceEffectsOnTake.conf Outdated
Comment thread certora/confs/BalanceEffectsOnTake.conf Outdated
Comment thread certora/README.md Outdated
Comment thread certora/specs/BalanceEffects.spec Outdated
Comment thread certora/confs/BalanceEffectsOnTake.conf Outdated
@aehyvari
aehyvari requested a review from QGarchery September 28, 2026 08:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 610dc894d7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread certora/confs/base/BalanceEffectsBase.conf Outdated
Comment thread certora/confs/base/BalanceEffectsBase.conf
Comment thread certora/confs/BalanceEffectsOnTake.conf Outdated
Comment thread certora/specs/BalanceEffects.spec
Co-authored-by: Quentin Garchery <garchery.quentin@gmail.com>
Signed-off-by: Antti Hyvärinen <antti@morpho.xyz>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24e679cb28

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread certora/confs/BalanceEffectsOnTake.conf Outdated
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T11:57:27.719533Z 717a7c5 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 717a7c5734

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread certora/specs/BalanceEffects.spec
@aehyvari
aehyvari requested a review from QGarchery October 7, 2026 11:42
@QGarchery
QGarchery merged commit 8543c64 into main Oct 7, 2026
119 of 120 checks passed
@QGarchery
QGarchery deleted the certora-only-bad-debt-desyncs-credit-from-view branch October 7, 2026 12:09
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.

3 participants