-
Notifications
You must be signed in to change notification settings - Fork 16
[DO NOT MERGE] Partial sync mode #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sublimator
wants to merge
7
commits into
dev
Choose a base branch
from
partial-sync-mode
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Allows RPC handlers to query ledgers that are still being acquired, enabling faster node startup for read queries. Key changes: - Add coroutine detection via getCurrentCoroPtr() in LocalValue.h - Add postAndYield() to Coro for safe poll-wait synchronization - Modify SHAMap::finishFetch() to poll-wait for missing nodes when in coroutine context (30s timeout, re-requests missing nodes) - Add getPartialLedger() to InboundLedgers for accessing incomplete ledgers that have headers - Add getLastValidatedLedger() to LedgerMaster to get validated ledger hash even when not fully synced - Update RPCHelpers getLedger() to fall back to partial ledgers - Fix Manifest seq_++ bug for new manifest entries - Add zero hash guard in NetworkOPs::checkLastClosedLedger() Note: This is a proof of concept. Production use would require fetch prioritization to make queries fast enough to be practical.
Partial sync mode improvements for faster RPC queries during sync: - Track network-observed ledger from any validation (not just trusted) to allow queries before trusted validators are configured - Add priority node fetching: queries can request specific nodes be fetched immediately via addPriorityNode/addPriorityHash - Store state/transaction nodes directly to node store (not fetch pack) so partial sync queries find them immediately - Add poll-wait loops in RPCHelpers for ledger header acquisition - Replace postAndYield with sleep_for in SHAMap finishFetch - Implement linear backoff for re-requests (50ms increments, max 2s)
Call updateTrusted() immediately when all publisher lists become available in applyListsAndBroadcast(), rather than waiting for beginConsensus(). This allows validations to be trusted within milliseconds of VL fetch instead of waiting 14+ seconds for consensus to start. Also adds debugging logs: - PartialSync journal: untrusted validations during startup - PartialSync journal: checkAccept quorum details - ValidatorSite journal: VL fetch timing
Yields the coroutine and schedules resume after delay, freeing up the job queue thread instead of blocking it with sleep_for(). Updated SHAMap::finishFetch() and RPCHelpers getLedger() to use coro->sleepFor() for partial sync poll-wait loops.
Adds a new RPC handler that submits transactions and waits for validated results, designed for nodes still syncing: - Broadcasts raw tx to network without local state validation - Indexes tx hashes from incoming txMap leaf nodes for fast lookup - Polls for tx in partial ledgers, then waits for validation quorum - Only returns when numTrustedForLedger >= quorum (truly validated) Supporting changes: - Add hasTx()/knownTxHashes_ to InboundLedger for tx tracking - Add findTxLedger() to InboundLedgers to search across ledgers - Add broadcastRawTransaction() to NetworkOPs for blind relay - Add coroutine-local fetchTimeout to LocalValue.h - SHAMap::finishFetch() now uses configurable timeout
Simplify TX priority mechanism using RangeSet instead of per-TX hash tracking. When submit_and_wait is called, it registers a ledger range where TX nodes should be fetched before state nodes. Key changes: - Add prioritizeTxForLedgers(start, end) and isTxPrioritized(seq) to InboundLedgers using RangeSet<uint32_t> - InboundLedger::trigger() checks range to decide TX-before-state order - Remove complex per-TX hash tracking that couldn't help due to Merkle tree structure (need parent hashes to request children) - Format CMake and source files
When the node is synced and receiving transactions via gossip, ledgers are built locally and won't be in InboundLedgers. Now checks both: - InboundLedgers (partial sync mode - ledgers from peers) - LedgerMaster (synced mode - ledgers built from gossip)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.