-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Add benchmark in replay crate #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Danikim01 Also, add a description in the README.md showing how to run the bench-block-range command
thanks for letting me know that i had to change the readme! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The execution speed is way faster than it should be. You can try out the other commands to get a feel of how long it should take in a normal scenario (cargo run block mainnet 648461
). In my computer it takes at least 30 seconds per transaction.
You can print the result of the execution to see what is going on, this is what I got:
Running `target/debug/replay bench-block-range 648461 648461 mainnet 10`
Filling up Cache
Executing block: 648461
Executing tx: 0x4de9a3c4c5f43e2a4b7d68a1ed2217e6df698a5a701ae59e357bb950697757b
[replay/src/main.rs:182:21] res = Err(
TransactionPreValidationError(
InvalidNonce {
address: ContractAddress(
PatriciaKey(
StarkFelt(
"0x073335cc71c93fe46c04c14e09e7cde7ca7f6147bb36c72dee7968ec3abaf70d",
),
),
),
account_nonce: Nonce(
StarkFelt(
"0x0000000000000000000000000000000000000000000000000000000000003fcd",
),
),
incoming_tx_nonce: Nonce(
StarkFelt(
"0x0000000000000000000000000000000000000000000000000000000000003fcc",
),
),
},
),
)
It seem that the nonce is incorrect so the transaction is never executed. What block are you using when making RPC requests? Make sure you are using the previous block (if you are replaying block 100, you must use the state from block 99)
Also, there are some formatting problems in the code, please make sure to use cargo fmt (you can configure your editor to format on save)
superseded by #31 |
closes #12
This PR implements the benchmark feature of the execution time of the blocks in memory