fix(server): enforce published HistoryUpdate operation limits#4034
Merged
marcschier merged 2 commits intoJul 21, 2026
Merged
Conversation
marcschier
approved these changes
Jul 19, 2026
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4034 +/- ##
==========================================
- Coverage 73.85% 73.12% -0.74%
==========================================
Files 1345 1332 -13
Lines 179988 179102 -886
Branches 31668 31540 -128
==========================================
- Hits 132938 130973 -1965
- Misses 36299 37496 +1197
+ Partials 10751 10633 -118
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enforces the published
HistoryUpdateoperation limits in the server service entry point and adds regression coverage that verifies requests exceedingMaxNodesPerHistoryUpdateDataorMaxNodesPerHistoryUpdateEventsare rejected withBadTooManyOperations.Problem
The server already publishes
MaxNodesPerHistoryUpdateDataandMaxNodesPerHistoryUpdateEventsthroughServerCapabilities.OperationLimits, butStandardServer.HistoryUpdateAsync()did not actually enforce either limit. The method only called the genericValidateOperationLimits(historyUpdateDetails)overload without passing a concrete limit, which meant it only rejected empty requests withBadNothingToDoand never returnedBadTooManyOperationsfor oversizedHistoryUpdaterequests.The existing code already acknowledged this gap:
HistoryUpdateAsync()contained a TODO comment stating that the history-update operation limits still needed to be checked elsewhere. In practice, neitherStandardServer,MasterNodeManager, nor the downstream node-manager paths consumedMaxNodesPerHistoryUpdateDataorMaxNodesPerHistoryUpdateEvents, so the advertised limits were never enforced at runtime.Changes
HistoryUpdateoperation limits inStandardServer.HistoryUpdateAsync()after the existing non-empty request validation.HistoryUpdateDetailsinto data-oriented vs event-oriented requests and applyMaxNodesPerHistoryUpdateDataorMaxNodesPerHistoryUpdateEventsaccordingly.BadTooManyOperations.