-
Notifications
You must be signed in to change notification settings - Fork 667
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
fix: Save genesis bootstrap congestion info into DB and reuse it at node restarts #11724
fix: Save genesis bootstrap congestion info into DB and reuse it at node restarts #11724
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11724 +/- ##
==========================================
- Coverage 71.80% 71.80% -0.01%
==========================================
Files 792 792
Lines 162526 162544 +18
Branches 162526 162544 +18
==========================================
+ Hits 116698 116707 +9
- Misses 40787 40793 +6
- Partials 5041 5044 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Can you add some debug logs when reading and storing the infos in the db? The bootstrapping already has a comment so no need to add another one there.
I thought the test failed because of 1.4 -> 2.0 migration, but it was due to the [actual fix](#11724) missing in both of the binaries. See https://near.zulipchat.com/#narrow/stream/295302-general/topic/Database.20migration.20CI.20check.20is.20consistently.20failing/near/457086995
This addresses #11702.
The issue happens for forknet and local testing where the network starts from the genesis block and the genesis protocol version supports congestion control. In this case, every time the node restarts, it attempts to re-generate the genesis congestion info. However, this is done using the state roots at genesis; these state roots are garbage collected and causes the bootstrapping to fail.
We fix this by storing the genesis congestion info (CongestionInfo for each shard) in DB. If it exists, the node directly uses it instead of attempting to re-compute it from state roots.
We store the congestion info in BlockMisc column with key
GENESIS_CONGESTION_INFO
.This PR also adds a testloop test to check if the congestion info is saved (and not cleaned up by GC) and re-enables the previously disabled nayducks tests due to this problem.