Skip to content
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

DNS: Send ACK to Maker after successful address posting #414

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Levi0804
Copy link

This PR aims to address #401. Please let me know if my approach looks good to you.

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 46.15385% with 14 lines in your changes missing coverage. Please review.

Project coverage is 70.09%. Comparing base (221d33f) to head (878c028).
Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
src/maker/server.rs 35.71% 9 Missing ⚠️
src/market/directory.rs 50.00% 4 Missing ⚠️
src/protocol/messages.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #414      +/-   ##
==========================================
+ Coverage   70.06%   70.09%   +0.02%     
==========================================
  Files          34       34              
  Lines        4263     4270       +7     
==========================================
+ Hits         2987     2993       +6     
- Misses       1276     1277       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Levi0804 Levi0804 requested a review from Shourya742 February 11, 2025 21:29
@Levi0804
Copy link
Author

Do these changes look good?

@Levi0804 Levi0804 requested a review from Shourya742 February 14, 2025 15:34
@Levi0804
Copy link
Author

Ended up using .recv(). I was confused about something, but now it's clear.

@Levi0804 Levi0804 requested a review from Shourya742 February 15, 2025 09:21
@Levi0804 Levi0804 requested a review from Shourya742 February 17, 2025 11:37
@Levi0804
Copy link
Author

Do these changes look good?

Also, I noticed some tests have failed. The logs are suggesting to update workflow to use cache@v4. Should I update that?

@Levi0804 Levi0804 requested a review from Shourya742 February 18, 2025 20:54
Copy link

@mojoX911 mojoX911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach Ack. One blocking question.

Comment on lines 263 to 273
match status_recv.recv() {
Ok(status) => {
if let Err(e @ MakerError::UnexpectedMessage { .. }) = status {
log::error!("{:?}", e);
return Err(e);
}
}
Err(e) => {
log::error!("Failed to receive from status channel {:?}", e);
}
}
Copy link

@mojoX911 mojoX911 Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this? The errors and Ack are already handled in the thread loop. Even if you have it, it will only execute once for the first attempt, and it's not doing anything extra than you have already covered in the logic above.

If I am not wrong you will have an mpsc error, as the receiver will go out of scope before you receive a response from DNS.

This is redundant, and can be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are doing this to return a hard error as suggested in the following comment: #414 (comment)

Also, I now notice that this will work only for first attempt, upon sending another message it fails as if the receiving end of the channel is disconnected. Here:

// Do not block the process thread
status_sender
.send(Err(MakerError::General(
"Maximum retry limit reached, avoiding thread blocking",
)))
.unwrap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed with @Shourya742 , we shouldn't do hard errors for DNS Nacks, so this can be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright.

Comment on lines 254 to 259
// Do not block the process thread
status_sender
.send(Err(MakerError::General(
"Maximum retry limit reached, avoiding thread blocking",
)))
.unwrap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are suppose to put it in the complement of the if condition, and not put inside the if condition.

Comment on lines 254 to 259
// Do not block the process thread
status_sender
.send(Err(MakerError::General(
"Maximum retry limit reached, avoiding thread blocking",
)))
.unwrap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are suppose to put it in the complement of the if condition, and not put inside the if condition.

@Levi0804
Copy link
Author

Do these changes look good?

@Levi0804 Levi0804 requested a review from mojoX911 February 21, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants