perf: parallel inbox reads and deliveries, kept final reads, background listening - #1111
Merged
Merged
Conversation
…nd listening Inbox sync and delivery: - A sync reads every route at once, and each route's members' pages at once; what came back is processed in the order it always was. - A delivery asks the first K members at once and replaces each that fails with the next, so it takes one round of answers and still lands on exactly K members (#867). - Member clients offer HTTP/2 over ALPN; the node's listener already offers it, so concurrent requests to a member share one connection. Verification: - Immutable objects and cells Core read as final are kept for the process's life (sdk::final_reads): an object is its bytes, and a final value holds its cell for good (storage spec §9, finality 2). Core evaluates the kept reads again on every use; nothing open, undecided or unserved is kept. The lineage walk, the SoFi/DLV reader and every later verification start from what an earlier one read. - A step's manifest prefetches the authority evidence, transition witness and successor evidence together, instead of three round trips in turn. Background and storage: - Backgrounding keeps the poller and its waits running when this device has contacts (Backgrounded::Listening), so a transfer lands without the recipient opening the app. - The foreground service starts as connectedDevice only: the NFC permission satisfies it, and it has no Android 15 daily cap. It stops itself on onTimeout. - The client database uses WAL with synchronous = FULL; its size counts the log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y4wDTToHmJfkYYJvMKXt3u
Code only; every pin's evidence ran at f4ff913 in release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y4wDTToHmJfkYYJvMKXt3u
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
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.
Summary
This batch speeds up syncing, sending and verification (DLV multi-hop walks included), keeps the app listening in the background, and makes database commits faster.
Inbox sync and delivery
a_send_lands_on_exactly_the_register_quorum_of_membersholds).h2, so concurrent requests to a member share one connection. No node change is needed.Verification (lineage walk, SoFi/DLV reader, reply checks)
sdk::final_readskeeps two kinds of reads for the life of the process:keep_completion), and immutable fetches all go through it. A later walk or verification therefore starts from what an earlier one read.Background and storage
Backgrounded::Listening), so a transfer lands without the recipient opening the app.connectedDeviceonly. The declaredNFCpermission satisfies its prerequisite, and it has no Android 15 daily cap (dataSyncdoes). The service stops itself inonTimeout.synchronous = FULL, so every commit is still durable at return.get_db_sizecounts the log.Related Issues
None.
Testing
cargo clippy --release -p dsm_sdk --all-targets --all-features -- -D warningsis clean.scripts/real_code_guard.py.bilateral_finality_testsandfrontier_verification_testsmodules in one process;make requirement-map-intentreports 0 failing.dsm_sdkrelease suite: running locally, and CI runs it too.New tests:
Notes
#[cfg(test)]).a_key_held_by_an_exercise_its_own_bytes_refute_is_skipped_on_those_bytes_alonenow forgets the process-wide kept reads before its "verifier that has read nothing yet" walk. Without that, the precondition no longer holds once reads are kept across verifiers.tropic01sibling) pick up theh2edge on their next local build.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y4wDTToHmJfkYYJvMKXt3u
Generated by Claude Code