Skip to content

fix: wait for confirmed gasless transactions#141

Merged
cesarenaldi merged 1 commit into
mainfrom
fix/cha-283-wait-for-confirmed-gasless
Jul 6, 2026
Merged

fix: wait for confirmed gasless transactions#141
cesarenaldi merged 1 commit into
mainfrom
fix/cha-283-wait-for-confirmed-gasless

Conversation

@cesarenaldi

@cesarenaldi cesarenaldi commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • wait for gasless relayer transactions to reach STATE_CONFIRMED before resolving transaction handles
  • update async and sync relayer workflow tests to model confirmed transaction outcomes
  • cover the mined-to-confirmed polling transition directly

Why

The relayer can mine a Deposit Wallet transaction before the wallet registry is ready. Returning from wait() at STATE_MINED lets follow-up Deposit Wallet calls race the registry and fail with wallet is not registered.

Verification

  • uv run pytest tests/unit/test_relayer_submit_poll.py tests/unit/test_relayer_approve_erc20.py tests/unit/test_sync_relayer_workflows.py tests/unit/test_relayer_setup_trading_approvals.py tests/unit/test_place_order_recovery.py
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run pyright
  • uv run pytest -m "not integration"

Note

Medium Risk
Changes when gasless transaction handles resolve, which affects deposit-wallet relayer workflows; behavior is narrower (longer waits) but reduces race failures on follow-up calls.

Overview
Gasless relayer wait() / poll_until_terminal now treat only STATE_CONFIRMED as success, not STATE_MINED, so callers keep polling through the mined step until the deposit wallet registry is ready.

_TERMINAL_SUCCESS in poll.py drops MINED; async/sync handles and flows that depend on terminal polling (approvals, setup, place-order recovery) inherit the stricter gate. Unit tests mock STATE_CONFIRMED outcomes and add coverage that a first poll returning STATE_MINED requires a second poll before returning an outcome.

Reviewed by Cursor Bugbot for commit 2fab25f. Bugbot is set up for automated code reviews on this repo. Configure here.

@cesarenaldi cesarenaldi merged commit 8d02ec1 into main Jul 6, 2026
7 checks passed
@cesarenaldi cesarenaldi deleted the fix/cha-283-wait-for-confirmed-gasless branch July 6, 2026 16:00
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.

1 participant