https://github.com/cowprotocol/revert-finder
Tool to find the highest index of a block where a transaction would not revert.
https://github.com/cowprotocol/revert-finder
Last synced: about 1 year ago
JSON representation
Tool to find the highest index of a block where a transaction would not revert.
- Host: GitHub
- URL: https://github.com/cowprotocol/revert-finder
- Owner: cowprotocol
- Created: 2025-03-11T22:10:40.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-11T22:20:55.000Z (about 1 year ago)
- Last Synced: 2025-03-11T23:24:34.363Z (about 1 year ago)
- Language: Rust
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Description
Tool to debug what priority fee a transaction should have at least to make it onchain. It does that by finding the highest index in a block where the transaction does not revert. To ensure the transaction would have made it onchain a priority fee that beats the "rival" transaction, that caused the target transaction to revert, would have been necessary.
This tool relies on an RPC that supports the `debug_traceCallMany` method. For example this is supported by [reth](https://github.com/paradigmxyz/reth) or [geth](https://github.com/ethereum/go-ethereum).
Also this tool currently does not work for transactions that only work when applying access lists. This mean primarly CoW protocol settlement that pay out native ETH to smart contract addresses.
However, adding support for this only requires the access list to be passed via a CLI argument.
### Usage
```
sage: revert-finder --rpc --block --to --from --calldata
Options:
-r, --rpc RPC to simulate calls with. Needs to support `debug_traceCallMany` [env: RPC=]
-b, --block Block in which index for last successful simulation should be found [env: BLOCK=]
-t, --to Contract to which the transaction should be sent [env: TO=]
-f, --from Address that would have sent the transaction [env: FROM=]
-c, --calldata Calldata of the transaction (hex string with or without `0x` prefix) [env: CALLDATA=]
-h, --help Print help
-V, --version Print versio
```
This repo also includes a devcontainer that can be used with VSCode or code spaces.