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

Fix for transaction submission timeout #5191

Merged

Conversation

aditya1702
Copy link
Contributor

@aditya1702 aditya1702 commented Feb 2, 2024

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with name of package that is most changed in the PR, ex.
    services/friendbot, or all or doc if the changes are broad or impact many
    packages.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated any docs (developer docs, .md
    files, etc... affected by this change). Take a look in the docs folder for a given service,
    like this one.

Release planning

  • I've updated the relevant CHANGELOG (here for Horizon) if
    needed with deprecations, added features, breaking changes, and DB schema changes.
  • I've decided if this PR requires a new major/minor version according to
    semver, or if it's mainly a patch change. The PR is targeted at the next
    release branch if it's not a patch change.

What

Adds a check in the transaction submission workflow, where it returns the bad sequence error immediately if Horizon and Core sync up with each other.

Why

During a particular edge-case, if core reports bad-seq error, and Horizon and Core are synced up with each other, the txsub endpoint will still timeout instead of returning the error immediately.

closes #5192

This is a bug due to how Horizon will keep waiting for the account sequence to catch up to the submitted tx seq.

Known limitations

NA

@aditya1702 aditya1702 changed the title [WIP] Fix for transaction submission timeout Fix for transaction submission timeout Feb 2, 2024
@aditya1702 aditya1702 marked this pull request as ready for review February 2, 2024 23:41
Copy link
Contributor

@sreuland sreuland left a comment

Choose a reason for hiding this comment

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

lgtm, nice work on pulling up the StateInterface to enable a unit test with mocking!

services/horizon/internal/ledger/main.go Outdated Show resolved Hide resolved
@aditya1702 aditya1702 merged commit 0fa7d22 into stellar:release-horizon-v2.28.1 Feb 3, 2024
28 checks passed
sreuland pushed a commit to sreuland/go that referenced this pull request Feb 5, 2024
* Add check for ledger state in txsub

* Add test for badSeq

* Fix failing unittest

* Update system_test.go

* Small changes

* Update main.go
@aditya1702 aditya1702 deleted the txsub-timeout-fix branch February 6, 2024 23:29
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.

services/horizon/txsub: submitting transaction with future sequence may result in 60s timeout
4 participants