Skip to content

Commit

Permalink
more prints
Browse files Browse the repository at this point in the history
  • Loading branch information
calbera committed Aug 14, 2024
1 parent ed54fa2 commit f537a1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mod/consensus-types/pkg/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
package types

import (
"fmt"

"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
"github.com/berachain/beacon-kit/mod/primitives/pkg/version"
"github.com/davecgh/go-spew/spew"
fastssz "github.com/ferranbt/fastssz"
"github.com/karalabe/ssz"
)
Expand Down Expand Up @@ -112,9 +113,6 @@ func (b *BeaconBlock) SizeSSZ(fixed bool) uint32 {

// DefineSSZ defines the SSZ encoding for the BeaconBlock object.
func (b *BeaconBlock) DefineSSZ(codec *ssz.Codec) {
spew.Dump(b)
spew.Dump(codec)

// Define the static data (fields and dynamic offsets)
ssz.DefineUint64(codec, &b.Slot)
ssz.DefineUint64(codec, &b.ProposerIndex)
Expand All @@ -134,6 +132,7 @@ func (b *BeaconBlock) MarshalSSZ() ([]byte, error) {

// UnmarshalSSZ unmarshals the BeaconBlock object from SSZ format.
func (b *BeaconBlock) UnmarshalSSZ(buf []byte) error {
fmt.Println("buf", buf)
return ssz.DecodeFromBytes(buf, b)
}

Expand Down
8 changes: 8 additions & 0 deletions mod/storage/pkg/block/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package block

import (
"context"
"fmt"
"sync"

sdkcollections "cosmossdk.io/collections"
Expand Down Expand Up @@ -103,6 +104,13 @@ func (kv *KVStore[BeaconBlockT]) Prune(start, end uint64) error {
kv.blockCodec.SetActiveForkVersion(
kv.cs.ActiveForkVersionForSlot(kv.nextToPrune),
)

blk, err := kv.blocks.Get(ctx, kv.nextToPrune)
if err != nil {
panic(err)
}
fmt.Println("blk", blk)

if err := kv.blocks.Remove(ctx, kv.nextToPrune); err != nil {
// This can error for 2 reasons:
// 1. The slot was not found -- either the slot was missed or we
Expand Down

0 comments on commit f537a1a

Please sign in to comment.