Skip to content

Commit

Permalink
Merge pull request #4180 from sisuresh/env-bump-20.2
Browse files Browse the repository at this point in the history
Bucket list update and env bump for fees

Reviewed-by: MonsieurNicolas
  • Loading branch information
latobarita authored Feb 2, 2024
2 parents fd3ad13 + cbdf732 commit 34d82fc
Show file tree
Hide file tree
Showing 20 changed files with 1,446 additions and 1,494 deletions.
102 changes: 37 additions & 65 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions soroban-settings/phase1.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@
"temp_rent_rate_denominator": 5356800,
"max_entries_to_archive": 100,
"bucket_list_size_window_sample_size": 30,
"bucket_list_window_sample_period": 64,
"eviction_scan_size": 1048576,
"starting_eviction_scan_level": 6
}
Expand Down
2 changes: 1 addition & 1 deletion src/bucket/Bucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ mergeCasesWithEqualKeys(MergeCounters& mc, BucketInputIterator& oi,

bool
Bucket::scanForEviction(AbstractLedgerTxn& ltx, EvictionIterator& iter,
uint64_t& bytesToScan,
uint32_t& bytesToScan,
uint32_t& remainingEntriesToEvict, uint32_t ledgerSeq,
medida::Counter& entriesEvictedCounter,
medida::Counter& bytesScannedForEvictionCounter,
Expand Down
2 changes: 1 addition & 1 deletion src/bucket/Bucket.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class Bucket : public std::enable_shared_from_this<Bucket>,
// bytesToScan -= amount_bytes_scanned
// remainingEntriesToEvict -= entries_evicted
bool scanForEviction(AbstractLedgerTxn& ltx, EvictionIterator& iter,
uint64_t& bytesToScan,
uint32_t& bytesToScan,
uint32_t& remainingEntriesToEvict, uint32_t ledgerSeq,
medida::Counter& entriesEvictedCounter,
medida::Counter& bytesScannedForEvictionCounter,
Expand Down
17 changes: 9 additions & 8 deletions src/bucket/test/BucketListTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,21 +714,22 @@ TEST_CASE_VERSIONS("network config snapshots BucketList size", "[bucketlist]")
check();

// Take snapshots more frequently for faster testing
app->getLedgerManager()
.getMutableSorobanNetworkConfig()
.setBucketListSnapshotPeriodForTesting(64);
modifySorobanNetworkConfig(*app, [](SorobanNetworkConfig& cfg) {
cfg.mStateArchivalSettings.bucketListWindowSamplePeriod = 64;
});

// Generate enough ledgers to fill sliding window
auto ledgersToGenerate =
(windowSize + 1) * networkConfig.getBucketListSizeSnapshotPeriod();
(windowSize + 1) *
networkConfig.stateArchivalSettings().bucketListWindowSamplePeriod;
for (uint32_t ledger = 1; ledger < ledgersToGenerate; ++ledger)
{
// Note: BucketList size in the sliding window is snapshotted before
// adding new sliding window config entry with the resulting
// snapshot, so we have to take the snapshot here before closing the
// ledger to avoid counting the new snapshot config entry
if ((ledger + 1) %
networkConfig.getBucketListSizeSnapshotPeriod() ==
if ((ledger + 1) % networkConfig.stateArchivalSettings()
.bucketListWindowSamplePeriod ==
0)
{
correctWindow.pop_front();
Expand All @@ -739,8 +740,8 @@ TEST_CASE_VERSIONS("network config snapshots BucketList size", "[bucketlist]")
lm.setNextLedgerEntryBatchForBucketTesting(
{}, LedgerTestUtils::generateValidUniqueLedgerEntries(10), {});
closeLedger(*app);
if ((ledger + 1) %
networkConfig.getBucketListSizeSnapshotPeriod() ==
if ((ledger + 1) % networkConfig.stateArchivalSettings()
.bucketListWindowSamplePeriod ==
0)
{
check();
Expand Down
4 changes: 2 additions & 2 deletions src/herder/test/HerderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4116,7 +4116,7 @@ herderExternalizesValuesWithProtocol(uint32_t version)
for (auto const& node : simulation->getNodes())
{
modifySorobanNetworkConfig(*node, [&](SorobanNetworkConfig& cfg) {
cfg.setBucketListSnapshotPeriodForTesting(1);
cfg.mStateArchivalSettings.bucketListWindowSamplePeriod = 1;
});
}
}
Expand Down Expand Up @@ -4428,7 +4428,7 @@ herderExternalizesValuesWithProtocol(uint32_t version)
if (protocolVersionStartsFrom(version, SOROBAN_PROTOCOL_VERSION))
{
modifySorobanNetworkConfig(*newC, [&](SorobanNetworkConfig& cfg) {
cfg.setBucketListSnapshotPeriodForTesting(1);
cfg.mStateArchivalSettings.bucketListWindowSamplePeriod = 1;
});
}
newC->start();
Expand Down
Loading

0 comments on commit 34d82fc

Please sign in to comment.