Skip to content

Commit

Permalink
Add captive-core support for TESTING_MINIMUM_PERSISTENT_ENTRY_LIFETIME (
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio authored Jul 28, 2023
1 parent db6a29c commit 7cb428e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
TESTING_MINIMUM_PERSISTENT_ENTRY_LIFETIME=16

[[HOME_DOMAINS]]
HOME_DOMAIN="testnet.stellar.org"
QUALITY="MEDIUM"

[[VALIDATORS]]
NAME="sdf_testnet_1"
HOME_DOMAIN="testnet.stellar.org"
PUBLIC_KEY="GDKXE2OZMJIPOSLNA6N6F2BVCI3O777I2OOC4BV7VOYUEHYX7RTRYA7Y"
ADDRESS="localhost:123"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated file, do not edit
FAILURE_SAFETY = -1
HTTP_PORT = 11626
LOG_FILE_PATH = ""
NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015"
TESTING_MINIMUM_PERSISTENT_ENTRY_LIFETIME = 16

[[HOME_DOMAINS]]
HOME_DOMAIN = "testnet.stellar.org"
QUALITY = "MEDIUM"

[[VALIDATORS]]
ADDRESS = "localhost:123"
HOME_DOMAIN = "testnet.stellar.org"
NAME = "sdf_testnet_1"
PUBLIC_KEY = "GDKXE2OZMJIPOSLNA6N6F2BVCI3O777I2OOC4BV7VOYUEHYX7RTRYA7Y"

[HISTORY.h0]
get = "curl -sf http://localhost:1170/{0} -o {1}"
25 changes: 13 additions & 12 deletions ingest/ledgerbackend/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,19 @@ type captiveCoreTomlValues struct {
LimitTxQueueSourceAccount bool `toml:"LIMIT_TX_QUEUE_SOURCE_ACCOUNT,omitempty"`
// we cannot omitempty because 0 is a valid configuration for FAILURE_SAFETY
// and the default is -1
FailureSafety int `toml:"FAILURE_SAFETY"`
UnsafeQuorum bool `toml:"UNSAFE_QUORUM,omitempty"`
RunStandalone bool `toml:"RUN_STANDALONE,omitempty"`
ArtificiallyAccelerateTimeForTesting bool `toml:"ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING,omitempty"`
HomeDomains []HomeDomain `toml:"HOME_DOMAINS,omitempty"`
Validators []Validator `toml:"VALIDATORS,omitempty"`
HistoryEntries map[string]History `toml:"-"`
QuorumSetEntries map[string]QuorumSet `toml:"-"`
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"`
FailureSafety int `toml:"FAILURE_SAFETY"`
UnsafeQuorum bool `toml:"UNSAFE_QUORUM,omitempty"`
RunStandalone bool `toml:"RUN_STANDALONE,omitempty"`
ArtificiallyAccelerateTimeForTesting bool `toml:"ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING,omitempty"`
HomeDomains []HomeDomain `toml:"HOME_DOMAINS,omitempty"`
Validators []Validator `toml:"VALIDATORS,omitempty"`
HistoryEntries map[string]History `toml:"-"`
QuorumSetEntries map[string]QuorumSet `toml:"-"`
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"`
TestingMinimumPersistentEntryLifetime *uint `toml:"TESTING_MINIMUM_PERSISTENT_ENTRY_LIFETIME,omitempty"`
}

// QuorumSetIsConfigured returns true if there is a quorum set defined in the configuration.
Expand Down
7 changes: 7 additions & 0 deletions ingest/ledgerbackend/toml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ func TestGenerateConfig(t *testing.T) {
peerPort: newUint(12345),
logPath: nil,
},
{
name: "offline config with minimum persistent entry in appendix",
mode: stellarCoreRunnerModeOnline,
appendPath: filepath.Join("testdata", "appendix-with-minimum-persistent-entry.cfg"),
expectedPath: filepath.Join("testdata", "expected-online-with-appendix-minimum-persistent-entry.cfg"),
logPath: nil,
},
} {
t.Run(testCase.name, func(t *testing.T) {
var err error
Expand Down

0 comments on commit 7cb428e

Please sign in to comment.