-
Notifications
You must be signed in to change notification settings - Fork 95
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
feat(new-RPC): connection healthcheck implementation for peers #2194
base: dev
Are you sure you want to change the base?
Conversation
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
4f66e1b
to
1d9d874
Compare
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
5962e93
to
f5c98da
Compare
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
73364f0
to
b73a0f2
Compare
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
1198a6d
to
9774f15
Compare
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
ca8712e
to
93efaa2
Compare
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
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.
LGTM
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
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.
one question?
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
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.
LGTM!
Thanks :)
Signed-off-by: onur-ozkan <[email protected]>
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.
Thanks, LGTM 😂
There seems to be a lot of changes here since my last approval, will give it another check today to make sure everything is fine, if so, will approve and merge. |
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.
Huge work! Everything looks good to me, the below comments are just some nits, it's up to you if you want to resolve them.
Please merge with dev for failing test_electrum_tx_history
to pass.
let sender_public_key = keypair.public().encode_protobuf(); | ||
|
||
let data = HealthcheckData { | ||
sender_public_key, | ||
expires_at_secs: u64::try_from(Utc::now().timestamp()).map_err(|e| e.to_string())? | ||
+ healthcheck_message_exp_secs(), | ||
is_a_reply, | ||
}; | ||
|
||
let signature = try_s!(keypair.sign(&try_s!(data.encode()))); |
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.
It's a bit strange that we encode the sender_public_key
using protobuf
but we use messagepack
for the whole data. It's fine as it will cause no problems but thought to bring it up. If you wanna encode the whole data using protobuf you can follow the swaps v2 examples, it's up to you @onur-ozkan
let encoded_msg = msg.encode_to_vec(); |
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.
IMO protobuf definitions add unnecessary complexity since we don't need to provide a language-agnostic interface.
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.
Protobuf has some backward compatibility benefits if some structs are nested as opposed to messagepack ref. #1017 (comment) , if this struct won't change in this way then no need for it for sure. Please resolve this if it's not needed.
|
||
{ | ||
let mut book = ctx.healthcheck_response_handler.lock().await; | ||
book.clear_expired_entries(); |
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.
This clear_expired_entries
will be removed when merging with this #2232 depending on which gets merged first. Just a note :)
peer_connection_healthcheck
to verify if peer X is currently connected to the KDF network.