flow-emulator
flow-emulator copied to clipboard
The displayed computationUsed is twice as much as the actual usage
Instructions
When I was evaluating the gas consumption of the transaction, I found that the computationUsed exceeded 9999 and the transaction was still successful, and further exploration revealed that it was twice as the actual use.
Problem
The displayed computationUsed is twice as much as the actual usage
Steps to Reproduce
- Run
flow emulator - send any transaction, record the computationUsed
- set --gas-limt = computationUsed/2 - 1, send transaction again will fail
- set --gas-limt = computationUsed/2, send transaction again will success
flow version is Version: v0.30.2
Thank you very much for the report.
I did notice something while I was reproducing this:
This transaction doesn't have this problem:
transaction() {
prepare(acct: AuthAccount) {
var i = 0
while i<1000{
i = i + 1
}
}
execute {}
}
while this one does:
transaction() {
prepare(acct: AuthAccount) {
AuthAccount(payer: acct)
var i = 0
while i<1000{
i = i + 1
}
}
execute {}
}
I though this sounded familiar https://github.com/onflow/flow-go/pull/1724.
This will be fixed with a new version of flow-go.
can be closed I guess