Skip to content

Conversation

@owen-eth
Copy link
Contributor

Describe your changes

Issue ticket number and link

Fixes # (issue)

Checklist before requesting a review

  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation

kant777 and others added 3 commits January 27, 2026 20:21
* feat: add inline simulation using debug_traceCall

- Add InlineSimulator using debug_traceCall with callTracer
- Support pending state simulation (required for preconf-rpc)
- Add enableReturnData for better revert capture
- Port all 15 swap signatures from rethsim
- Detect swaps via event topic signatures only
- Support multiple RPC endpoints with fallback on 5xx/429/network errors
- Add --use-inline-simulation feature flag (default: false)
- Include call path (to, type) in inner revert errors

* feat: use eth_simulateV1 as primary method with debug_traceCall fallback

- Use eth_simulateV1 as the primary simulation method for better performance
- Fall back to debug_traceCall when eth_simulateV1 is not supported by the RPC
- eth_simulateV1 is lighter and reduces load on RPC providers
- debug_traceCall is still used for edge cases or when eth_simulateV1 is unavailable
- Add SimulateV1CallResult, SimulateError, SimulateV1Block structs for eth_simulateV1 response
- Add isMethodNotSupported() to detect unsupported method errors
- Update tests to cover both eth_simulateV1 and fallback scenarios

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: wrap revert errors in NonRetryableError to prevent unnecessary endpoint fallback

Transaction reverts and invalid response errors were not wrapped in
NonRetryableError, causing the code to unnecessarily try all fallback
endpoints when a transaction reverts. This wasted resources and delayed
error responses.

Changes:
- Wrap revert errors in NonRetryableError in both eth_simulateV1 and debug_traceCall
- Wrap empty/invalid response errors in NonRetryableError
- Update shouldFallback to check for NonRetryableError first
- Add clarifying comments about fallback behavior

This ensures reverts fail fast instead of trying all endpoints.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: clean up comments for readability

- Remove redundant comments that just repeat what the code does
- Keep comments where they explain why, not what
- Make comments more concise and natural
- Simplify code structure in a few places

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.

5 participants