Skip to content

Expose metering information in transaction simulation #4705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
janewang opened this issue Apr 28, 2025 · 0 comments
Open

Expose metering information in transaction simulation #4705

janewang opened this issue Apr 28, 2025 · 0 comments

Comments

@janewang
Copy link

We want to improve metering during transaction simulation to capture resource usage more accurately. This will help us provide more detailed feedback for developers, insights in fee optimization, and ways to optimize.

Problem
Currently, we provide meeting at an aggregate level for transaction simulation. We are looking for more detailed information, specifically:

  • Contract call boundaries
  • Host function call boundaries

Contract Call Boundaries
Metering at the boundaries of contract calls (between contracts) is possible today and relatively straightforward to implement.

Host Function Call Boundaries
Metering at the boundaries of host function calls is technically possible but complex. We will evaluate if this is achievable. This is probably less impactful as well, as developers could not necessarily make adjusted to avoid calling certain host functions.

Proposal
Introduce a feature flag to simulate transaction to provide more detailed metering information at contract call boundaries

  • Provide detailed metering for resources
  • Instruction metering: some metrics like instructions we can send before and end of each function
  • Snapshot storage: before and after function call
Image
@janewang janewang added the bug label Apr 28, 2025
@dmkozh dmkozh added enhancement and removed bug labels Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants