Skip to content

fix: enable max quotes in the usdt qa fixture - #28

Merged
ovitrif merged 2 commits into
mainfrom
fix/usdt-max-android-rc4
Oct 12, 2026
Merged

ovitrif merged 2 commits into
mainfrom
fix/usdt-max-android-rc4

Conversation

@ovitrif

@ovitrif ovitrif commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Updates the existing USDT fixture to Core rc4 and its matching gateway policy, and adds an affordable MAX quote smoke check without submission. Mobile MAX quotes require the restricted balance estimation override and final authorization against the real balance.
  • The review stack's test environment runs this change; the test run that uses it is reported in a review here, and a draft no test run uses is closed.
  • Checked: Both images built; Rust fmt/build/clippy and fixture lint passed. Fixture checks passed (8 local, 9 combined with fix: prepare funded usdt recovery and fresh ios controls for qa #27); gateway policy checks passed (70). Live gateway: status=ok, balanceSlot=0x33. MAX: balance=20000000, amount=18318627, fee=1681373; one override, one final authorization, zero submissions and unchanged balances. Published Maven rc4 POM/AAR downloaded; four ELF ABIs and MAX/deadline APIs verified. Owned scratch containers/volumes removed. Clean merge with fix: prepare funded usdt recovery and fresh ios controls for qa #27; mobile/device proof belongs to the test run.

Out of Scope

  • Mobile acceptance, app companion builds and end-to-end deadline-expiry execution remain the test run's work.
  • Production gateway deployment and real network gas pricing.

@ovitrif ovitrif self-assigned this Oct 12, 2026
@ovitrif
ovitrif marked this pull request as ready for review October 12, 2026 19:12

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: 👍 Approve

Test run: synonymdev/bitkit-core#170 at 1ebbd77, on this change at 0395571: 1 passed.

The test run was for synonymdev/bitkit-core#170 at head 1ebbd77. Item 1 was the only item; it ran and passed.

The run used this change at commit 0395571, and the change was installed for the run.

Needed: yes. Item 1 could not be reviewed or run before because the fixture lacked MAX metadata and the Android companion package was unavailable; it passed on this change.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No findings. This PR moves the USDT fixture to Core 0.8.0-rc4, adds a quote-max wallet command and a max-smoke check, and counts override estimates, paymaster authorizations and submissions in the control status. Reviewed 0395571, full tier.

What I checked, and 5 candidates I ruled out

Read in full: the whole diff, plus usdt-fixture, usdt/config.cjs, usdt/bridge-smoke.cjs, the usdt/Dockerfile and the usdt-* services in docker-compose.yml. On Core at the pinned 1ebbd77 I also read UsdtWallet::quote_max_transfer and UsdtQuote (wallet.rs, types.rs) and the override branch in paymaster.rs.
Ran: npm run lint and npm test in usdt/ on Node 22, which passed (8 tests). I put the PR's usdt/wallet next to a Core checkout at the pinned sha and ran cargo metadata --locked, which passed: the 0.8.0-rc4 bump in Cargo.lock matches Core's Cargo.toml at that commit.
Not run: max-smoke against a live fork, because it needs a private Arbitrum archive RPC. I did not build the images either.
CI: none is configured for this branch.

Ruled out

  • quote-max call shape: Core's quote_max_transfer(recipient: String, destination: UsdtDestination) -> Result<UsdtQuote, _> matches the call in main.rs, and UsdtQuote derives Serialize, so json! compiles. amount and maximum_fee come out as JSON numbers, and the smoke's BigInt(...) and > 0 checks handle them.
  • Override counter counting the wrong calls: when the balance override is on, Core sends eth_estimateUserOperationGas with a third param (the state diff). Without it, Core sends two params. So params[2] !== undefined only counts the override estimate.
  • Submissions bypassing the counter: in docker-compose.yml the gateway's environment gives it LOCAL_PROVIDER_URL (:23452), the provider the counter wraps, and no other bundler URL; its other upstreams are the node, Orchestra and LayerZero. I could not confirm in the gateway source that it sends user ops nowhere else, but the smoke's unchanged-balance assertions would catch a submission that landed.
  • A rejected estimate still counting: the counter increments before the request goes to Alto. That doesn't hide a failure, because a rejected estimate makes quote-max throw and the smoke fails.
  • Fingerprint drift: usdt/max-smoke.cjs is a tracked file under usdt/, so the image tag changes with this PR and an older image cannot be reused.

Merge confidence: 4/5. The new path crosses the Core and gateway contract, and the only check that exercises it, max-smoke against a live fork, was not run here.

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving at 0395571 with 1 LOW open (inline); fix it here or in a follow-up, your choice. I read the diff and ran the fixture from this branch.

Run on macOS (Docker Desktop, arm64), default project and ports, upstream https://arbitrum-one.public.blastapi.io in the private env file:

Step Result
./usdt-fixture build images built (after giving git read access to the two pinned repos)
up, ps, /healthz four services healthy, {"status":"ok"}, chainId 42161, pins 1ebbd77 / ada7f6a
check lint clean, 8 tests pass
normal wallet quote on a funded probe wallet estimatesWithOverride stays 0, paymasterAuthorizations +1
max-smoke exit 0, amount=18319474, maximum_fee=1680526 (sum 20000000 = balance), submitted:false; counters: override +1, authorizations +1, submissions +0
provider-mode unavailable then max-smoke exit 1
smoke, bridge-smoke, max-smoke again all exit 0, passed:true

The normal-quote row matters for the counter in server.cjs:86: a two-parameter estimate coming through the gateway is not counted as an override, so the override assertion cannot pass by accident.

Read and clean: the Core pin equals v0.8.0-rc4; the one-line Cargo.lock bump matches it; max-smoke is wired in usdt-fixture, cli.cjs, the Dockerfile copy and the image fingerprint; an assertion failure sets a non-zero exit through compose run; no port, bind or secret changes.

Not in the diff, so noted here: docs/usdt-fixture.md lists smoke and bridge-smoke in its command block but not max-smoke, and the wallet usage string in usdt/wallet/src/main.rs omits quote-max. The README and the script help are right.

Comment thread usdt/max-smoke.cjs Outdated
@ovitrif

ovitrif commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 0d7508c, which answers the review at 0395571:

  • max-smoke: asserts exact call ranges and a quote of the full balance, and prints the call deltas (thread).

Not in the diff, so noted here: docs/usdt-fixture.md lists smoke and bridge-smoke in its command block but not max-smoke, and the wallet usage string in usdt/wallet/src/main.rs omits quote-max.

@jvsena42 Both added: max-smoke is in the docs' two command blocks, wallet quote-max ADDRESS is in the command table, and quote-max RECIPIENT is in the usage string.

Lint and the 8 fixture tests pass. max-smoke was not rerun against a live fork; its new bounds match your measured deltas (+1/+1/+0) and your balance sum.

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