-
Notifications
You must be signed in to change notification settings - Fork 808
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
[Merged by Bors] - Fix Rust 1.61 clippy lints #3192
Conversation
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.
Looks good! I had a comment on whether we could get around swapping out the lock in the simulator but since it's just the simulator don't think it's a big deal.
In reference to the currently ignored lint: I've read async locks are generally less performant, so I'm wondering if rather than swapping the lock on validator_store.initialized_validators
out for an async one, we should instead remove that lock and add one to validator_store.initalized_validators.definitions
and validator_store.initialized_validators.validators
Haven't checked it out in depth but I think we could get around holdintg it across an await if we do that
I'll have to dig into the VC locks some more. I think avoiding the async mutex if we can would be nice, although I'm worried there are other sketchy things we're doing that aren't yet being caught by Clippy (just as this issue wasn't caught until 1.61). When I started the refactor I noticed a lot of other places where we hold a lock across a
Initially I thought these were false negatives for Clippy, but now I think they may actually be fine. As per this issue, Rust is smart enough to mark futures holding locks as The other way to get a deadlock is described by this comment on that same Rust issue: when the thread holding the lock is re-purposed to run another task/future which tries to obtain the lock. According to std::mutex::Mutex this attempt to obtain the lock from the thread that already holds it will panic (or deadlock?). I think we're safe from this however due to |
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!
bors r+
## Issue Addressed This fixes the low-hanging Clippy lints introduced in Rust 1.61 (due any hour now). It _ignores_ one lint, because fixing it requires a structural refactor of the validator client that needs to be done delicately. I've started on that refactor and will create another PR that can be reviewed in more depth in the coming days. I think we should merge this PR in the meantime to unblock CI.
Build failed (retrying...): |
## Issue Addressed This fixes the low-hanging Clippy lints introduced in Rust 1.61 (due any hour now). It _ignores_ one lint, because fixing it requires a structural refactor of the validator client that needs to be done delicately. I've started on that refactor and will create another PR that can be reviewed in more depth in the coming days. I think we should merge this PR in the meantime to unblock CI.
Build failed (retrying...): |
bors r- gotta fix udeps |
Canceled. |
bors r+ |
## Issue Addressed This fixes the low-hanging Clippy lints introduced in Rust 1.61 (due any hour now). It _ignores_ one lint, because fixing it requires a structural refactor of the validator client that needs to be done delicately. I've started on that refactor and will create another PR that can be reviewed in more depth in the coming days. I think we should merge this PR in the meantime to unblock CI.
Issue Addressed
This fixes the low-hanging Clippy lints introduced in Rust 1.61 (due any hour now). It ignores one lint, because fixing it requires a structural refactor of the validator client that needs to be done delicately. I've started on that refactor and will create another PR that can be reviewed in more depth in the coming days. I think we should merge this PR in the meantime to unblock CI.