Repository navigation
Allow overriding block time bounds for testing - #5239
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a testing-only mechanism to relax the protocol-enforced bounds on Soroban SCP timing config (specifically ledgerTargetCloseTimeMilliseconds) by allowing test configuration overrides to adjust the min/max validation range used when applying config upgrades.
Changes:
- Add two new
Configtesting knobs to override the min/max allowed ledger target close time (milliseconds). - Thread
Config const&through config-upgrade validation paths (SorobanNetworkConfig::isValidConfigSettingEntry,ConfigUpgradeSetFrame::isValidForApply, andUpgrades::createUpgradesFor) so validation can consult the overrides. - Update affected unit tests and call sites to pass
app->getConfig()where required.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/transactions/test/FrozenLedgerKeysTests.cpp | Updates calls to isValidConfigSettingEntry to pass app->getConfig(). |
| src/main/Config.h | Adds new TESTING_* config fields for SCP timing close-time bounds. |
| src/main/Config.cpp | Initializes/parses the new TESTING_* config fields. |
| src/main/CommandHandler.cpp | Passes app config into ConfigUpgradeSetFrame::isValidForApply. |
| src/ledger/NetworkConfig.h | Extends isValidConfigSettingEntry signature to accept app config. |
| src/ledger/NetworkConfig.cpp | Implements override-aware min/max bound checks for SCP timing config validation. |
| src/herder/test/UpgradesTests.cpp | Updates upgrade creation and validation calls to pass app config. |
| src/herder/Upgrades.h | Updates Upgrades::createUpgradesFor and ConfigUpgradeSetFrame::isValidForApply signatures. |
| src/herder/Upgrades.cpp | Threads app config through upgrade validation and config-upgrade selection. |
| src/herder/HerderImpl.cpp | Passes app config into mUpgrades.createUpgradesFor. |
marta-lokhova
force-pushed
the
testOnlyBlockTime
branch
from
April 21, 2026 01:53
d7c17b5 to
5d4e816
Compare
SirTyson
previously approved these changes
Apr 21, 2026
SirTyson
left a comment
Contributor
There was a problem hiding this comment.
Approving to unblock, but why not just have a single boolean flag called IGNORE_LEDGER_TIME_UPGRADE_BOUNDS that when set to true returns uint32_t min and max? It's a simpler interface, I don't see any reason you'd want to adjust the bounds for a test but still keep them enforcable.
marta-lokhova
force-pushed
the
testOnlyBlockTime
branch
from
April 21, 2026 19:31
5d4e816 to
04fc297
Compare
dmkozh
previously approved these changes
Apr 21, 2026
marta-lokhova
force-pushed
the
testOnlyBlockTime
branch
from
April 21, 2026 21:55
04fc297 to
aff4ebc
Compare
dmkozh
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needed to support min block time testing (stellar/supercluster#376)