Repository navigation
Conversation
… the membership gate Two source guards for ADR 0037 step 8. Every construction of NeighborDiscovered, NeighborLost or PeerRssi in the engine, the FFI crate and the browser crate is emitted behind a core gate call. Frames for this node have one entry, and the membership gate runs in it before the first side effect.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Step 8 of the shared-network plan (ADR 0037). Stacked on #690.
The behavioural tests in #688 and #689 drive the core. A host that emits a neighbour report on its own, or a second reader of the transport, would pass every one of them. These two guards make that state impossible to reach unnoticed.
every_neighbour_report_passes_the_core_gateoffline-protocol,offline-protocol-uniffiandoffline-protocol-web. It skips inline test modules,tests/,telemetry/andevents.rs.NeighborDiscovered,NeighborLostorPeerRssimust be handed straight toemit_eventorpush_event.neighbor_reachable,neighbor_unreachableorapp_sees_peer, or the core's ownrelease_held_discovery.frames_for_this_node_have_one_entry_and_it_is_gatedtransport_manager.receive()is called in exactly one shipped file,protocol/receive.rs.inbound_admittedcomes before the Lamport merge, which is the first side effect.Mutation checks (each restored afterwards)
uniffi/src/lib.rs:3365fails the first guard and names that line.web/src/node.rs:417fails it and names that line.inbound_admittedfromreceive.rsfails the second guard.cargo test -p offline-protocol --lib: 2216 passed.cargo clippy --workspace -- -D warningsis clean.Left as is, on purpose
Subscription renewal and the data-sync kick are not gated. Both act on relations the application itself created (a subscription it made, a document it shares), so the application already knows the peer.