Repository navigation
feat: validate peer setup before a demo runs on - #9537
Merged
Merged
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
pjwerneck
force-pushed
the
pjwerneck/validate-peer-setup
branch
from
September 30, 2026 21:05
541d57d to
40c8602
Compare
pjwerneck
added this pull request to stack #9546
October 1, 2026 18:48
pjwerneck
force-pushed
the
pjwerneck/validate-peer-setup
branch
from
October 5, 2026 13:06
f60605b to
9d6eb07
Compare
A wrong peer email showed up only halfway through a notebook, and a connection left over from an earlier run looked live. validate_peer() fails unless the peer is approved and either connected in this session or logged in within max_age (Drive's modified time of its version file). With a timeout it waits for a late approval or login, one Drive request per poll. The demo notebooks call it after peering.
validate_peer() now warns about a peer that was already connected, or already waiting for our approval, at the first load_peers(). Either can be left over from an earlier run. The login-time check and its Drive read are removed. delete_syftbox() clears the record, so a reset client does not warn. The notebooks leave the enclave to attest_peer().
Waiting for an approval belongs to wait_until_peered, so validate_peer() loses its timeout, the poll loop and peer_may_be_valid(). The notebooks call it without a timeout.
pjwerneck
force-pushed
the
pjwerneck/validate-peer-setup
branch
from
October 7, 2026 01:51
9d6eb07 to
4ab778f
Compare
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
Adds
client.validate_peer(email). It catches a wrong peer email right after peering, instead ofhalfway through a demo. The enclave demo notebooks now call it.
Changes
validate_peer()onSyftboxManager,SyftRDSClientandSyftEnclaveClient. It raisesPeerSetupErrorif the email is not a peer, is waiting for this client's approval, or wasrejected, and
PeerNotReadyErrorif the peer has not approved our request yet.peers: the connection can be left over from an earlier run.
delete_syftbox()clears that record.validate_peer()after peering. The enclave is left toattest_peer().Testing
tests/unit/test_validate_peer.py(6 tests, mock Drive) and one enclave-client test.tests/unit526,syft-rds105,syft-enclave280.Asana task