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

499 make vault retry stellar transaction submission for tx insufficient fee error #500

Conversation

ebma
Copy link
Member

@ebma ebma commented Mar 27, 2024

This PR adds handling for 'tx_insufficient_fee' errors.

We create a new transaction with a fee that is 10 times higher than the previous one. This 10x factor is adopted from the requirement of FeeBump transactions, see here. We cannot use fee bump transactions however, as we did not add proper handling for them in the stellar-relay pallet here. Using fee bump transactions here is not necessary though as they were introduced with a different purpose in mind. For more information see this blog post.

The increased fee will not go beyond the maximum of 1 XLM. This amount was chosen arbitrarily and we could think about making this configurable so that each vault operator can choose this value but it should be fine not to make this configurable for the time being.

Closes #499.

@ebma ebma requested a review from a team March 27, 2024 15:53
Copy link
Contributor

@b-yap b-yap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@ebma ebma merged commit 2c5cb4d into main Mar 28, 2024
1 check failed
@ebma ebma deleted the 499-make-vault-retry-stellar-transaction-submission-for-tx_insufficient_fee-error branch March 28, 2024 16:46
@TorstenStueber
Copy link
Contributor

Great PR, this will be a big improvement for the UX.

In theory the logic could be caught in a cycle where the fee is already at the 1 XLM maximum and will be resubmitted repeatedly. Not sure whether such a scenario will ever happen. But anyway: would that be a problem for the vault?

@ebma
Copy link
Member Author

ebma commented Apr 2, 2024

In theory the logic could be caught in a cycle where the fee is already at the 1 XLM maximum and will be resubmitted repeatedly. Not sure whether such a scenario will ever happen. But anyway: would that be a problem for the vault?

Yes, that's true but it should not be a problem. As you said, the vault will continue resubmitting the transaction with a fee of 1 XLM but assuming that the load on the Stellar network fluctuates, the vault will manage to submit that transaction eventually. If the traffic on the Stellar network ever gets so high that every transaction needs to pay at least 1 XLM to go through, we would definitely need to revisit this change again though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make vault retry Stellar transaction submission for tx_insufficient_fee error
3 participants