flashbots / flashbots/web3-flashbots

Flashbot error handling issue

Open
#102 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
428
Forks
213
PR merge metrics
No merged PRs in 30d

Description

# Flashbot error handling issue

## TLDR
There are two issues in the example/simple.py code:

1. The network check before simulation is incorrect.
2. Error handling is missing when canceling bundles.

## Problem:
1. 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.
https://github.com/flashbots/web3-flashbots/blob/d69f57b0f574998c232a6d74e55338fbbd344f64/examples/simple.py#L173

Image

2. 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.

Image

## Solution:
1. Update the network check to use network == Network.Mainnet.
2. Add appropriate error handling for the bundle cancellation process.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.