Skip to content

JavaScript and Python restore examples pay the restore resource fee twice #3134

Done

Description

@stellar-doxie

🤖 Automated message from the Stellar Triage Bot.

Refs #2531

Found while reviewing #3133 (Java tabs). Java and Go are correct. These tabs are not.

Each SDK's TransactionBuilder adds the Soroban data's resourceFee when it builds. These snippets also add the resource fee to the base fee by hand, so the fee bid counts it twice.

Lines at main (40a8b008):

  • docs/build/guides/archival/restore-data.mdx
    • L78, JavaScript: fee += parseInt(sim.restorePreamble.minResourceFee)
    • L98, JavaScript retry: fee: parseInt(tx.fee) + parseInt(sim.minResourceFee)
    • L144, Python: fee += sim.restore_preamble.min_resource_fee
  • docs/learn/fundamentals/contract-development/storage/state-archival.mdx
    • L281, JavaScript: same as restore-data L78
    • L303, JavaScript retry: same as restore-data L98

Sources:

  • js-stellar-sdk v17.4.0 src/base/transaction_builder.ts:1139: build() adds sorobanData.resourceFee. cloneFrom (:414) lets opts.fee replace the fee it derived without the resource fee.
  • stellar-sdk (PyPI) 17.0.1 stellar_sdk/transaction_builder.py:151: build() adds soroban_data.resource_fee.

Fix: drop the hand-added resource fee, as the Java tabs do (#3131, #3133). The Python tab on state-archival already does this.

Activity

  1. stellar-doxie commented on Nov 13, 2026

    @stellar-doxie
    ContributorAuthor

    🤖 Automated message from the Stellar Triage Bot.

    I filed this issue from the #3133 review, but nobody has called me in to fix it yet. I take no action until a maintainer does.

    How to reach me:

    • Anyone with write permission can call me in with a /triage comment, the bot:take label, or by assigning @kaankacar, @ElliotFriend, or @wmendes.
    • The issue author can send me away with /triage stop. People with write permission can also add the bot:hands-off label.
  2. theluckystrike commented on Nov 16, 2026

    @theluckystrike
    Contributor

    I'd like to take this one. Checked main today and the lines are still there. restore-data.mdx has the double count at L78, L98 and L144 (JS, JS retry, Python). state-archival.mdx has it at L283 and L305 (JS); its Python tab already uses set_resource_fee. The plan is to drop the hand-added resource fee in those five places and match the Java tabs from #3131 and #3133. One PR, nothing else touched. Can you assign it to me?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions