diff --git a/db/db.go b/db/db.go index 0a70b14ea8..98bfc9298c 100644 --- a/db/db.go +++ b/db/db.go @@ -2296,7 +2296,7 @@ func GetWithdrawalsCountForQuery(query string) (uint64, error) { FROM blocks_withdrawals w INNER JOIN blocks b ON w.block_root = b.blockroot AND b.status = '1' %s - ORDER BY b.block_slot DESC + ORDER BY w.block_slot DESC LIMIT %d ) a` @@ -2955,9 +2955,11 @@ func GetBLSChangesCountForQuery(query string) (uint64, error) { blsQuery := ` SELECT COUNT(*) FROM ( + SELECT b.slot FROM blocks_bls_change bls INNER JOIN blocks b ON bls.block_root = b.blockroot AND b.status = '1' %s + ORDER BY b.slot DESC LIMIT %d ) a `