Skip to content

Commit

Permalink
fix it (#13496)
Browse files Browse the repository at this point in the history
  • Loading branch information
nisdas authored Jan 22, 2024
1 parent 233aaf2 commit e610d2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/verification/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func (bv *ROBlobVerifier) SidecarParentSlotLower() (err error) {
// -- i.e. get_checkpoint_block(store, block_header.parent_root, store.finalized_checkpoint.epoch) == store.finalized_checkpoint.root.
func (bv *ROBlobVerifier) SidecarDescendsFromFinalized() (err error) {
defer bv.recordResult(RequireSidecarDescendsFromFinalized, &err)
if !bv.fc.IsCanonical(bv.blob.ParentRoot()) {
if !bv.fc.HasNode(bv.blob.ParentRoot()) {
return ErrSidecarNotFinalizedDescendent
}
return nil
Expand Down
6 changes: 3 additions & 3 deletions beacon-chain/verification/blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func TestSidecarDescendsFromFinalized(t *testing.T) {
_, blobs := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 1, 1)
b := blobs[0]
t.Run("not canonical", func(t *testing.T) {
ini := Initializer{shared: &sharedResources{fc: &mockForkchoicer{IsCanonicalCB: func(r [32]byte) bool {
ini := Initializer{shared: &sharedResources{fc: &mockForkchoicer{HasNodeCB: func(r [32]byte) bool {
if b.ParentRoot() != r {
t.Error("forkchoice.Slot called with unexpected parent root")
}
Expand All @@ -369,8 +369,8 @@ func TestSidecarDescendsFromFinalized(t *testing.T) {
require.Equal(t, true, v.results.executed(RequireSidecarDescendsFromFinalized))
require.NotNil(t, v.results.result(RequireSidecarDescendsFromFinalized))
})
t.Run("not canonical", func(t *testing.T) {
ini := Initializer{shared: &sharedResources{fc: &mockForkchoicer{IsCanonicalCB: func(r [32]byte) bool {
t.Run("canonical", func(t *testing.T) {
ini := Initializer{shared: &sharedResources{fc: &mockForkchoicer{HasNodeCB: func(r [32]byte) bool {
if b.ParentRoot() != r {
t.Error("forkchoice.Slot called with unexpected parent root")
}
Expand Down

0 comments on commit e610d2a

Please sign in to comment.