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.
This commit is contained in:
Felix Lange 2025-03-05 11:04:24 +01:00 committed by GitHub
parent 658c607e13
commit cd78b65cda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -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)