Skip to content

Commit

Permalink
Merge pull request #159 from ethpandaops/pk910/fix-master
Browse files Browse the repository at this point in the history
fix master after merge conflict by #147
  • Loading branch information
pk910 authored Oct 24, 2024
2 parents d8da890 + 93073a5 commit aac28ce
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions indexer/beacon/writedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand All @@ -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),
Expand Down Expand Up @@ -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()
Expand All @@ -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))
Expand Down

0 comments on commit aac28ce

Please sign in to comment.