You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that LedgerTxn's flag shouldUpdateLastModified is used inconsistently across the codebase (we now use LedgerTxn a lot more often to load the network config), as sometimes it's set to true and sometimes it's false:
This should not matter for read-only cases, where we do things like
{
LedgerTxn ltx(mApp.getLedgerTxnRoot(), false,
TransactionMode::READ_ONLY_WITHOUT_SQL_TXN);
auto const& conf = mApp.getLedgerManager().getSorobanNetworkConfig(ltx);
... do something with conf...
... end of scope, automatic ltx rollback...
}
but in general, this is a footgun that should be fixed. We should audit the usage and see if the flag can be removed (i.e. the condition is always true). If the flag is needed for tests only, we can have a special constructor behind BUILD_TESTS macro.
The text was updated successfully, but these errors were encountered:
Resolves#4315 and
#3800 This PR
automatically switches overlay/herder to using BucketListDB snapshots
instead of LedgerTxn.
This change introduces a single "read-only ledger state snapshot"
interface, which supports both SQL (via LedgerTxn) and BucketListDB
snapshots. A unified interface avoids invasive changes to the rest of
the codebase to support both snapshot types, and allows to have a
centralized validation flow for both overlay and apply time.
A notable change is the removal of nested LegderTxn in validation paths,
and using loadWithoutRecord instead in newer protocols. This creates a
stronger invariant that validation flow is only meant to be accessing
read-only version of the ledger, and prevents it from making
modifications by accident. Note that nested LedgerTxn is preserved for
older buggy versions of the protocol (making the code a bit uglier than
I would have preferred, I'm open to ideas on simplifying/refactoring old
protocol logic out of the critical path).
It appears that LedgerTxn's flag
shouldUpdateLastModified
is used inconsistently across the codebase (we now use LedgerTxn a lot more often to load the network config), as sometimes it's set to true and sometimes it's false:stellar-core/src/herder/TransactionQueue.cpp
Line 1243 in e38ee72
stellar-core/src/herder/TxQueueLimiter.cpp
Line 128 in e38ee72
stellar-core/src/ledger/LedgerManagerImpl.cpp
Line 1138 in e38ee72
This should not matter for read-only cases, where we do things like
but in general, this is a footgun that should be fixed. We should audit the usage and see if the flag can be removed (i.e. the condition is always true). If the flag is needed for tests only, we can have a special constructor behind BUILD_TESTS macro.
The text was updated successfully, but these errors were encountered: