Skip to content

Bug: estimateRequiredFee fallback under-estimates the create path it is used for #517

Description

@Jaydbrown

src/soroban.ts:460DEFAULT_RESOURCE_FEE_ESTIMATE = 1_000_000n (0.1 XLM), with the comment "a typical resource fee is a small fraction of one XLM".

The only caller is the insufficient-balance path of StreamsModule.create() (src/streams.ts:258-262), i.e. create_stream, which deploys a new contract (WASM instantiate + initialize + 3 persistent writes + 2 token transfers + a governor cross-contract call). Its resource fee is routinely several XLM, not a fraction of one.

Impact

InsufficientBalanceError.requiredBalance reported to the user is depositStroops + 1_000_000n — understated by the bulk of the real resource fee. The user tops up by the quoted amount and the next attempt still fails. This is the mirror-image of #430 (which over-stated by ~500 XLM).

Suggested fix

Pull the real fee from the error simulation when present; only fall back when it is truly absent, and size the fallback to the operation type (createwithdraw).

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingpriority: mediumMissing feature or UX issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions