---
# System prepended metadata

title: Proposer pubkey mismatch
tags: [relay-monitoring]

---

# Problem
In case when several relays contain different key material data in the response of the endpoint `/relay/v1/data/bidtraces/proposer_payload_delivered`, it may lead to store incorrect data in relay-monitoring and wrong calculation.

For instance:
- https://bloxroute.max-profit.blxrbdn.com/relay/v1/data/bidtraces/proposer_payload_delivered?slot=8646861 - contains wrong proposer pubkey (seems that the wrong data has been removed already)
- https://relay.ultrasound.money/relay/v1/data/bidtraces/proposer_payload_delivered?slot=8646861 - contains correct proposer pubkey according to https://beaconcha.in/slot/8646861

![image](https://hackmd.io/_uploads/Bkcjbu9ZC.png)

The relay bloxroute responded incorrect data for those slots. 


# Solution
Relay-monitoring assumes that each relay contains correct data. Thus, there is no necessary to store all responses from relays. However, as we can see this is not true and sometimes relays respond with bad data. Beside that, relay-monitoring does not contain validation tools to check relay's responses.

It will require storing all responses from relays for each slot, and then validate them on the mev-monitoring side.

## New alert

Introduce a new alert `Relay X contains incorrect submitted value info`. In case when mev-monitoring receives more than one submitted value, throw the alert about that via Prometheus.

## Necessary storage volume
It will require additional storage in case when several relays considering the proposal from their side.

For example, the slot https://beaconcha.in/slot/8646861:
- https://boost-relay.flashbots.net/relay/v1/data/bidtraces/proposer_payload_delivered?slot=8646861
- https://bloxroute.max-profit.blxrbdn.com/relay/v1/data/bidtraces/proposer_payload_delivered?slot=8646861
- https://relay.ultrasound.money/relay/v1/data/bidtraces/proposer_payload_delivered?slot=8646861

The submitted payload can be received from Ultrasound's relay.


## Changes at the code level
- Change primary key in `submitted_payload_storage` table. The primary key will contain the following columns:
  - slot
  - block_hash
  - relay_pubkey

## Fix for warnings
Currently, there are several cases with such problem:
- https://etherscan.io/block/19442091
- https://etherscan.io/block/19441809
- https://etherscan.io/block/19446984

To fix these slots we should update data manually in the `submitted_payload_storage` table.

Fix for slot [8646861](https://relay.ultrasound.money/relay/v1/data/bidtraces/proposer_payload_delivered?slot=8646861):
```sql!
UPDATE submitted_payload_storage
  SET parent_hash = '0x3f57feccc68678a347017063df8a65c63d5adc6e1f9b697410ff360a6600ef9e',
      block_hash = '0x5ab854a2746a880b66e2112979abb35e0cd805a071b6137d54ca31408383505d'
      pub_key = '0xa1559ace749633b997cb3fdacffb890aeebdb0f5a3b6aaa7eeeaf1a38af0a8fe88b9e4b1f61f236d2e64d95733327a62',
      builder_pub_key = '0x8509ecb595da0eda2c6fced4e287f0510a2c2dba5f80ee930503ef86e268d808a6df25e397177da06cd479771ce66840',
      proposer_pub_key = '0xaa2d0290654a7a1a2ec05eaaae7d2474a77bce9b0decb178be9f45f2b2f44e9a164881c7b03d200e3a57cd01aa7a229b',
      proposer_fee_recipient = '0x388c818ca8b9251b393131c08a736a67ccb19297',
      value = '94857587478751915',
      gas_limit = '30000000',
      gas_used = '29998600'
WHERE slot = 8646861
```

Fix for slot [8641615](https://relay.ultrasound.money/relay/v1/data/bidtraces/proposer_payload_delivered?slot=8641615):
```sql!
UPDATE submitted_payload_storage
  SET parent_hash = '0xc2efb25e85e0ec7f674eb0bee022e759c42ce3c8b7999399471e5ecc4283d672',
      block_hash = '0x0c13dd684761c865e99092b7104f9cb44127ee0168e1baa6c3aff5b291a798f9',
      pub_key = '0xa1559ace749633b997cb3fdacffb890aeebdb0f5a3b6aaa7eeeaf1a38af0a8fe88b9e4b1f61f236d2e64d95733327a62',
      builder_pub_key = '0x8509ecb595da0eda2c6fced4e287f0510a2c2dba5f80ee930503ef86e268d808a6df25e397177da06cd479771ce66840',
      proposer_pub_key = '0x82d2ff738de3bc136e442bd231469262974d621e628ee1bdf6b1a2aea76045d5c32d41446160be1ad1e42a6a29c79e87',
      proposer_fee_recipient = '0x388c818ca8b9251b393131c08a736a67ccb19297',
      value = '54831132922577410',
      gas_limit = '30000000',
      gas_used = '17121743'
WHERE slot = 8641615
```

Fix for slot [8641900](https://relay.ultrasound.money/relay/v1/data/bidtraces/proposer_payload_delivered?slot=8641900):
```sql!
UPDATE submitted_payload_storage
  SET parent_hash = '0x4d3f76c7ff028ffc8c447f771919dbf1518aea38ffd2dd227515925121ad3ac3',
      block_hash = '0x60408c646f328eae560f5698a6e75eb0ffc3c861b613a5abd477d742c73b8dfa',
      pub_key = '0xa1559ace749633b997cb3fdacffb890aeebdb0f5a3b6aaa7eeeaf1a38af0a8fe88b9e4b1f61f236d2e64d95733327a62',
      builder_pub_key = '0xb47963246adef02cd3e61cbb648c04fd99b05e28a616aef3aa7fb688c17b10d1ce9662b61a600efbdd110e93d62d5144',
      proposer_pub_key = '0x82266b480627c2e57eccdda9096defd4581d894b543e7edadd5296df7ed66e78a400aa3838e209a17ddb4ccfb35ef85e',
      proposer_fee_recipient = '0x388c818ca8b9251b393131c08a736a67ccb19297',
      value = '94857587478751915',
      gas_limit = '30000000',
      gas_used = '29998600'
WHERE slot = 8641900
```
