From cd78b65cdaa9e00866962e38685c4f93ac9e8444 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 5 Mar 2025 11:04:24 +0100 Subject: [PATCH] core: match on deposit contract log topic (#31317) This resolves a situation on the Sepolia testnet, which has a different deposit contract. The contract on that network emits two kinds of logs, instead of only deposit events like the deposit contract on mainnet. So we need to skip events with mismatched topics. --- core/state_processor.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/state_processor.go b/core/state_processor.go index 4e365c6550..9241d091ad 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -305,12 +305,14 @@ func processRequestsSystemCall(requests *[][]byte, evm *vm.EVM, requestType byte *requests = append(*requests, requestsData) } +var depositTopic = common.HexToHash("0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5") + // ParseDepositLogs extracts the EIP-6110 deposit values from logs emitted by // BeaconDepositContract. func ParseDepositLogs(requests *[][]byte, logs []*types.Log, config *params.ChainConfig) error { deposits := make([]byte, 1) // note: first byte is 0x00 (== deposit request type) for _, log := range logs { - if log.Address == config.DepositContractAddress { + if log.Address == config.DepositContractAddress && len(log.Topics) > 0 && log.Topics[0] == depositTopic { request, err := types.DepositLogToRequest(log.Data) if err != nil { return fmt.Errorf("unable to parse deposit data: %v", err)