foundry-rs / foundry-rs/foundry

feat: gas report/snapshots of entire transaction incl. gas cost of calldata

Open
#6,238 0 comments 1 reaction 0 assignees View on GitHub
A-gas-snapshots C-forge T-feature
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

### Component

Forge

### Describe the feature you would like

To test functions, they are called as a sub-call of a larger test transaction. This means that gas information does not include the gas costs of the calldata needed to actually call the function in question as the entrypoint of a transaction.

While on mainnet calldata is pretty cheap and so this isnt a huge issue, on L2s calldata is a huge proportion of the total gas of a function. It would be great if there was a way to get estimated gas costs for a function _including_ the calldata costs on various chains.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.