-
Notifications
You must be signed in to change notification settings - Fork 159
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
Mpool fixes #2847
Mpool fixes #2847
Conversation
@@ -70,10 +73,17 @@ impl MsgSet { | |||
|
|||
/// Add a signed message to the `MsgSet`. Increase `next_sequence` if the | |||
/// message has a sequence greater than any existing message sequence. | |||
pub fn add(&mut self, m: SignedMessage) -> Result<(), Error> { | |||
pub fn add(&mut self, m: SignedMessage, untrusted: bool) -> Result<(), Error> { |
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.
What does untrusted
mean? And it looks like you always set it to false
.
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 did this for future endpoint (if we implement it). Right now we support only Filecoin.MpoolPushMessage
.
But it exists a counterpart untrusted one: Filecoin.MpoolPushUntrusted
for public gateways.
See lotus PR: filecoin-project/lotus#3915
Co-authored-by: David Himmelstrup <david.himmelstrup@chainsafe.io>
// sleep allows for async block to update mpool's cur_tipset | ||
tokio::time::sleep(Duration::new(2, 0)).await; |
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 highly dislike sleep
s in the tests.
- It makes them flaky, yielding failures when run on unexpectedly low-end (or busy) workers.
- It makes tests unnecessarily long. Say the update took 5ms - we are waiting for 2s for nothing.
Can you think of a mechanism that would at least partially mitigate those issues?
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. I don't like it as well and I'm looking for a way to remove those.
I've put 10ms while waiting for something better.
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've added a new method in Provider
so it's possible for TestApi
to use await
instead of sleep
.
Co-authored-by: Hubert <hubert@chainsafe.io>
Closing it because of merged in #2740. |
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes #2761
Other information and links
Change checklist