Skip to content

Commit

Permalink
Update gas initialization for predicate estimation (#474)
Browse files Browse the repository at this point in the history
Predicates previously used the tx.gasLimit for initialization but could
never be more than MAX_GAS_PER_PREDICATE so they should also be
initialized to that value if tx.gasLimit is greater than
MAX_GAS_PER_PREDICATE.
  • Loading branch information
Mitch Martin authored Apr 4, 2023
1 parent a1ff912 commit ee15834
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ For any input of type [`InputType.Coin`](../protocol/tx_format/index.md) or [`In
For each such input in the transaction, the VM is [initialized](#vm-initialization), then:

1. `$pc` and `$is` are set to the start of the input's `predicate` field.
1. `$ggas` and `$cgas` are set to `tx.gasLimit`.
1. `$ggas` and `$cgas` are set to the minimum of `tx.gasLimit` or `MAX_GAS_PER_PREDICATE`.

Predicate estimation will fail if gas is exhausted during execution.

Expand Down

0 comments on commit ee15834

Please # to comment.