Skip to content

Use arbitrary_len to avoid arbitrary VariableLists overconsuming input#81

Merged
macladson merged 1 commit intosigp:mainfrom
macladson:fix-arbitrary-impl
Mar 19, 2026
Merged

Use arbitrary_len to avoid arbitrary VariableLists overconsuming input#81
macladson merged 1 commit intosigp:mainfrom
macladson:fix-arbitrary-impl

Conversation

@macladson
Copy link
Copy Markdown
Member

The current arbitrary impl for VariableList often consumes large amounts of the available Unstructured buffer due to selecting a random usize then capping at the max size of the list. Certain types using VariableList can contain very large max sizes (such as MaxBytesPerTransaction) and so these lists tend to completely consume the available buffer immediately and then pad with zeroes.

We should change the implementation to use arbitrary_len which scales the size of the returned value with the size of the remaining Unstructured buffer. This ensures we end up with many smaller lists vs one giant list filled mostly with zeroes.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 50.00%. Comparing base (6b615bf) to head (737cb56).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/variable_list.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
+ Coverage   49.89%   50.00%   +0.10%     
==========================================
  Files          13       13              
  Lines         463      462       -1     
==========================================
  Hits          231      231              
+ Misses        232      231       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@macladson macladson merged commit fc690e9 into sigp:main Mar 19, 2026
8 of 9 checks passed
@macladson macladson deleted the fix-arbitrary-impl branch March 19, 2026 12:39
@macladson macladson mentioned this pull request Mar 31, 2026
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.

2 participants