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

implement full block hint #172

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

tcoratger
Copy link
Collaborator

@tcoratger tcoratger marked this pull request as draft November 29, 2024 15:09
ClementWalter
ClementWalter previously approved these changes Nov 29, 2024
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@a143261). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #172   +/-   ##
=======================================
  Coverage        ?   63.30%           
=======================================
  Files           ?       43           
  Lines           ?     7157           
  Branches        ?        0           
=======================================
  Hits            ?     4531           
  Misses          ?     2626           
  Partials        ?        0           

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

};

// Prepare a random byte array for testing
let raw_bytes = [0u8; 1500];
Copy link
Member

Choose a reason for hiding this comment

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

side question: where does the size (1500) come from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The arbitrary library uses a random data stream from raw_bytes. The structure of SealedBlock influences the minimum amount of data needed in raw_bytes. If the array is too small, arbitrary might run out of data to generate a valid object.

So the 1500 provides this size and allows to have a full block with enough data and multiple transactions. For example, it is very likely that if the data sample was not enough and that few or no transactions are generated and also often the last data in the block are default data because the unstructured data source is not big enough.

In my experience on reth, for a block, between 1000 and 1500 is good to do complete randomness. So I chose 1500 here.

tcoratger and others added 2 commits November 29, 2024 20:00
Co-authored-by: Clément Walter <[email protected]>
Co-authored-by: Clément Walter <[email protected]>
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