Skip to content

Bug in MEV blocker monitoring #120

@fhenneke

Description

@fhenneke

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions