-
Notifications
You must be signed in to change notification settings - Fork 1
Description
We have noticed that MEV blocker rebates do not cause any alerts at the moment. This is probably due to a bug in how rebates of the different drivers are handled.
The code in question is
ebbo/src/monitoring_tests/mev_blocker_kickbacks_test.py
Lines 35 to 45 in ee97d79
| eth_kickbacks = None | |
| for address in MEV_BLOCKER_KICKBACKS_ADDRESSES: | |
| kickback = self.web3_api.get_eth_transfers_by_block_range( | |
| block_number, block_number, address | |
| ) | |
| if kickback is not None: | |
| eth_kickbacks = kickback | |
| break | |
| if eth_kickbacks is None: | |
| return False |
This is wrong since if fetching transfers to the first address does not fail (i.e. kickback is not None), that value is chosen as rebate. Instead, it should should collect all transfers to rebate addresses, and return the one non-zero entry. If one of the transfer fetchings fails. If more than one entry is non-zero, there were probably more than one settlement in the block. (Adding rebates should be fine to avoid more complicated logic for mapping settlements to rebates.)
One proposal would be
eth_kickbacks = 0.0
for address in MEV_BLOCKER_KICKBACKS_ADDRESSES:
kickback = self.web3_api.get_eth_transfers_by_block_range(
block_number, block_number, address
)
if kickback is None:
return False
eth_kickbacks += kickback