Skip to content

fix: resolve #1019 - #2789

Open
SrvFernandes wants to merge 1 commit into
stellar:mainfrom
SrvFernandes:feat/onlydust-fix-1019-1790959206175
Open

SrvFernandes wants to merge 1 commit into
stellar:mainfrom
SrvFernandes:feat/onlydust-fix-1019-1790959206175

Conversation

@SrvFernandes

Copy link
Copy Markdown

Summary

This PR addresses issue #1019 by expanding the simulation output to include ALL cost metrics (not just CPU and memory) and ensuring budget information is returned even when simulation fails.

Changes Made:

  1. Expanded SimCost struct to include all Soroban cost metrics:

    • cpu_instructions (existing)
    • mem_bytes (renamed from mem for clarity)
    • read_bytes (new)
    • write_bytes (new)
    • historical_data_bytes (new)
    • footprint_bytes (new)
  2. Modified SimulateOutput to include an optional error field, allowing cost data to be returned alongside error information.

  3. Updated run() method in SimulateCmd to:

    • On success: return full cost metrics
    • On error: still attempt to return cost information if available from the error response
  4. Added extract_cost_from_simulation_error() helper function to parse cost data from error responses.

  5. Added Display implementations for SimCost and SimulateOutput to provide clear formatted output of all metrics.

Benefits:

  • Users can now see ALL fee types and limits in both success and failure cases
  • When a transaction fails, the returned budget information helps identify which specific limit was exceeded
  • Makes debugging and optimization significantly easier

Closes #1019
/attempt
/claim #1019

Bounty Reward Wallet: 0x96eE7904BdCd8a82c71B4FFc3362C96b1Aae03e0 (Base / EVM)

Fixes #1019

OnlyDust Contribution
Reward Wallet: 0x96eE7904BdCd8a82c71B4FFc3362C96b1Aae03e0 (Base / EVM)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

Return simulation budget information even in case of error

1 participant