fix: wait for confirmed gasless transactions#141
Merged
Conversation
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.
Summary
STATE_CONFIRMEDbefore resolving transaction handlesWhy
The relayer can mine a Deposit Wallet transaction before the wallet registry is ready. Returning from
wait()atSTATE_MINEDlets follow-up Deposit Wallet calls race the registry and fail withwallet 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.pyuv run ruff check .uv run ruff format --check .uv run pyrightuv 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_terminalnow treat onlySTATE_CONFIRMEDas success, notSTATE_MINED, so callers keep polling through the mined step until the deposit wallet registry is ready._TERMINAL_SUCCESSinpoll.pydropsMINED; async/sync handles and flows that depend on terminal polling (approvals, setup, place-order recovery) inherit the stricter gate. Unit tests mockSTATE_CONFIRMEDoutcomes and add coverage that a first poll returningSTATE_MINEDrequires 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.