From 93073a5d6489104c7c49b51a432da1e836377f31 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 24 Oct 2024 19:09:53 +0200 Subject: [PATCH] fix master after merge conflict by #147 --- indexer/beacon/writedb.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/indexer/beacon/writedb.go b/indexer/beacon/writedb.go index 07730482..9aa2d32f 100644 --- a/indexer/beacon/writedb.go +++ b/indexer/beacon/writedb.go @@ -4,6 +4,7 @@ import ( "fmt" "math" + "github.com/attestantio/go-eth2-client/spec/electra" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/ethpandaops/dora/clients/consensus" "github.com/ethpandaops/dora/db" @@ -233,7 +234,6 @@ func (dbw *dbWriter) buildDbBlock(block *Block, epochStats *EpochStats, override graffiti, _ := blockBody.Graffiti() attestations, _ := blockBody.Attestations() deposits, _ := blockBody.Deposits() - depositRequests, _ := getBlockExecutionDepositRequests(blockBody) voluntaryExits, _ := blockBody.VoluntaryExits() attesterSlashings, _ := blockBody.AttesterSlashings() proposerSlashings, _ := blockBody.ProposerSlashings() @@ -245,6 +245,13 @@ func (dbw *dbWriter) buildDbBlock(block *Block, epochStats *EpochStats, override executionTransactions, _ := blockBody.ExecutionTransactions() executionWithdrawals, _ := blockBody.Withdrawals() + var depositRequests []*electra.DepositRequest + + executionRequests, _ := blockBody.ExecutionRequests() + if executionRequests != nil { + depositRequests = executionRequests.Deposits + } + dbBlock := dbtypes.Slot{ Slot: uint64(block.header.Message.Slot), Proposer: uint64(block.header.Message.ProposerIndex), @@ -362,7 +369,6 @@ func (dbw *dbWriter) buildDbEpoch(epoch phase0.Epoch, blocks []*Block, epochStat attestations, _ := blockBody.Attestations() deposits, _ := blockBody.Deposits() - depositRequests, _ := getBlockExecutionDepositRequests(blockBody) voluntaryExits, _ := blockBody.VoluntaryExits() attesterSlashings, _ := blockBody.AttesterSlashings() proposerSlashings, _ := blockBody.ProposerSlashings() @@ -371,6 +377,13 @@ func (dbw *dbWriter) buildDbEpoch(epoch phase0.Epoch, blocks []*Block, epochStat executionTransactions, _ := blockBody.ExecutionTransactions() executionWithdrawals, _ := blockBody.Withdrawals() + var depositRequests []*electra.DepositRequest + + executionRequests, _ := blockBody.ExecutionRequests() + if executionRequests != nil { + depositRequests = executionRequests.Deposits + } + dbEpoch.AttestationCount += uint64(len(attestations)) dbEpoch.DepositCount += uint64(len(deposits) + len(depositRequests)) dbEpoch.ExitCount += uint64(len(voluntaryExits))