feat(redeem): operator attests service when a holder won't receipt (anti-grief)#21
Merged
Conversation
…nti-grief) A holder could consume a redemption's inference, refuse to sign the receipt, let the deadline pass, and claimDefault — paid back + penalty from the issuer's collateral, with the operator slashed for serving honestly. Close it: the operator now vouches service through the issuing book's quorum. - chain client: settle_redemption_attested, finalize_attested, lot_book getter, and settle_batch_attested_with_lots (returns minted lot ids). - operator: a background attestation pump. The redeem journal records the served work commitment + timestamp; the pump reconciles each served-but-unreceipted redemption against on-chain state via a pure, unit-tested policy (redeem_attest_action): once the holder's grace passes (and the settle can still beat the deadline) it self-signs receiptDigest and posts settleRedemptionAttested; once the challenge window closes it finalizeAttested. Self-sign completes a single-attester book; an N-of-M book additionally needs peer co-signs (the call reverts and retries until quorum) — the next increment. - e2e: settlement-e2e/e2e_anvil now proves attested redemption end to end on anvil WITH a time-warp — quorum vouches, challenge window elapses, finalize settles, liability freed, NO default. (The contract path is also forge-tested.) operator: 20 tests pass (incl. attest_policy); settlement-e2e PASS incl. attested redemption; zk + chain crates build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The grief
A holder could open a redemption, consume its inference, then refuse to sign the receipt, let the deadline pass, and
claimDefault— repaid + penalty from the issuer's collateral, with the operator slashed for serving honestly. Pure griefing against an honest operator.The fix
The operator now vouches service through the issuing book's quorum (the same quorum that minted the lot — attested redemption is bound to
lotBook, so it only applies to batch-minted lots; firmsettleFillslots areNO_BOOK).settle_redemption_attested,finalize_attested,lot_bookgetter, andsettle_batch_attested_with_lots(returns minted lot ids).redeem_attest_action):receiptDigestand postsettleRedemptionAttested.finalizeAttested.Verification
settlement-e2e/e2e_anvilnow proves attested redemption end-to-end on anvil WITH a time-warp: quorum vouches the receipt the holder never signed,evm_increaseTimepast the challenge window,finalizeAttestedsettles — liability freed, no default. (Contract path also forge-tested inRedemption.t.sol.)redeem_attest_actionunit test covers Attest / Wait (grace) / Wait (deadline-margin) / Wait (nothing served) / Finalize / Wait (window open) / Drop.Notes
challengeAttested— to void a false claim, backed by the operator's slashable bond).main(merged with the newSURPLUS_ATTESTER_ONLYvenue field).