Repository navigation
fix(auction): release a sharded listing Hold when realm-core refuses it - #409
Merged
Merged
Conversation
A sharded listing first moves the item and deposit into a source-shard Hold, then asks realm-core to commit the Auction. When realm-core refused the commit, nothing gave the Hold back: every retry replayed the same Hold and refused again, and the seller lost the item and the deposit. The shard now has `gw_auction_release_listing_hold`. It mails the held item and deposit back to the seller and deletes the Hold. A Hold that already has a receipt is never released. The gateway calls it only on a module Refusal with no realm receipt visible; a timeout or transport failure keeps the Hold for the existing idempotent replay. No schema change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
A sharded listing runs in phases. The seller Home Shard first moves the item and deposit into a Hold. The Gateway then asks Realm-core to commit the Auction. When Realm-core refused that commit, the Hold had no recovery path. Every retry replayed the same Hold and refused again, so the seller lost access to both values.
The abort path now preserves the same cross-database ordering as the successful path.
realm_auction_refund_listingatomically writes the return Mail and a payload-matching operation receipt withauction_id == 0on Realm-core. After that reducer completes,gw_auction_release_listing_holddeletes the Home-Shard Hold. Replays produce one Mail. Active-receipt lookup, listing replay, fencing, confirmation, and settlement all reject the zero-id receipt as an Auction.The Gateway enters this path only after a Module Refusal proves that the Realm-core commit changed no state. A timeout, transport failure, or SDK failure keeps the Hold because the outcome is unknown. A failure after the refund commit also keeps the Hold, and the next attempt resumes from the same operation id.
No table or schema changed. The new Realm-core reducer binding matches the generated commit-listing binding shape, and a test pins that identity.
Review verification:
cargo test -p lyracore-module --lib --features=debug_reducers auction: 29 passed.cargo test -p lyracore-gateway auction: 32 unit tests and 7 schema-parity tests passed.Written by Claude Fable 5.1 through Claude Code. Review fixes by GPT-5.6 through the Codex harness in T3 Code.