Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
239 changes: 224 additions & 15 deletions README.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/software/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ this survey mechanism, just set `SURVEYOR_KEYS` to `$self` or a bogus key

### The following HTTP commands are exposed on test instances
* **generateload** `generateload[?mode=
(pay|soroban_upload|soroban_invoke_setup|soroban_invoke|upgrade_setup|create_upgrade|mixed_classic_soroban|pay_pregenerated|stop)&accounts=N&offset=K&txs=M&txrate=R&spikesize=S&spikeinterval=I&maxfeerate=F&skiplowfeetxs=(0|1)&minpercentsuccess=S&instances=Y&wasms=Z&payweight=P&sorobanuploadweight=Q&sorobaninvokeweight=R&file=F]`
(pay|soroban_upload|soroban_invoke_setup|soroban_invoke|upgrade_setup|create_upgrade|mixed_classic_soroban|pay_pregenerated|stop)&accounts=N&offset=K&txs=M&txrate=R&spikesize=S&spikeinterval=I&maxfeerate=F&skiplowfeetxs=(0|1)&completiontimeout=L&minpercentsuccess=S&instances=Y&wasms=Z&payweight=P&sorobanuploadweight=Q&sorobaninvokeweight=R&file=F]`

Artificially generate load for testing; must be used with
`ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING` set to true.
Expand Down Expand Up @@ -608,6 +608,9 @@ this survey mechanism, just set `SURVEYOR_KEYS` to `$self` or a bogus key
* when `skiplowfeetxs` is set to `true` the transactions that are not accepted by
the node due to having too low fee to pass the rate limiting are silently
skipped. Otherwise (by default), such transactions would cause load generation to fail.
* `completiontimeout` is the number of ledgers a run waits, after it has
submitted its last transaction, for its transactions to be applied before
it reports failure. The default is 20 ledgers, and 150 for `sac_payment`.

Soroban load generation also makes use of the `minpercentsuccess` parameter,
which determines the minimum percentage of Soroban transactions that must
Expand Down
20 changes: 17 additions & 3 deletions src/bucket/LiveBucketIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,27 @@ LiveBucketIndex::markBloomMiss() const
std::shared_ptr<BucketEntry const>
LiveBucketIndex::getCachedEntry(LedgerKey const& k) const
{
if (shouldUseCache() && isCachedType(k))
if (mDiskIndex && isCachedType(k))
{
SharedLockExclusive lock(mCacheMutex);
auto cachePtr = mCache->maybeGet(k);
// Lookups only read the cache (`peek` records nothing), so they run
// under the shared lock, side by side: ledger apply loads accounts
// from many threads at once, and each load asks the cache of every
// bucket on its way down the bucket list. Only inserting an entry
// takes the lock exclusively (maybeAddToCache). What a lookup gives
// up is the access time of the entry it hits: when the cache is
// smaller than the bucket's accounts, eviction goes by when an entry
// was put in, not by when it was last read.
SharedLockShared lock(mCacheMutex);
if (!mCache)
{
return nullptr;
}
auto cachePtr = mCache->peek(k);
if (cachePtr)
{
mCacheHitMeter.Mark();
// The entry is shared; the copy of the pointer is taken under
// the lock.
return *cachePtr;
}

Expand Down
Loading
Loading