-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Description
Flashbot error handling issue
TLDR
There are two issues in the example/simple.py code:
- The network check before simulation is incorrect.
- Error handling is missing when canceling bundles.
Problem:
- Before simulation, the code checks if network == "mainnet". However, when printed, the network value is Network.Mainnet. So it doesn't do simulation for the bundle. The check should be updated to network == Network.Mainnet.
web3-flashbots/examples/simple.py
Line 173 in d69f57b
if network == "mainnet":
- When sending a bundle and waiting for receipts, if the transaction is not included in the target block, it throws a TransactionNotFound error. In this exception block, the code attempts to cancel the bundle without proper error handling. If an error occurs while canceling an invalid bundle, it is not handled correctly.
Solution:
- Update the network check to use network == Network.Mainnet.
- Add appropriate error handling for the bundle cancellation process.
Metadata
Metadata
Assignees
Labels
No labels