Skip to content

Commit add89a0

Browse files
committed
Address comments
1 parent bdc1624 commit add89a0

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
- Updated the error message returned when calling a nonexistent method on a contract to better align with the format used by the network
2121
- Oracle support in `snforge` is now stable and no longer requires the `--experimental-oracles` CLI flag
22-
- The default tracked resource is now Sierra gas, so gas reporting results may differ compared to previous versions
22+
- The default tracked resource is now Sierra gas, so gas reporting results may differ compared to previous versions. For more information refer to the [documentation](https://foundry-rs.github.io/starknet-foundry/testing/gas-and-resource-estimation.html)
2323
- When using the `--detailed-resources` flag, the used Sierra gas key is now shown as `sierra gas` instead of `sierra_gas_consumption`
2424

2525
### Cast

docs/src/appendix/snforge/test.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ Enabling this flag will slow down the compilation process, but the built contrac
118118
## `--tracked-resource`
119119

120120
Set tracked resource for test execution. Impacts overall test gas cost. Valid values:
121-
- `cairo-steps` (default): track cairo steps, uses vm `ExecutionResources` (steps, builtins, memory holes) to describe resources consumed by the test.
122-
- `sierra-gas` (sierra 1.7.0+ is required): track sierra gas, uses cairo native `CallExecution` (sierra gas consumption) to describe computation resources consumed by the test.
123-
To learn more about fee calculation formula (and an impact of tracking sierra gas on it) please consult [starknet docs](https://docs.starknet.io/learn/protocol/fees#overall-fee)
121+
- `sierra-gas` (default): track sierra gas, uses cairo native `CallExecution` (sierra gas consumption) to describe computation resources consumed by the test.
122+
- `cairo-steps`: track cairo steps, uses vm `ExecutionResources` (steps, builtins, memory holes) to describe resources consumed by the test.
123+
To learn more about fee calculation formula (and the impact of tracking sierra gas on it) please consult [starknet docs](https://docs.starknet.io/learn/protocol/fees#overall-fee)
124124

125125
## `-P`, `--profile` `<PROFILE>`
126126
Specify the profile to use by name.

docs/src/testing/gas-and-resource-estimation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ When the test passes with no errors, estimated gas is displayed this way:
1414
[PASS] tests::simple_test (l1_gas: ~1, l1_data_gas: ~1, l2_gas: ~1)
1515
```
1616

17-
This gas calculation is based on the estimated VM resources (that you can [display additionally on demand](#usage)),
18-
deployed contracts, storage updates, events and l1 <> l2 messages.
17+
This gas calculation is based on the collected VM resources or Sierra gas (that you can [display additionally on demand](#usage)),
18+
storage updates, events and l1 <> l2 messages.
1919

2020
### Fuzzed Tests
2121

@@ -33,10 +33,10 @@ While using the fuzzing feature additional gas statistics will be displayed:
3333

3434
It is possible to enable more detailed breakdown of resources, on which the gas calculations are based on.
3535
Depending on `--tracked-resource`, vm resources or sierra gas will be displayed.
36-
To learn more about tracked resource flag, see [--tracked-resource](../appendix/snforge/test.md#--tracked-resource).
36+
To learn more about the tracked resource flag, see [--tracked-resource](../appendix/snforge/test.md#--tracked-resource).
3737

3838
### Usage
39-
In order to run tests with this feature, run the `test` command with the appropriate flag:
39+
In order to run tests with this feature, run the `test` command with the `--detailed-resources` flag:
4040

4141
```shell
4242
$ snforge test --detailed-resources --tracked-resource cairo-steps

docs/src/testing/running-tests.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ To track resources like `builtins` / `syscalls` that are used when running tests
138138
$ snforge test --detailed-resources
139139
```
140140

141-
> 📝 **Note**
142-
>
143-
> The default resource tracked by snforge is Sierra gas.
144-
> To view VM resources used during execution, run the command with `--tracked-resource cairo-steps`.
145-
> For more information about different resources refer to the [Starknet documentation](https://docs.starknet.io/learn/protocol/fees#vm-resources-vs-sierra-gas).
146-
>
147-
148141
<details>
149142
<summary>Output:</summary>
150143

0 commit comments

Comments
 (0)