Skip to content

Commit cda715b

Browse files
committed
re-enable SN epoch integration test
- fix a bug introduced in #3947, which resulted in some QCs being un-queriable
1 parent fc5b515 commit cda715b

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

integration/tests/epochs/epoch_join_and_leave_sn_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/stretchr/testify/suite"
77

88
"github.com/onflow/flow-go/model/flow"
9-
"github.com/onflow/flow-go/utils/unittest"
109
)
1110

1211
func TestEpochJoinAndLeaveSN(t *testing.T) {
@@ -20,6 +19,6 @@ type EpochJoinAndLeaveSNSuite struct {
2019
// TestEpochJoinAndLeaveSN should update consensus nodes and assert healthy network conditions
2120
// after the epoch transition completes. See health check function for details.
2221
func (s *EpochJoinAndLeaveSNSuite) TestEpochJoinAndLeaveSN() {
23-
unittest.SkipUnless(s.T(), unittest.TEST_FLAKY, "fails on CI regularly")
22+
//unittest.SkipUnless(s.T(), unittest.TEST_FLAKY, "fails on CI regularly")
2423
s.runTestEpochJoinAndLeave(flow.RoleConsensus, s.assertNetworkHealthyAfterSNChange)
2524
}

integration/tests/epochs/suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ func (s *Suite) runTestEpochJoinAndLeave(role flow.Role, checkNetworkHealth node
672672
s.TimedLogf("retrieved header after entering EpochSetup phase: root_height=%d, root_view=%d, segment_heights=[%d-%d], segment_views=[%d-%d]",
673673
header.Height, header.View,
674674
segment.Sealed().Header.Height, segment.Highest().Header.Height,
675-
segment.Sealed().Header.View, segment.Highest().Header.Height)
675+
segment.Sealed().Header.View, segment.Highest().Header.View)
676676

677677
testContainer.WriteRootSnapshot(rootSnapshot)
678678
testContainer.Container.Start(s.ctx)

state/protocol/badger/state.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,15 @@ func (state *State) bootstrapSealingSegment(segment *flow.SealingSegment, head *
194194
height := block.Header.Height
195195
err := state.blocks.StoreTx(block)(tx)
196196
if err != nil {
197-
return fmt.Errorf("could not insert root block: %w", err)
197+
return fmt.Errorf("could not insert SealingSegment extra block: %w", err)
198198
}
199199
err = transaction.WithTx(operation.IndexBlockHeight(height, blockID))(tx)
200200
if err != nil {
201-
return fmt.Errorf("could not index root block segment (id=%x): %w", blockID, err)
201+
return fmt.Errorf("could not index SealingSegment extra block (id=%x): %w", blockID, err)
202+
}
203+
err = state.qcs.StoreTx(block.Header.QuorumCertificate())(tx)
204+
if err != nil {
205+
return fmt.Errorf("could not store qc for SealingSegment extra block (id=%x): %w", blockID, err)
202206
}
203207
}
204208

@@ -208,11 +212,15 @@ func (state *State) bootstrapSealingSegment(segment *flow.SealingSegment, head *
208212

209213
err := state.blocks.StoreTx(block)(tx)
210214
if err != nil {
211-
return fmt.Errorf("could not insert root block: %w", err)
215+
return fmt.Errorf("could not insert SealingSegment block: %w", err)
212216
}
213217
err = transaction.WithTx(operation.IndexBlockHeight(height, blockID))(tx)
214218
if err != nil {
215-
return fmt.Errorf("could not index root block segment (id=%x): %w", blockID, err)
219+
return fmt.Errorf("could not index SealingSegment block (id=%x): %w", blockID, err)
220+
}
221+
err = state.qcs.StoreTx(block.Header.QuorumCertificate())(tx)
222+
if err != nil {
223+
return fmt.Errorf("could not store qc for SealingSegment block (id=%x): %w", blockID, err)
216224
}
217225

218226
// index the latest seal as of this block

0 commit comments

Comments
 (0)