Skip to content
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

Using fee-bump with Soroban transactions requires doubling the inner tx fee #749

Open
kalepail opened this issue May 31, 2024 · 1 comment
Assignees
Labels

Comments

@kalepail
Copy link
Contributor

Full context on Discord
https://discord.com/channels/897514728459468821/1245935726424752220

Describe the bug
When wrapping a Soroban transaction in a fee-bump transaction you're required to match the inner tx base fee which effectively doubles the quote price of the transaction.

Here's an example

AAAABQAAAABQECxBd0OuvEZCPrXlzF2/KQQpwJD0ed7uK4vPZ6A9hwAAAAACfqMUAAAAAgAAAAAIMRarW2LO2GZ6lScinIR0+CECrUHivNP+6BJc3zEL1QE/KnoAHJSYAAAACAAAAAEAAAAAAAAAAAAAAABmWT12AAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABHN579wJ8O5BfFisKZCaMjA1tYZtcPlVuOSMRW7RDd98AAAAGZGVwbG95AAAAAAACAAAADQAAACBLD+IRw8zUkKwAPsZgoLywmgpZUrxYzum6ClDBefH7BgAAAA0AAABBBAcQXRv+f+kRjdyoHQGXAyiJnEJ/kVczkIXrc0/0F2BNs2nygJr6ircqlF/59ONO//07CDEWltBIMubu6jjM2WUAAAAAAAAAAAAAAQAAAAAAAAADAAAABgAAAAEc3nv3Anw7kF8WKwpkJoyMDW1hm1w+VW45IxFbtEN33wAAABQAAAABAAAAB1D3fx7c/cpL0nVTC0jy5V1sNPzDkRG8hmxak/6zhCJdAAAAB+/U5X3hDAM20j42nL3RePNDVgEJbq0pKbOh7KYCQcNHAAAAAgAAAAYAAAABuHqGseBXUIPAHcksO2o+KiFwzTgADVuggBffwvUx1PoAAAANAAAAIEsP4hHDzNSQrAA+xmCgvLCaCllSvFjO6boKUMF58fsGAAAAAQAAAAYAAAABuHqGseBXUIPAHcksO2o+KiFwzTgADVuggBffwvUx1PoAAAAUAAAAAQAuJ9YAAChsAAABkAAAAAABPyoWAAAAAd8xC9UAAABAzDPZILljCYGq6MH7+2s0FLmvNOSy/QPio1/OYQY9mHr5rs1arm6hZbUakjR+6eWmwe7nffa1KuajCOQ70iKgBAAAAAAAAAABZ6A9hwAAAECbu/m+vzVjytsxWzj8YaglgWFEU3x2DqZA68/qQp5Kb/C1Xw4BVeKb8UYBJhsO16+vEWBboExpgYnlkekxSn0K

If I try and use a smaller outer fee when fee-bumping via something like
TransactionBuilder.buildFeeBumpTransaction(keypair, (10_000).toString(), transaction, Networks.TESTNET); I get an error Invalid baseFee, it should be at least 20916858 stroops.

We're kinda retrofitting the current fee as a "per operation" construct as Soroban transactions can only have the one operation. I'm unsure if this is a Core, Horizon or JS SDK bug but requiring a doubling of your fee to fee-bump isn't ideal.

What version are you on?
v12.0.0

Additional context
Tested this by modifying js-stellar-base master...inner-fee-fix By removing the throw and more manually setting the fee I can get a much smaller fee to submit successfully. So in this case I think the JS SDK is trying to be too smart

TransactionBuilder.buildFeeBumpTransaction also 2x the fee (in order to cover both the inner ops and the outer fee-bump "op")

In most cases this is useful and helpful, but in the Soroban instance this really doesn't work. I'm not sure exactly what the answer here is but likely it's creating a smarter error or just removing it altogether and then allowing the TransactionBuilder.buildFeeBumpTransaction fee field to actually set the fee for the whole tx vs per op. Or maybe a new TransactionBuilder altogether that's custom built for handling wrapping Soroban transctions.

@kalepail kalepail added the bug label May 31, 2024
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Oct 4, 2024
@janewang janewang added this to DevX Oct 4, 2024
@janewang janewang moved this from Backlog (Not Ready) to Todo (Ready for Dev) in DevX Oct 4, 2024
@janewang
Copy link

janewang commented Oct 4, 2024

@Shaptic would you be able to take a look?

@Shaptic Shaptic self-assigned this Oct 7, 2024
@Shaptic Shaptic removed this from DevX Oct 7, 2024
@Shaptic Shaptic moved this from Backlog to In Progress in Platform Scrum Oct 7, 2024
@Shaptic Shaptic added this to the platform sprint 51 milestone Oct 7, 2024
@Shaptic Shaptic removed this from the platform sprint 53 milestone Dec 3, 2024
@Shaptic Shaptic moved this from In Progress to Backlog in Platform Scrum Dec 3, 2024
@mollykarcher mollykarcher moved this from Backlog to To Do in Platform Scrum Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To Do
Development

No branches or pull requests

4 participants