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

Increase MAX_COMPRESSED_STATE_WITNESS_SIZE to 48 MiB #11683

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

jancionear
Copy link
Contributor

@jancionear jancionear commented Jun 27, 2024

The MAX_COMPRESSED_STATE_WITNESS_SIZE has been set to 32 MiB in #11511. Back then it was a reasonable choice, but since then we increased some of the runtime parameters, which increased the worst case witness size by ~17MiB. (#11582, #11629). I'd feel safer with a larger limit on the compressed witness size.

@jancionear jancionear requested a review from pugachAG June 27, 2024 22:20
@jancionear jancionear requested a review from a team as a code owner June 27, 2024 22:20
@jancionear jancionear added the A-stateless-validation Area: stateless validation label Jun 27, 2024
Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.75%. Comparing base (cf00e1b) to head (3181517).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11683      +/-   ##
==========================================
- Coverage   71.75%   71.75%   -0.01%     
==========================================
  Files         790      790              
  Lines      161830   161838       +8     
  Branches   161830   161838       +8     
==========================================
+ Hits       116114   116119       +5     
- Misses      40678    40681       +3     
  Partials     5038     5038              
Flag Coverage Δ
backward-compatibility 0.23% <ø> (-0.01%) ⬇️
db-migration 0.23% <ø> (-0.01%) ⬇️
genesis-check 1.35% <ø> (-0.01%) ⬇️
integration-tests 37.80% <ø> (+0.01%) ⬆️
linux 69.16% <ø> (+0.01%) ⬆️
linux-nightly 71.23% <ø> (-0.01%) ⬇️
macos 52.63% <ø> (+0.03%) ⬆️
pytests 1.58% <ø> (-0.01%) ⬇️
sanity-checks 1.38% <ø> (-0.01%) ⬇️
unittests 66.34% <ø> (-0.02%) ⬇️
upgradability 0.28% <ø> (-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.

Copy link
Contributor

@pugachAG pugachAG left a comment

Choose a reason for hiding this comment

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

LGTM, but I'd also increase MAX_UNCOMPRESSED_STATE_WITNESS_SIZE 2x to be 128mib, assuming compression is on avg decreases the size 2 times.
another nit: please update WITNESS_PARTS_CACHE_SIZE comment

@jancionear jancionear changed the title Increase MAX_COMPRESSED_STATE_WITNESS_SIZE to 64 MiB Increase MAX_COMPRESSED_STATE_WITNESS_SIZE to 48 MiB Jun 28, 2024
@jancionear
Copy link
Contributor Author

LGTM, but I'd also increase MAX_UNCOMPRESSED_STATE_WITNESS_SIZE 2x to be 128mib, assuming compression is on avg decreases the size 2 times. another nit: please update WITNESS_PARTS_CACHE_SIZE comment

You're right, they should be different. Let's set MAX_COMPRESSED_STATE_WITNESS_SIZE to 48 MiB and MAX_UNCOMPRESSED_STATE_WITNESS_SIZE to 64MiB. I don't expect uncompressed witnesses to be larger than 64 MiB.

Updated comment.

@jancionear jancionear added this pull request to the merge queue Jun 28, 2024
Merged via the queue into near:master with commit 80f08d7 Jun 28, 2024
30 checks passed
@jancionear jancionear deleted the bigger-limit branch June 28, 2024 15:08
jancionear added a commit that referenced this pull request Jun 28, 2024
The `MAX_COMPRESSED_STATE_WITNESS_SIZE` has been set to 32 MiB in
#11511. Back then it was a
reasonable choice, but since then we increased some of the runtime
parameters, which increased the worst case witness size by ~17MiB.
(#11582,
#11629). I'd feel safer with a
larger limit on the compressed witness size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stateless-validation Area: stateless validation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants