Skip to content

Conversation

akundaz
Copy link
Contributor

@akundaz akundaz commented Jun 13, 2025

πŸ“ Summary

Count the number of reverted bundles

πŸ’‘ Motivation and Context

We can get spammed by bad bundles so we should track this

Resolves #150


βœ… I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

@akundaz akundaz self-assigned this Jun 13, 2025
@akundaz
Copy link
Contributor Author

akundaz commented Jun 13, 2025

I wasn't sure if any instance in which eth_sendBundle fails counts as a revert but this change assumes it does. Let me know if a revert is more specific than that.

self.send_bundle_inner(bundle)
.await
.inspect(|_| self.metrics.bundles_received.increment(1))
.inspect_err(|_| self.metrics.bundles_reverted.increment(1))
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should do this in execute_best_transactions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But that function is executing transactions, not bundles. Where do we try to execute a bundle?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think bundle execution happens somewhere there too

Copy link
Collaborator

Choose a reason for hiding this comment

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

You could also check build_payload, I saw something related to bundles there

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 think I found the indicator -- there's a comment that if reverted_hashes.is_some() then the transaction comes from a bundle.

@akundaz akundaz force-pushed the ash-qqsnzlokowny branch from 97f2678 to 7f041a6 Compare June 13, 2025 17:05
@ferranbt ferranbt merged commit a1b9bb8 into main Jun 16, 2025
2 checks passed
@ferranbt ferranbt deleted the ash-qqsnzlokowny branch June 16, 2025 11:13
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.

Add metric to track bundle reverts

3 participants