This commit is contained in:
Nishant Das 2024-01-22 22:26:14 +08:00 committed by GitHub
parent 233aaf2f9e
commit e610d2a5de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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")
}
@ -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")
}