Skip to content

Allow overriding block time bounds for testing - #5239

Merged
marta-lokhova merged 1 commit into
stellar:masterfrom
marta-lokhova:testOnlyBlockTime
Apr 21, 2026
Merged

marta-lokhova merged 1 commit into
stellar:masterfrom
marta-lokhova:testOnlyBlockTime

Conversation

@marta-lokhova

Copy link
Copy Markdown
Contributor

Needed to support min block time testing (stellar/supercluster#376)

Copilot AI review requested due to automatic review settings April 20, 2026 23:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Config testing knobs to override the min/max allowed ledger target close time (milliseconds).
  • Thread Config const& through config-upgrade validation paths (SorobanNetworkConfig::isValidConfigSettingEntry, ConfigUpgradeSetFrame::isValidForApply, and Upgrades::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.

Comment thread src/ledger/NetworkConfig.cpp Resolved
Comment thread src/main/Config.cpp Resolved
Comment thread src/main/Config.cpp Resolved
Comment thread src/ledger/NetworkConfig.cpp Resolved
SirTyson
SirTyson previously approved these changes Apr 21, 2026

@SirTyson SirTyson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

dmkozh
dmkozh previously approved these changes Apr 21, 2026
Comment thread src/main/Config.h Resolved
@marta-lokhova
marta-lokhova enabled auto-merge April 21, 2026 22:04
@marta-lokhova
marta-lokhova added this pull request to the merge queue Apr 21, 2026
Merged via the queue into stellar:master with commit cc3647e Apr 21, 2026
53 checks passed
@marta-lokhova
marta-lokhova deleted the testOnlyBlockTime branch April 21, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants