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

Add script to check block composition #131

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

Conversation

FrancoGiachetta
Copy link
Contributor

This PR adds a script that checks how many swaps and transfer an average block has. This done through the collection of entrypoints executed during bechmarking a block-range. There are some patterns that pure transfers and swaps share with each other. This plus the fact that the transfer entrypoint seems to have the same hash across different contracts, may make us able to define what makes a transaction to be a transfer.

I also had to organize differently the data about the entrypoint executed that is written in a .json file at the end of benchmark, since before it was just the entrypoints with no separation by block or group of entrypoints.

To be able to run the script first you need to collect some data:

cargo run --release --features benchmark,structured_logging bench-block-range 1046996 1047004 mainnet 1 -o native-data-1046996-1047004-mainnet.json > native-logs-1046996-1047004-mainnet.jsonl

Then you run the script:

python scripts/block_composition.py native-logs-1046996-1047004-mainnet.jsonl

Copy link

❌ Code is not formatted! Please run cargo format and push the changes.

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.

1 participant