Skip to content

Commit

Permalink
Merge pull request #147 from ethpandaops/pk910/fix-electra-deposit-count
Browse files Browse the repository at this point in the history
fix deposit counts in block & epoch indexes for post electra blocks
  • Loading branch information
pk910 authored Oct 23, 2024
2 parents a53497d + f839f10 commit d8da890
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions indexer/beacon/writedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ func (dbw *dbWriter) buildDbBlock(block *Block, epochStats *EpochStats, override
graffiti, _ := blockBody.Graffiti()
attestations, _ := blockBody.Attestations()
deposits, _ := blockBody.Deposits()
depositRequests, _ := getBlockExecutionDepositRequests(blockBody)

Check failure on line 236 in indexer/beacon/writedb.go

View workflow job for this annotation

GitHub Actions / Run code checks / Run code checks

undefined: getBlockExecutionDepositRequests
voluntaryExits, _ := blockBody.VoluntaryExits()
attesterSlashings, _ := blockBody.AttesterSlashings()
proposerSlashings, _ := blockBody.ProposerSlashings()
Expand All @@ -255,7 +256,7 @@ func (dbw *dbWriter) buildDbBlock(block *Block, epochStats *EpochStats, override
Graffiti: graffiti[:],
GraffitiText: utils.GraffitiToString(graffiti[:]),
AttestationCount: uint64(len(attestations)),
DepositCount: uint64(len(deposits)),
DepositCount: uint64(len(deposits) + len(depositRequests)),
ExitCount: uint64(len(voluntaryExits)),
AttesterSlashingCount: uint64(len(attesterSlashings)),
ProposerSlashingCount: uint64(len(proposerSlashings)),
Expand Down Expand Up @@ -361,6 +362,7 @@ func (dbw *dbWriter) buildDbEpoch(epoch phase0.Epoch, blocks []*Block, epochStat

attestations, _ := blockBody.Attestations()
deposits, _ := blockBody.Deposits()
depositRequests, _ := getBlockExecutionDepositRequests(blockBody)

Check failure on line 365 in indexer/beacon/writedb.go

View workflow job for this annotation

GitHub Actions / Run code checks / Run code checks

undefined: getBlockExecutionDepositRequests
voluntaryExits, _ := blockBody.VoluntaryExits()
attesterSlashings, _ := blockBody.AttesterSlashings()
proposerSlashings, _ := blockBody.ProposerSlashings()
Expand All @@ -370,7 +372,7 @@ func (dbw *dbWriter) buildDbEpoch(epoch phase0.Epoch, blocks []*Block, epochStat
executionWithdrawals, _ := blockBody.Withdrawals()

dbEpoch.AttestationCount += uint64(len(attestations))
dbEpoch.DepositCount += uint64(len(deposits))
dbEpoch.DepositCount += uint64(len(deposits) + len(depositRequests))
dbEpoch.ExitCount += uint64(len(voluntaryExits))
dbEpoch.AttesterSlashingCount += uint64(len(attesterSlashings))
dbEpoch.ProposerSlashingCount += uint64(len(proposerSlashings))
Expand Down

0 comments on commit d8da890

Please sign in to comment.