mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-21 06:10:58 +00:00
Phase-10 brought in the upstream nodestore/peerfinder/consensus reorganisation along with its own write-path telemetry, which collided with the sync-diagnostic signals on this branch. Twelve files conflicted; every resolution keeps both intents rather than picking a side. The nodestore write timing was implemented twice, independently. Both sides added getStoreDurationUs()/getFetchDurationUs() to Database and both timed the backend call in each concrete store(). Keeping both would have added twice to storeDurationUs_ per store while storeStats() still counted one, so the mean write latency would have read double on every dashboard -- silently, since no test on either side asserts an exact microsecond figure. Resolved to one accumulator API: recordStoreDuration(), which takes a duration, clamps a sub-microsecond sample to zero and uses a relaxed atomic add. Phase-10's storeDurationStats() is gone and its two call sites now use the survivor, so all three store paths -- both store() overrides and importInternal() -- add exactly once. SlotCensus and its pure virtual moved from src/xrpld/peerfinder/ to include/xrpl/peerfinder/PeerfinderManager.h, following the Manager interface upstream relocated. The xrpld header is now phase-10's makeConfig shim, and Overlay.h, MetricMacros.cpp and the getSlotCensus() override chain point at the new location. ConsensusSpanNames.h and peerfinder Slot.h/Config.h include paths followed their headers into libxrpl the same way. InboundLedger gained phase-10's AcquireStats counters next to this branch's span activations in both the destructor abort path and done(); neither displaces the other. nodestore_state keeps the constant-based name this branch requires of it and phase-10's fuller description. Upstream #7292 deleted src/test/nodestore/Database_test.cpp, which held this branch's testDurationAccessors. Phase-10 restored the per-store half of that coverage in DatabaseConfig_test, but nothing covered importInternal -- it writes through storeBatch() and never through store(), so it is a third store path that has to time itself. That half is ported to a GTest in src/tests/libxrpl/nodestore/Database.cpp, keeping the exact zero-before and accumulate-after assertions and the per-instance negative check. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Consensus
This directory contains the implementation of a generic consensus algorithm. The implementation follows a CRTP design, requiring client code to implement specific functions and types to use consensus in their application. The interface is undergoing refactoring and is not yet finalized.