mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Added db.BlocksBySlot and db.BlockRootsBySlot (#8184)
* Added blockBySlot and blockRootBySlot * Changed to BlocksBySlot and BlockRootsBySlot * Updated to use BlocksBySlot and BlockRootsBySlot * Added missing passthrough to karfa exporter * Return hasBlocks/hasBlockRoots in the new getters * Fixed CI lint * Replace call to bytes.Compare with bytes.Equal * Reordered the returns of the new getters Co-authored-by: Nishant Das <nishdas93@gmail.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
@@ -69,8 +69,7 @@ func main() {
|
||||
// If the state is not available, roll back
|
||||
for state == nil {
|
||||
slot--
|
||||
filter := filters.NewFilter().SetStartSlot(slot).SetEndSlot(slot)
|
||||
rts, err := db.BlockRoots(context.Background(), filter)
|
||||
_, rts, err := db.BlockRootsBySlot(context.Background(), slot)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ go_library(
|
||||
deps = [
|
||||
"//beacon-chain/core/state/interop:go_default_library",
|
||||
"//beacon-chain/db:go_default_library",
|
||||
"//beacon-chain/db/filters:go_default_library",
|
||||
"//shared/featureconfig:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/state/interop"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/db"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/db/filters"
|
||||
"github.com/prysmaticlabs/prysm/shared/featureconfig"
|
||||
)
|
||||
|
||||
@@ -29,7 +28,7 @@ func main() {
|
||||
}
|
||||
ctx := context.Background()
|
||||
slot := uint64(*state)
|
||||
roots, err := d.BlockRoots(ctx, filters.NewFilter().SetStartSlot(slot).SetEndSlot(slot))
|
||||
_, roots, err := d.BlockRootsBySlot(ctx, slot)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user