-
Notifications
You must be signed in to change notification settings - Fork 167
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
Protect training progress and metrics with signatures and DHT schema validation #250
Conversation
56c2523
to
a04dfa0
Compare
60e2923
to
23e7dd9
Compare
23e7dd9
to
c9a2148
Compare
5f72e3e
to
e5f5fbe
Compare
|
||
|
||
def make_validators(experiment_prefix: str) -> Tuple[List[RecordValidatorBase], bytes]: | ||
signature_validator = RSASignatureValidator() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it generate a new key pair after restarting an experiment on the same peer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. However, the public key here replaces the trainer UUID that was also randomly regenerated after each restart.
Do you think having a constant key pair (e.g. for one machine) may be useful? I imagine cases like implementing a leaderboard, however it may be a better idea to aggregate peers with different key pairs by endpoint/login at this stage (since one user may want to run several trainers that will have different IDs = different key pairs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's reasonable to assume that a single user shouldn't have to generate new key pairs for each run just for convenience. However, we can probably leave it as is for now if nobody objects
This PR follows #219 and implements:
I have tested the following:
run_first_peer.py
andrun_trainer.py
) works without errors.Along the way, it improves the validator system:
RSASignatureValidator
andSchemaValidator
picklable because their instances may be sent to the DHT in another process (this happens when we add validators to the existing DHT process after its creation).RSASignatureValidator
, so it is not generated again for each DHT-using entity inside one process (saves time because the generation takes ~100 ms).BytesWithPublicKey
type for DHT schemas.prefix
parameter toSchemaValidator
(if present, addsprefix + '_'
to all field names) and moves them from thebytes
tostr
keys (since the rest of code usesstr
keys).RSASignatureValidator
(e.g. better naming likesignature_validator.ownership_marker
->signature_validator.local_public_key
).