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

stabilize congestion control and stateless validation #11701

Merged
merged 9 commits into from
Jul 2, 2024
Merged

Conversation

wacban
Copy link
Contributor

@wacban wacban commented Jul 2, 2024

Feature to stabilize

This PR stabilizes the Congestion Control and Stateless Validation protocol features. They are assigned separate protocol features and the protocol upgrades should be scheduled separately.

Context

Testing and QA

Those features are well covered in unit, integration and end to end tests and were extensively tested in forknet and statelessnet.

Checklist

  • Link to nightly nayduck run (./scripts/nayduck.py, docs): https://nayduck.nearone.org/
  • Update CHANGELOG.md to include this protocol feature in the Unreleased section.

@wacban
Copy link
Contributor Author

wacban commented Jul 2, 2024

@wacban wacban marked this pull request as ready for review July 2, 2024 10:55
@wacban wacban requested a review from a team as a code owner July 2, 2024 10:55
Comment on lines +767 to +769
// TODO - Since the stabilization of Stateless Validation which includes the
// SingleShardTracking this test doesn't make sense anymore. We should remove it.
if !ProtocolFeature::SingleShardTracking.enabled(PROTOCOL_VERSION) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jancionear You touched this last, can you confirm this is the right thing to do please?

Copy link
Contributor

Choose a reason for hiding this comment

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

I only know what the comment says:

// Note: For nightly, which includes SingleShardTracking, this check is disabled because
// we're so efficient with part forwarding now that we don't seem to be forwarding more
// than it is necessary.

I don't know if it should be removed, maybe just modified?

I disabled it for stateless validation based on the fact that it was disabled with SingleShardTracking

#[test]
#[ignore]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I commented on #8590 mentioning that I'm disabling this test. It can be fixed in due time.

@wacban wacban requested a review from jakmeier July 2, 2024 15:36
Copy link
Contributor

@jakmeier jakmeier left a comment

Choose a reason for hiding this comment

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

Looks good to me, only left one non-actionable comment.

// TODO(congestion_control): remove cfg on stabilization
#[cfg(feature = "nightly")]
let final_balance = final_balance.saturating_add(self.new_buffered_receipts_balance);
.saturating_add(self.other_burnt_amount)
Copy link
Contributor

Choose a reason for hiding this comment

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

Right, we need to remove the CFG here. But I just realized, did we run this on statlessnet without nightly? That would mean we didn't test the balance checker changes as much as I hoped we would :S

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, statelessnet only had the statelessnet_protocol feature enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we want to add this PR to statelessnet so it will get some coverage still

Copy link

codecov bot commented Jul 2, 2024

Codecov Report

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

Project coverage is 70.23%. Comparing base (9fffef4) to head (32d5988).
Report is 3 commits behind head on master.

Files Patch % Lines
core/primitives/src/errors.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11701      +/-   ##
==========================================
- Coverage   71.77%   70.23%   -1.55%     
==========================================
  Files         790      790              
  Lines      161879   161942      +63     
  Branches   161879   161942      +63     
==========================================
- Hits       116196   113734    -2462     
- Misses      40649    43244    +2595     
+ Partials     5034     4964      -70     
Flag Coverage Δ
backward-compatibility 0.23% <0.00%> (+<0.01%) ⬆️
db-migration 0.23% <0.00%> (+<0.01%) ⬆️
genesis-check 1.35% <0.00%> (+<0.01%) ⬆️
integration-tests 37.99% <33.33%> (+0.11%) ⬆️
linux 70.00% <33.33%> (+0.88%) ⬆️
linux-nightly 69.80% <33.33%> (-1.47%) ⬇️
macos 54.55% <33.33%> (+1.95%) ⬆️
pytests 1.58% <0.00%> (+<0.01%) ⬆️
sanity-checks 1.38% <0.00%> (+<0.01%) ⬆️
unittests 64.52% <33.33%> (-1.82%) ⬇️
upgradability 0.28% <0.00%> (+<0.01%) ⬆️

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.

@wacban wacban added this pull request to the merge queue Jul 2, 2024
Merged via the queue into master with commit ced534f Jul 2, 2024
26 of 30 checks passed
@wacban wacban deleted the waclaw-stabilize branch July 2, 2024 17:24
wacban added a commit that referenced this pull request Jul 3, 2024
# Feature to stabilize
This PR stabilizes the Congestion Control and Stateless Validation
protocol features. They are assigned separate protocol features and the
protocol upgrades should be scheduled separately.

# Context

* near/NEPs#539
* near/NEPs#509

# Testing and QA
Those features are well covered in unit, integration and end to end
tests and were extensively tested in forknet and statelessnet.

# Checklist
- [x] Link to nightly nayduck run (`./scripts/nayduck.py`,
[docs](https://github.com/near/nearcore/blob/master/nightly/README.md#scheduling-a-run)):
https://nayduck.nearone.org/
- [x] Update CHANGELOG.md to include this protocol feature in the
`Unreleased` section.
marcelo-gonzalez pushed a commit to marcelo-gonzalez/nearcore that referenced this pull request Jul 3, 2024
# Feature to stabilize
This PR stabilizes the Congestion Control and Stateless Validation
protocol features. They are assigned separate protocol features and the
protocol upgrades should be scheduled separately.

# Context

* near/NEPs#539
* near/NEPs#509

# Testing and QA
Those features are well covered in unit, integration and end to end
tests and were extensively tested in forknet and statelessnet.

# Checklist
- [x] Link to nightly nayduck run (`./scripts/nayduck.py`,
[docs](https://github.com/near/nearcore/blob/master/nightly/README.md#scheduling-a-run)):
https://nayduck.nearone.org/
- [x] Update CHANGELOG.md to include this protocol feature in the
`Unreleased` section.
github-merge-queue bot pushed a commit that referenced this pull request Jul 5, 2024
#11727)

This is a mitigation for the failure that is caused by the stabilization
PR #11701.

[Zulip
thread](https://near.zulipchat.com/#narrow/stream/308695-nearone.2Fprivate/topic/Cherrypicks.20to.20statelessnet.20branch/near/449016937)

Context: In statelessnet, the genesis version is above 68, so it assumes
that genesis has the congestion control is enabled and hitting an issue
that attempts to bootstrap congestion info (again) and hitting missing
state roots.

We attempted to move the version numbers for congestion control and
stateless validation back to 80 and 81 to mitigate the problem, [in this
PR](#11719) but it became
unnecessarily complex and risky.

Thus, in this PR, we simply bypass the problematic bootstrap for
statelessnet only. We moved the check for the chain id after the genesis
protocol version check so we will not run it for testnet and mainnet.
tayfunelmas added a commit that referenced this pull request Jul 5, 2024
#11727)

This is a mitigation for the failure that is caused by the stabilization
PR #11701.

[Zulip
thread](https://near.zulipchat.com/#narrow/stream/308695-nearone.2Fprivate/topic/Cherrypicks.20to.20statelessnet.20branch/near/449016937)

Context: In statelessnet, the genesis version is above 68, so it assumes
that genesis has the congestion control is enabled and hitting an issue
that attempts to bootstrap congestion info (again) and hitting missing
state roots.

We attempted to move the version numbers for congestion control and
stateless validation back to 80 and 81 to mitigate the problem, [in this
PR](#11719) but it became
unnecessarily complex and risky.

Thus, in this PR, we simply bypass the problematic bootstrap for
statelessnet only. We moved the check for the chain id after the genesis
protocol version check so we will not run it for testnet and mainnet.
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.

5 participants