-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: deprecate tx & bundle polling tasks #22
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
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.
No showstoppers, approving to unblock 🔥
594a8ca
to
1803974
Compare
e38801f
to
a213722
Compare
src/tasks/block.rs
Outdated
select! { | ||
biased; | ||
_ = &mut sleep => { | ||
// Build a block | ||
let mut in_progress = InProgressBlock::default(); | ||
self.get_transactions(&mut in_progress).await; | ||
self.get_bundles(&mut in_progress).await; | ||
|
||
if !in_progress.is_empty() { |
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.
So, as far as I understand now, instead of spawning a loop that awaits 3 different futures concurrently, we now have a loop that:
- gets all txs
- gets all bundles
- builds the block
- sends it
- sleeps for X seconds
In this case we don't need the select!
at all anymore. We just need to loop like we already are and go through the steps.
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.
good shout ada0cd2
ada0cd2
to
4fde3cc
Compare
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.
cool!
self.get_bundles(&mut in_progress).await; | ||
|
||
// submit the block if it has transactions | ||
if !in_progress.is_empty() { |
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.
should we maybe log if we find there are no txs?
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 have this in next PR :)
self.get_transactions(&mut in_progress).await; | ||
self.get_bundles(&mut in_progress).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.
an interesting byproduct of this is that bundles will land end of block. nothing to do here now, but something we might wanna think about later
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 think any logic around ordering could be layered in later
No description provided.