-
Notifications
You must be signed in to change notification settings - Fork 12
Profile FVM Gas With Local Lotus #207
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
base: main
Are you sure you want to change the base?
Conversation
One gas variance I have seen is +1300 in the last |
Seen again, uploading receipts here
|
A less-common gasUsed variation is much larger and impacts all of the transactions after the first
|
tools/profile.sh
Outdated
|
||
../forge-script-gas-report/forge_script_gas_report ./broadcast/Profile.s.sol/$CHAIN_ID/createRail-latest.json | tee .gas-profile | ||
|
||
sleep 5 |
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.
sleeping works around filecoin-project/lotus#13247 by advancing to the next block.
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.
Another workaround might be vm.etch
.
This happens when the blockNumber unexpectedly changes between transactions (in this case after the first |
Looks like this happens deterministically now, so that's good. |
The itest approach looks fairly simple and will probably startup and run faster.
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #207 +/- ##
=======================================
Coverage ? 75.83%
=======================================
Files ? 5
Lines ? 538
Branches ? 107
=======================================
Hits ? 408
Misses ? 125
Partials ? 5
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
tools/profile.sh
Outdated
[[ "$(../forge-script-gas-report/forge_script_block_numbers ./broadcast/Profile.s.sol/$CHAIN_ID/createRail-latest.json | wc -l)" -eq 1 ]] || (echo possible nondeterminism detected && exit 1) | ||
../forge-script-gas-report/forge_script_gas_report ./broadcast/Profile.s.sol/$CHAIN_ID/createRail-latest.json | tee .gas-profile | ||
|
||
forge script -vvv -g 44000 --broadcast --chain-id $CHAIN_ID --sender $SENDER_ADDRESS --private-key $SENDER_KEY --rpc-url $API_URL/rpc/v1 --sig "settleRail(address,address,uint256)" tools/Profile.s.sol:Profile $SENDER_ADDRESS $RAIL_ADDRESS 1 |
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.
one problem with the -g 44000
approach is that the FVM penalizes you for overestimating gas. Really we should do our own eth_estimateGas
without simulating EVM.
Maybe we should not use forge script
. That would be too bad because it has a great framework; you can use solidity and it transforms the broadcasted calls into transactions.
A new constraint on |
The current approach is to use
forge script --broadcast
.Rationale
The profile script covers some of the basic Payment operations.
The scripts are run sequentially to ensure that time has passed.
Changes
.gas-report
with https://github.com/FilOzone/forge-script-gas-report