Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pectra: fix bad deposit contract deposit unmarshalling #14074

Merged
merged 1 commit into from
Mar 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion consensus/misc/eip6110.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ const (
BLSPubKeyLen = 48
WithdrawalCredentialsLen = 32 // withdrawalCredentials size
BLSSigLen = 96 // signature size

)

var depositTopic = libcommon.HexToHash("0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5")

var (
// DepositABI is an ABI instance of beacon chain deposit events.
DepositABI = abi.ABI{Events: map[string]abi.Event{"DepositEvent": depositEvent}}
Expand Down Expand Up @@ -77,7 +80,7 @@ func ParseDepositLogs(logs []*types.Log, depositContractAddress libcommon.Addres
}
reqData := make([]byte, 0, len(logs)*types.DepositRequestDataLen)
for _, l := range logs {
if l.Address == depositContractAddress {
if l.Address == depositContractAddress && len(l.Topics) > 0 && l.Topics[0] == depositTopic {
d, err := unpackDepositLog(l.Data)
if err != nil {
return nil, fmt.Errorf("unable to parse deposit data: %v", err)
Expand Down
Loading