Skip to content

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

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

anna-carroll
Copy link
Contributor

No description provided.

@anna-carroll anna-carroll self-assigned this Dec 5, 2024
@dylanlott dylanlott added the enhancement New feature or request label Dec 6, 2024 — with Graphite App
Copy link
Contributor

@dylanlott dylanlott left a 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 🔥

Comment on lines 168 to 176
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() {
Copy link
Member

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:

  1. gets all txs
  2. gets all bundles
  3. builds the block
  4. sends it
  5. 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good shout ada0cd2

Base automatically changed from anna/delete-server to main December 6, 2024 18:25
Copy link
Member

@Evalir Evalir left a 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() {
Copy link
Member

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?

Copy link
Contributor Author

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 :)

Comment on lines +170 to +171
self.get_transactions(&mut in_progress).await;
self.get_bundles(&mut in_progress).await;
Copy link
Member

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

Copy link
Contributor Author

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

@anna-carroll anna-carroll merged commit 89c8d50 into main Dec 6, 2024
4 checks passed
@anna-carroll anna-carroll deleted the anna/rm-poll-tasks branch December 6, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants