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.
sleeping works around filecoin-project/lotus#13247 by advancing to the next block.
There was a problem hiding this comment.
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.
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-reportwith https://github.com/FilOzone/forge-script-gas-report