@@ -12,6 +12,7 @@ import (
1212 "github.com/attestantio/go-eth2-client/spec/phase0"
1313 "github.com/dappnode/mev-sp-oracle/contract"
1414 "github.com/dappnode/mev-sp-oracle/utils"
15+ "github.com/ethereum/go-ethereum/common"
1516 "github.com/ethereum/go-ethereum/core/types"
1617 "github.com/pkg/errors"
1718 log "github.com/sirupsen/logrus"
@@ -279,6 +280,28 @@ func (b *FullBlock) SetEvents(events *Events) {
279280 }
280281
281282 b .Events = events
283+
284+ // Special case. Temporal fix. We artificially add the mev reward for this block.
285+ // See: https://github.com/dappnode/mev-sp-oracle/pull/230
286+ // See: https://beaconcha.in/slot/10400574
287+ if b .ChainId == MainnetChainId && b .GetSlotUint64 () == ExceptionSlotMainnet1 {
288+ log .Warn ("Special case: MEV reward hardcoded. See MevRewardInWei for more info" )
289+ b .Events .EtherReceived = append (b .Events .EtherReceived , & contract.ContractEtherReceived {
290+ Sender : common.Address {},
291+ DonationAmount : big .NewInt (177043568463114308 ),
292+ Raw : types.Log {
293+ Address : common.Address {},
294+ Topics : []common.Hash {},
295+ Data : []byte {},
296+ BlockNumber : 0 ,
297+ TxHash : common.Hash {},
298+ TxIndex : 0 ,
299+ BlockHash : common.Hash {},
300+ Index : 0 ,
301+ Removed : false ,
302+ },
303+ })
304+ }
282305}
283306
284307// Returns if there was an mev reward and its amount and fee recipient if any
@@ -556,13 +579,6 @@ func (b *FullBlock) GetDonations(poolAddress string) []*contract.ContractEtherRe
556579 filteredEvents = append (filteredEvents , etherRxEvent )
557580 }
558581
559- // Special case. To be fixed. See MevRewardInWei for more info.
560- // In this case the EtherReceived event was not triggered due to a self destruct
561- // So we hardcode it. Temporal fix.
562- if b .ChainId == MainnetChainId && b .GetSlotUint64 () == ExceptionSlotMainnet1 {
563- foundMev = true
564- }
565-
566582 // Sanity check
567583 if ! foundMev {
568584 log .Fatal ("An mev reward was expected but could not find it. " +
0 commit comments