Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KVStore] Integration test for version upgrade #5477

Merged
merged 77 commits into from
Apr 29, 2024

Conversation

jordanschalm
Copy link
Member

@jordanschalm jordanschalm commented Feb 28, 2024

This PR adds an integration test for the protocol state version upgrade process.

  • Removes duplicate InvalidEpochTransitionAttempted field from KVStore

Remaining TODOs

  • When Snapshot contains protocol state ID:
  • When branch is updated to use Cadence 1.0
    • Rewrite transaction in C1.0 syntax (code)

Base automatically changed from jordan/5351-upgrade-service-event to feature/protocol-state-kvstore March 11, 2024 21:01
@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 44.38%. Comparing base (4d20066) to head (e89005f).
Report is 60 commits behind head on feature/protocol-state-kvstore.

Files Patch % Lines
utils/unittest/epoch_builder.go 0.00% 2 Missing ⚠️
utils/unittest/protocol_state.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                         @@
##           feature/protocol-state-kvstore    #5477       +/-   ##
===================================================================
- Coverage                           56.02%   44.38%   -11.64%     
===================================================================
  Files                                1025      114      -911     
  Lines                               98784    13515    -85269     
===================================================================
- Hits                                55339     5998    -49341     
+ Misses                              39303     7068    -32235     
+ Partials                             4142      449     -3693     
Flag Coverage Δ
unittests 44.38% <0.00%> (-11.64%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jordanschalm jordanschalm changed the title [DRAFT] [KVStore] Integration test [KVStore] Integration test for version upgrade Apr 18, 2024
@jordanschalm jordanschalm marked this pull request as ready for review April 18, 2024 15:03
@jordanschalm jordanschalm requested review from AlexHentschel and durkmurder and removed request for zhangchiqing April 18, 2024 15:03
Copy link
Member

@AlexHentschel AlexHentschel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very impressive test -- I liked how compact/highly-modular the testing code is for verifying 2 upgraders from initial to supported to unsupported version 👏

@@ -877,6 +877,7 @@ func (m *FollowerState) epochTransitionMetricsAndEventsOnBlockFinalized(block *f
// Suppose an EpochSetup service event is emitted during execution of block A. C seals A, therefore
// we apply the metrics/events when C is finalized. The first block of the EpochSetup
// phase is block C.
// TODO: this should read data from the KVStore/ProtocolStateEntry for the block rather than parsing service events
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets capture this in an issue. I am worried that if we forget that, there might be an unnecessary pager duty alert going out

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 It's captured in #5666.

Base automatically changed from jordan/5120-sealing-segment to feature/protocol-state-kvstore April 26, 2024 15:25
Copy link
Member

@durkmurder durkmurder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, I like how compact and awaiting style your test is.

cmd/bootstrap/cmd/finalize.go Outdated Show resolved Hide resolved
integration/tests/lib/block_state.go Outdated Show resolved Hide resolved
state/protocol/inmem/convert.go Outdated Show resolved Hide resolved
the `-local github.com/onflow/flow-go` flag treats some non-flow-go
repos differently than others, if they happen to have the prefix flow-go
(like flow-go-sdk).
@jordanschalm jordanschalm merged commit d1faa23 into feature/protocol-state-kvstore Apr 29, 2024
55 checks passed
@jordanschalm jordanschalm deleted the jordan/5326-integration branch April 29, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dynamic Protocol State | M2] KV store versioning integration test
4 participants