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

clamping sync requests #1273

Merged
merged 3 commits into from
Sep 13, 2021
Merged

clamping sync requests #1273

merged 3 commits into from
Sep 13, 2021

Conversation

synzhu
Copy link
Contributor

@synzhu synzhu commented Sep 10, 2021

Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Thanks a bunch for getting to this fast!

I would love a code comment on each of the two checks making it explicit we enforce existing client-side limits, and that this therefore shouldn't have an effect on a well-behaving client.

Without that, another later reader, may not find it obvious those lines are meant to check for mischief.

engine/common/synchronization/request_handler.go Outdated Show resolved Hide resolved
engine/common/synchronization/request_handler.go Outdated Show resolved Hide resolved
@huitseeker
Copy link
Contributor

One more thing:
TestOnRangeRequest and TestOnBatchRequest look ripe for a test exercising the over-the-limit requests.

@synzhu
Copy link
Contributor Author

synzhu commented Sep 10, 2021

Addressed comments

Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Thanks a bunch!

},
)
err = ss.e.requestHandler.onRangeRequest(originID, req)
require.NoError(ss.T(), err, "valid range request should pass")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: do we want to call this "valid"?

},
)
err = ss.e.requestHandler.onBatchRequest(originID, req)
require.NoError(ss.T(), err, "should pass request with valid blocks")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: do we want to call this "valid"?

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2021

Codecov Report

Merging #1273 (c2d0f8c) into master (06aa464) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1273      +/-   ##
==========================================
+ Coverage   54.59%   54.61%   +0.01%     
==========================================
  Files         498      498              
  Lines       31533    31538       +5     
==========================================
+ Hits        17217    17223       +6     
  Misses      11968    11968              
+ Partials     2348     2347       -1     
Flag Coverage Δ
unittests 54.61% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
engine/common/synchronization/request_handler.go 66.47% <100.00%> (+2.83%) ⬆️
...ngine/common/synchronization/finalized_snapshot.go 68.75% <0.00%> (-4.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06aa464...c2d0f8c. Read the comment docs.

Copy link
Contributor

@vishalchangrani vishalchangrani left a comment

Choose a reason for hiding this comment

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

lgtm

@synzhu
Copy link
Contributor Author

synzhu commented Sep 13, 2021

bors merge

@bors
Copy link
Contributor

bors bot commented Sep 13, 2021

@bors bors bot merged commit 6d5f8bb into master Sep 13, 2021
@bors bors bot deleted the smnzhu/clamping branch September 13, 2021 17:06
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.

None yet

4 participants