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

services/horizon: Remove Horizon Submission Queue #5039

Merged
merged 32 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3db7ed7
Remove horizon submission queue - 1
aditya1702 Aug 29, 2023
e1d96bd
Update system.go
aditya1702 Aug 29, 2023
b7cf3a7
Update system.go
aditya1702 Aug 29, 2023
f5c511a
remove WaitUntilAccountSequence
aditya1702 Aug 30, 2023
627d473
Update system.go
aditya1702 Aug 30, 2023
fa688aa
Remove tests related to WaitUntilAccountSequence - 1
aditya1702 Aug 30, 2023
0e71a79
Update system_test.go
aditya1702 Aug 30, 2023
400fbb0
Merge branch 'master' into remove-submission-queue-2
aditya1702 Sep 5, 2023
d1c6959
Remove history_transactions_filtered_tmp - 1
aditya1702 Sep 5, 2023
767a9f9
Fix failing tests in system_test.go
aditya1702 Sep 6, 2023
fc34e8b
Merge branch 'master' into remove-submission-queue-2
aditya1702 Sep 6, 2023
52c43ca
Revert "Remove history_transactions_filtered_tmp - 1"
aditya1702 Sep 8, 2023
0c60edf
Revert "Fix failing tests in system_test.go"
aditya1702 Sep 8, 2023
bcb5d82
Merge branch 'master' into remove-submission-queue-2
aditya1702 Sep 8, 2023
c257fff
Remove sequenceNumber from checkTxAlreadyExists
aditya1702 Sep 12, 2023
61de345
Undo removing waitUntilAccountSequence
aditya1702 Sep 12, 2023
6775122
Small change - 1
aditya1702 Sep 12, 2023
f1d49c2
Merge branch 'master' into remove-submission-queue-2
aditya1702 Sep 12, 2023
ff01be7
Merge branch 'master' into remove-submission-queue-2
aditya1702 Sep 13, 2023
711194d
Small changes - 2
aditya1702 Sep 13, 2023
7d39d5c
fix failing unit tests
aditya1702 Sep 13, 2023
b8bbcc6
Add some comments - 1
aditya1702 Sep 13, 2023
43e3c17
Small changes - 3
aditya1702 Sep 13, 2023
def0437
Merge branch 'master' into remove-submission-queue-2
aditya1702 Sep 14, 2023
9b3e3ab
Small changes - 4
aditya1702 Sep 14, 2023
ad0cc09
Fix failing tests - 1
aditya1702 Sep 14, 2023
487f41b
Merge branch 'master' into remove-submission-queue-2
aditya1702 Sep 14, 2023
b2321be
Use defer for sys.finish
aditya1702 Sep 14, 2023
a618186
Merge branch 'master' into remove-submission-queue-2
aditya1702 Sep 14, 2023
7c2ee7d
Revert "Use defer for sys.finish"
aditya1702 Sep 15, 2023
3d63938
Merge branch 'master' into remove-submission-queue-2
aditya1702 Sep 15, 2023
180aaa7
Small changes - 5
aditya1702 Sep 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions services/horizon/internal/httpx/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/stellar/go/services/horizon/internal/ledger"
hProblem "github.com/stellar/go/services/horizon/internal/render/problem"
"github.com/stellar/go/services/horizon/internal/render/sse"
"github.com/stellar/go/services/horizon/internal/txsub/sequence"
"github.com/stellar/go/support/db"
"github.com/stellar/go/support/log"
"github.com/stellar/go/support/render/problem"
Expand Down Expand Up @@ -49,7 +48,6 @@ func init() {
// register problems
problem.SetLogFilter(problem.LogUnknownErrors)
problem.RegisterError(sql.ErrNoRows, problem.NotFound)
problem.RegisterError(sequence.ErrNoMoreRoom, hProblem.ServerOverCapacity)
problem.RegisterError(db2.ErrInvalidCursor, problem.BadRequest)
problem.RegisterError(db2.ErrInvalidLimit, problem.BadRequest)
problem.RegisterError(db2.ErrInvalidOrder, problem.BadRequest)
Expand Down
6 changes: 2 additions & 4 deletions services/horizon/internal/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/stellar/go/services/horizon/internal/paths"
"github.com/stellar/go/services/horizon/internal/simplepath"
"github.com/stellar/go/services/horizon/internal/txsub"
"github.com/stellar/go/services/horizon/internal/txsub/sequence"
"github.com/stellar/go/support/db"
"github.com/stellar/go/support/log"
)
Expand Down Expand Up @@ -239,9 +238,8 @@ func initWebMetrics(app *App) {

func initSubmissionSystem(app *App) {
app.submitter = &txsub.System{
Pending: txsub.NewDefaultSubmissionList(),
Submitter: txsub.NewDefaultSubmitter(http.DefaultClient, app.config.StellarCoreURL),
SubmissionQueue: sequence.NewManager(),
Pending: txsub.NewDefaultSubmissionList(),
Submitter: txsub.NewDefaultSubmitter(http.DefaultClient, app.config.StellarCoreURL),
DB: func(ctx context.Context) txsub.HorizonDB {
return &history.Q{SessionInterface: app.HorizonSession()}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func TestTransactionPreconditionsMinSequenceNumberLedgerGap(t *testing.T) {
txParams := buildTXParams(master, masterAccount, currentAccountSeq+1)

// this txsub will error because the tx preconditions require a min sequence gap
// which has been set 10000 sequnce numbers greater than the current difference between
// which has been set 10000 sequence numbers greater than the current difference between
// network ledger sequence and account sequnece numbers
txParams.Preconditions.MinSequenceNumberLedgerGap = uint32(int64(networkLedger) - currentAccountSeq + 10000)
_, err = itest.SubmitMultiSigTransaction([]*keypair.Full{master}, txParams)
Expand Down
20 changes: 3 additions & 17 deletions services/horizon/internal/txsub/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,15 @@ func txResultFromHistory(tx history.Transaction) (history.Transaction, error) {
// queries execute on different ledgers. In this case, txsub can mistakenly respond with a bad_seq error
// because the first query occurs when the tx is not yet ingested and the second query occurs when the tx
// is ingested.
func checkTxAlreadyExists(ctx context.Context, db HorizonDB, hash, sourceAddress string) (history.Transaction, uint64, error) {
func checkTxAlreadyExists(ctx context.Context, db HorizonDB, hash string) (history.Transaction, error) {
err := db.BeginTx(ctx, &sql.TxOptions{
Isolation: sql.LevelRepeatableRead,
ReadOnly: true,
})
if err != nil {
return history.Transaction{}, 0, errors.Wrap(err, "cannot start repeatable read tx")
return history.Transaction{}, errors.Wrap(err, "cannot start repeatable read tx")
}
defer db.Rollback()

tx, err := txResultByHash(ctx, db, hash)
if err == ErrNoResults {
var sequenceNumbers map[string]uint64
sequenceNumbers, err = db.GetSequenceNumbers(ctx, []string{sourceAddress})
if err != nil {
return tx, 0, errors.Wrapf(err, "cannot fetch sequence number for %v", sourceAddress)
}

num, ok := sequenceNumbers[sourceAddress]
if !ok {
return tx, 0, ErrNoAccount
}
return tx, num, ErrNoResults
}
return tx, 0, err
return txResultByHash(ctx, db, hash)
}

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions services/horizon/internal/txsub/sequence/doc.go

This file was deleted.

10 changes: 0 additions & 10 deletions services/horizon/internal/txsub/sequence/errors.go

This file was deleted.

Loading