Skip to content

Conversation

@faisal-chainlink
Copy link
Collaborator

@faisal-chainlink faisal-chainlink commented Dec 25, 2025

The PR includes the following:

  • Add a GasCoinManager abstraction to keep a cache of "reserved" coins (being used in other transacitons)
    • Current default expiry of reservation is 30 seconds
  • Bring over some of the code in this PR to include the LockedCoin error label and regex matching
  • Add broadcast error parsing

Additional description of the change

For a tx we build/send, you reserve its payment coins by calling TryReserveCoins(txID, []SuiObjectRef, expiry=nil) (or similar). That creates:

  • coinID -> true with TTL = 30s (default)
  • txID -> []SuiObjectRef with TTL = 30s

If we then detect the “locked coin / equivocation” issue and run the quarantine path, you call TryReserveCoins(..., &expiry) with 24h, which creates:

  • coinID -> true with TTL = 24h
  • txID -> []SuiObjectRef with TTL = 30s (still)

So after ~30s or failure/success:

  • the txID mapping expires
  • the coinID reservation remains for up to 24h

That’s why later ReleaseCoins(txID) often can’t undo the 24h quarantine: it loses the txID→coins index, but the coin lock key is still present.

@faisal-chainlink faisal-chainlink requested a review from a team as a code owner December 25, 2025 00:12
@github-actions
Copy link

👋 faisal-chainlink, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

Copy link
Contributor

@stackman27 stackman27 left a comment

Choose a reason for hiding this comment

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

LGTM

@stackman27 stackman27 merged commit b80fff7 into develop Jan 2, 2026
43 of 45 checks passed
@stackman27 stackman27 deleted the test/coin-equivocation branch January 2, 2026 00:05
faisal-chainlink added a commit that referenced this pull request Jan 5, 2026
…in the same relayer (#304)

* add a GasCoinManager abstraction

* add locked coin error parsing to reserve coins

* allow setting an expiry when reserving coins

* update GasCoinManager

* fix txm tests

* release coins on confirmer marking transaction as failed or succeeded

* error checking

* add separate txm error strategy for simple coin refreshing (used for locked coins)

* nit

---------

Co-authored-by: stackman27 <[email protected]>
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.

3 participants