Skip to content

Commit

Permalink
Check if bucketlist is enabled in network config
Browse files Browse the repository at this point in the history
  • Loading branch information
sisuresh committed Sep 13, 2023
1 parent 9855158 commit e4d8def
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ledger/NetworkConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,11 @@ initialBucketListSizeWindow(Application& app)
ConfigSettingEntry entry(CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW);

// Populate 30 day sliding window of BucketList size snapshots with 30
// copies of the current BL size
auto blSize = app.getBucketManager().getBucketList().getSize();
// copies of the current BL size. If the bucketlist is disabled for testing,
// just fill with ones to avoid triggering asserts.
auto blSize = app.getConfig().MODE_ENABLES_BUCKETLIST
? app.getBucketManager().getBucketList().getSize()
: 1;
for (auto i = 0;
i < InitialSorobanNetworkConfig::BUCKET_LIST_SIZE_WINDOW_SAMPLE_SIZE;
++i)
Expand Down Expand Up @@ -1161,7 +1164,8 @@ SorobanNetworkConfig::maybeSnapshotBucketListSize(uint32_t currLedger,
{
auto ledgerVersion = ltx.loadHeader().current().ledgerVersion;
// // Check if BucketList size window should exist
if (protocolVersionIsBefore(ledgerVersion, ProtocolVersion::V_20))
if (protocolVersionIsBefore(ledgerVersion, ProtocolVersion::V_20) ||
!app.getConfig().MODE_ENABLES_BUCKETLIST)
{
return;
}
Expand Down

5 comments on commit e4d8def

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

saw approval from MonsieurNicolas
at sisuresh@e4d8def

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

merging sisuresh/stellar-core/bucket-fix = e4d8def into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

sisuresh/stellar-core/bucket-fix = e4d8def merged ok, testing candidate = ecb24df

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

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

fast-forwarding master to auto = ecb24df

Please sign in to comment.