feat(metrics): Add labels to tx simulation metrics#492
Open
avalonche wants to merge 2 commits into
Open
Conversation
Contributor
|
Can you change source to differentiate backruns from bundles? Also, can you do the same thing for gas used? You can deprecate some metrics if you do this:
|
516a5ee to
35f35fc
Compare
akundaz
reviewed
May 9, 2026
| TxSource::Mempool => match tx_result { | ||
| TxResult::Revert => num_mempool_txs_simulated_revert += 1, | ||
| TxResult::Halt => num_mempool_txs_simulated_halt += 1, | ||
| TxResult::Success => { |
Contributor
There was a problem hiding this comment.
i think you can avoid the unreachable! invocations if you matched on TxResult instead of branching on result.is_success() above
| let mut num_txs_simulated_success = 0; | ||
| let mut num_txs_simulated_fail = 0; | ||
| let mut num_bundles_reverted = 0; | ||
| let mut num_mempool_txs_simulated_success = 0; |
Contributor
There was a problem hiding this comment.
just store all these in a hashmap or something so you just have one mutable variable for recording metrics. you wouldn't have so much repetitive code in set_payload_builder_metrics then either
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the unlabeled op_rbuilder_tx_simulation_duration histogram with a labeled version under the same metric name, so we can break
down per-tx EVM simulation latency along the dimensions that matter for tuning the builder hot path:
allowed-revert list)
Compatibility
The metric name is unchanged (op_rbuilder_tx_simulation_duration), but it now carries three labels.