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

474/soroban diagnostic events #4813

Merged
merged 5 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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: 14 additions & 9 deletions ingest/ledgerbackend/captive_core_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ func (c *CaptiveStellarCore) roundDownToFirstReplayAfterCheckpointStart(ledger u
//
// Requires Stellar-Core v13.2.0+.
type CaptiveStellarCore struct {
archive historyarchive.ArchiveInterface
checkpointManager historyarchive.CheckpointManager
ledgerHashStore TrustedLedgerHashStore
useDB bool
archive historyarchive.ArchiveInterface
checkpointManager historyarchive.CheckpointManager
ledgerHashStore TrustedLedgerHashStore
useDB bool
enableSorobanDiagnosticEvents bool

// cancel is the CancelFunc for context which controls the lifetime of a CaptiveStellarCore instance.
// Once it is invoked CaptiveStellarCore will not be able to stream ledgers from Stellar Core or
Expand Down Expand Up @@ -136,6 +137,9 @@ type CaptiveCoreConfig struct {
// of DATABASE parameter in the captive-core-config-path or if absent, the db will default to sqlite
// and the db file will be stored at location derived from StoragePath parameter.
UseDB bool

// Enable Soroban diagnostic events in core
EnableSorobanDiagnosticEvents bool
}

// NewCaptive returns a new CaptiveStellarCore instance.
Expand Down Expand Up @@ -173,11 +177,12 @@ func NewCaptive(config CaptiveCoreConfig) (*CaptiveStellarCore, error) {
}

c := &CaptiveStellarCore{
archive: &archivePool,
ledgerHashStore: config.LedgerHashStore,
useDB: config.UseDB,
cancel: cancel,
checkpointManager: historyarchive.NewCheckpointManager(config.CheckpointFrequency),
archive: &archivePool,
ledgerHashStore: config.LedgerHashStore,
useDB: config.UseDB,
enableSorobanDiagnosticEvents: config.EnableSorobanDiagnosticEvents,
cancel: cancel,
checkpointManager: historyarchive.NewCheckpointManager(config.CheckpointFrequency),
}

c.stellarCoreRunnerFactory = func() stellarCoreRunnerInterface {
Expand Down
3 changes: 3 additions & 0 deletions ingest/ledgerbackend/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type captiveCoreTomlValues struct {
UseBucketListDB bool `toml:"EXPERIMENTAL_BUCKETLIST_DB,omitempty"`
BucketListDBPageSizeExp *uint `toml:"EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT,omitempty"`
BucketListDBCutoff *uint `toml:"EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF,omitempty"`
EnableSorobanDiagnosticEvents bool `toml:"ENABLE_SOROBAN_DIAGNOSTIC_EVENTS,omitempty"`
}

// QuorumSetIsConfigured returns true if there is a quorum set defined in the configuration.
Expand Down Expand Up @@ -324,6 +325,8 @@ type CaptiveCoreTomlParams struct {
UseDB bool
// the path to the core binary, used to introspect core at runtie, determine some toml capabilities
CoreBinaryPath string
// Make core emit Soroban diagnostic events
EnableSorobanDiagnosticEvents bool
}

// NewCaptiveCoreTomlFromFile constructs a new CaptiveCoreToml instance by merging configuration
Expand Down