Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
76f9f42
ingest(config): add MetaPipePath and LedgerCloseDuration fields for s…
aditya1702 Apr 21, 2026
afd20a2
ingest: add LedgerBackendTypeStreamingLoadtest constant
aditya1702 Apr 21, 2026
7b1bd3c
ingest: add StreamingLoadtestLedgerBackend skeleton with PrepareRange
aditya1702 Apr 21, 2026
a6b895f
ingest: implement StreamingLoadtestLedgerBackend.GetLedger
aditya1702 Apr 21, 2026
df67ff5
ingest: test StreamingLoadtestLedgerBackend pacing behaviour
aditya1702 Apr 21, 2026
2094e1f
ingest: implement StreamingLoadtestLedgerBackend.GetLatestLedgerSequence
aditya1702 Apr 21, 2026
e7fa4ec
ingest: test StreamingLoadtestLedgerBackend EOF surface
aditya1702 Apr 21, 2026
1f26ae8
ingest: wire streaming-loadtest backend into NewLedgerBackend
aditya1702 Apr 21, 2026
d8d5b1c
cmd(ingest): add --meta-pipe-path, --ledger-close-duration flags and …
aditya1702 Apr 21, 2026
75c29eb
Update streaming_loadtest_ledger_backend.go
aditya1702 Apr 21, 2026
c8053c2
ingest: drain until archive publishes checkpoint before returning fro…
aditya1702 Apr 21, 2026
a701d10
Update statechange.resolvers.go
aditya1702 Apr 22, 2026
6f324c5
chore(deps): bump go-stellar-sdk to v0.5.0 and Go toolchain to 1.25.9
aditya1702 Apr 22, 2026
764b228
chore(build): bump Makefile + workflow tooling for Go 1.25, remove go…
aditya1702 Apr 22, 2026
e905365
fix: address staticcheck QF1012 findings surfaced by Go 1.25
aditya1702 Apr 22, 2026
bc30b42
chore(build): route exhaustive through golangci-lint
aditya1702 Apr 22, 2026
1ca6b98
chore(graphql): regenerate gqlgen output for v0.17.88
aditya1702 Apr 22, 2026
0b56dbc
fix(ci): restore indentation on the deadcode step in go.yaml
aditya1702 Apr 22, 2026
d711988
chore(graphql): normalize gqlgen output with goimports -local
aditya1702 Apr 22, 2026
5c743fc
Merge branch 'upgrade-go-sdk' into feature/add-load-test-backend
aditya1702 Apr 22, 2026
df8a953
ingest(streaming-loadtest): buffer and replay drained frames from arc…
aditya1702 Apr 22, 2026
9b5c9d9
Merge branch 'main' into feature/add-load-test-backend
aditya1702 Apr 22, 2026
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
23 changes: 21 additions & 2 deletions cmd/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (c *ingestCmd) Command() *cobra.Command {
},
{
Name: "ledger-backend-type",
Usage: "Type of ledger backend to use for fetching ledgers. Options: 'rpc' or 'datastore' (default)",
Usage: "Type of ledger backend to use for fetching ledgers. Options: 'rpc', 'datastore' (default), or 'streaming-loadtest' (dev-only, reads from named pipe)",
OptType: types.String,
ConfigKey: &ledgerBackendType,
FlagDefault: string(ingest.LedgerBackendTypeDatastore),
Expand All @@ -122,6 +122,23 @@ func (c *ingestCmd) Command() *cobra.Command {
FlagDefault: "config/datastore-pubnet.toml",
Required: false,
},
{
Name: "loadtest-meta-pipe-path",
Usage: "Filesystem path of the named pipe (FIFO) for streaming-loadtest backend. Required when ledger-backend-type is 'streaming-loadtest'.",
OptType: types.String,
ConfigKey: &cfg.MetaPipePath,
FlagDefault: "",
Required: false,
},
{
Name: "loadtest-ledger-close-duration",
Usage: "Minimum duration between ledger emits in streaming-loadtest mode. Accepts Go duration syntax (e.g., 1s, 200ms, 0 = uncapped). Only used with streaming-loadtest backend.",
OptType: types.String,
ConfigKey: &cfg.LedgerCloseDuration,
FlagDefault: "0s",
Required: false,
CustomSetValue: utils.SetConfigOptionDuration,
},
{
Name: "chunk-interval",
Usage: "TimescaleDB chunk time interval for hypertables. Only affects future chunks. Uses PostgreSQL INTERVAL syntax.",
Expand Down Expand Up @@ -183,8 +200,10 @@ func (c *ingestCmd) Command() *cobra.Command {
cfg.LedgerBackendType = ingest.LedgerBackendTypeRPC
case string(ingest.LedgerBackendTypeDatastore):
cfg.LedgerBackendType = ingest.LedgerBackendTypeDatastore
case string(ingest.LedgerBackendTypeStreamingLoadtest):
cfg.LedgerBackendType = ingest.LedgerBackendTypeStreamingLoadtest
default:
return fmt.Errorf("invalid ledger-backend-type '%s', must be 'rpc' or 'datastore'", ledgerBackendType)
return fmt.Errorf("invalid ledger-backend-type '%s', must be 'rpc', 'datastore', or 'streaming-loadtest'", ledgerBackendType)
}

appTracker, err := sentry.NewSentryTracker(sentryDSN, stellarEnvironment, 5)
Expand Down
11 changes: 11 additions & 0 deletions internal/ingest/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
LedgerBackendTypeRPC LedgerBackendType = "rpc"
// LedgerBackendTypeDatastore uses cloud storage (S3/GCS) to fetch ledgers
LedgerBackendTypeDatastore LedgerBackendType = "datastore"
// LedgerBackendTypeStreamingLoadtest reads stream-framed XDR LedgerCloseMeta
// from a named pipe fed by stellar-core apply-load. Dev-only.
LedgerBackendTypeStreamingLoadtest LedgerBackendType = "streaming-loadtest"
)

// StorageBackendConfig holds configuration for the datastore-based ledger backend
Expand Down Expand Up @@ -101,6 +104,14 @@
DBMinConns int
DBMaxConnLifetime time.Duration
DBMaxConnIdleTime time.Duration
// Streaming-loadtest backend options.
// MetaPipePath is the filesystem path of the named pipe (FIFO) that carries
// stream-framed XDR LedgerCloseMeta from stellar-core apply-load. Only consulted
// when LedgerBackendType == LedgerBackendTypeStreamingLoadtest.
MetaPipePath string
// LedgerCloseDuration paces the streaming-loadtest backend: GetLedger sleeps
// until this duration has elapsed since the previous emit. 0 = uncapped.
LedgerCloseDuration time.Duration
}

func (c Configs) BuildPoolConfig() db.PoolConfig {
Expand Down Expand Up @@ -145,7 +156,7 @@
}

if cfg.IngestionMode == services.IngestionModeLive {
if err := configureHypertableSettings(ctx, dbConnectionPool, cfg.ChunkInterval, cfg.RetentionPeriod, cfg.OldestLedgerCursorName, cfg.CompressionScheduleInterval, cfg.CompressAfter, cfg.MaxChunksToCompress); err != nil {

Check failure on line 159 in internal/ingest/ingest.go

View workflow job for this annotation

GitHub Actions / check

declaration of "err" shadows declaration at line 153
return nil, fmt.Errorf("configuring hypertable settings: %w", err)
}
}
Expand Down
21 changes: 21 additions & 0 deletions internal/ingest/ingest_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package ingest

import (
"testing"
"time"

"github.com/stretchr/testify/assert"
)

func TestConfigsStreamingLoadtestFields(t *testing.T) {
cfg := Configs{
MetaPipePath: "/tmp/fake.pipe",
LedgerCloseDuration: 2 * time.Second,
}
assert.Equal(t, "/tmp/fake.pipe", cfg.MetaPipePath)
assert.Equal(t, 2*time.Second, cfg.LedgerCloseDuration)
}

func TestLedgerBackendTypeStreamingLoadtestConstant(t *testing.T) {
assert.Equal(t, LedgerBackendType("streaming-loadtest"), LedgerBackendTypeStreamingLoadtest)
}
7 changes: 7 additions & 0 deletions internal/ingest/ledger_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ func NewLedgerBackend(ctx context.Context, cfg Configs) (ledgerbackend.LedgerBac
return newDatastoreLedgerBackend(ctx, cfg.DatastoreConfigPath, cfg.NetworkPassphrase)
case LedgerBackendTypeRPC:
return newRPCLedgerBackend(cfg)
case LedgerBackendTypeStreamingLoadtest:
return NewStreamingLoadtestLedgerBackend(StreamingLoadtestBackendConfig{
MetaPipePath: cfg.MetaPipePath,
LedgerCloseDuration: cfg.LedgerCloseDuration,
NetworkPassphrase: cfg.NetworkPassphrase,
ArchiveURL: cfg.ArchiveURL,
})
default:
return nil, fmt.Errorf("unsupported ledger backend type: %s", cfg.LedgerBackendType)
}
Expand Down
Loading
Loading