feat(spot-busts): add decoded reasonName/reasonArgs to SpotExecutionBust#43
feat(spot-busts): add decoded reasonName/reasonArgs to SpotExecutionBust#43danigr99727 wants to merge 3 commits into
Conversation
Today the FailedFillBytes revert data surfaces only as the raw `reason` hex; consumers (UIs, bots, support tooling) cannot tell what actually busted without keccak-matching the 4-byte selector themselves. Adds two optional sibling fields: - reasonName: human-readable Solidity custom-error name (e.g. "SignatureExpired", "NegativeAccountRealBalance"); null when the selector is not in the API's decoder map. - reasonArgs: ABI-decoded arguments keyed by Solidity parameter name; empty object when the error has no parameters; null when reasonName is null. Both are non-required so older indexed busts and unknown selectors keep working. The off-chain monorepo PR wiring the decoder is a follow-up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughSpecification documents and trading schema are updated: three API spec files version bumped from 2.2.0 to 2.2.1, and SpotExecutionBust schema enriched with decoded custom error fields ( ChangesAPI Specification v2.2.1 Release
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🤖 API Specs Version Check ✅ Version automatically bumped to
|
Summary
Adds two optional sibling fields to the V2
SpotExecutionBustschema so consumers can read a decoded Solidity custom-error name + arguments instead of having to keccak-match a 4-byte selector themselves.reasonName: string | null— decoded error name (e.g.SignatureExpired,NegativeAccountRealBalance)reasonArgs: { [k: string]: string } | null— ABI-decoded arguments keyed by Solidity parameter nameBoth are non-required and default to
nullfor unknown selectors and pre-existing rows, so this is a strictly additive schema change.Why
Today, a sample of the prod
spot_execution_buststable looks like:0x0819bdcdSignatureExpired()0xf2a27bcaNegativeAccountRealBalance(uint128,int256)Every consumer (frontends, market-maker bots, support) has to maintain a private selector→error map to do anything useful with this. Decoding once in the API removes that duplication.
Test plan
Follow-up
The off-chain monorepo PR will:
api-v2-sdkcommon-backendreasonName/reasonArgsin bothtransformSpotExecutionBust(REST) andconvertToSpotExecutionBust(WS)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores