Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions runner/clients/baserethnode/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,38 @@ func (r *metricsCollector) GetMetrics() []metrics.BlockMetrics {

func (r *metricsCollector) GetMetricTypes() map[string]bool {
return map[string]bool{
"reth_sync_execution_execution_duration": true,
"reth_sync_block_validation_state_root_duration": true,
"reth_sync_state_provider_storage_fetch_latency": true,
"reth_sync_state_provider_account_fetch_latency": true,
"reth_sync_state_provider_code_fetch_latency": true,
"reth_sync_state_provider_total_storage_fetch_latency": true,
"reth_sync_state_provider_total_account_fetch_latency": true,
"reth_sync_state_provider_total_code_fetch_latency": true,
"reth_sync_execution_execution_duration": true,
"reth_sync_block_validation_state_root_duration": true,
"reth_sync_state_provider_storage_fetch_latency": true,
"reth_sync_state_provider_account_fetch_latency": true,
"reth_sync_state_provider_code_fetch_latency": true,
"reth_sync_state_provider_total_storage_fetch_latency": true,
"reth_sync_state_provider_total_account_fetch_latency": true,
"reth_sync_state_provider_total_code_fetch_latency": true,
"reth_flashblocks_upstream_errors": true,
"reth_flashblocks_upstream_messages": true,
"reth_flashblocks_block_processing_duration": true,
"reth_flashblocks_sender_recovery_duration": true,
"reth_flashblocks_unexpected_block_order": true,
"reth_flashblocks_flashblocks_in_block": true,
"reth_flashblocks_block_processing_error": true,
"reth_flashblocks_pending_clear_catchup": true,
"reth_flashblocks_pending_clear_reorg": true,
"reth_flashblocks_pending_snapshot_fb_index": true,
"reth_flashblocks_pending_snapshot_height": true,
"reth_flashblocks_reconnect_attempts": true,
"reth_flashblocks_rpc_get_transaction_count": true,
"reth_flashblocks_rpc_get_transaction_receipt": true,
"reth_flashblocks_rpc_get_transaction_by_hash": true,
"reth_flashblocks_rpc_get_balance": true,
"reth_flashblocks_rpc_get_block_by_number": true,
"reth_flashblocks_rpc_call": true,
"reth_flashblocks_rpc_estimate_gas": true,
"reth_flashblocks_rpc_simulate_v1": true,
"reth_flashblocks_rpc_get_logs": true,
"reth_flashblocks_rpc_get_block_transaction_count_by_number": true,
"reth_flashblocks_bundle_state_clone_duration": true,
"reth_flashblocks_bundle_state_clone_size": true,
}
}

Expand Down
40 changes: 32 additions & 8 deletions runner/clients/reth/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,38 @@ func (r *metricsCollector) GetMetrics() []metrics.BlockMetrics {

func (r *metricsCollector) GetMetricTypes() map[string]bool {
return map[string]bool{
"reth_sync_execution_execution_duration": true,
"reth_sync_block_validation_state_root_duration": true,
"reth_sync_state_provider_storage_fetch_latency": true,
"reth_sync_state_provider_account_fetch_latency": true,
"reth_sync_state_provider_code_fetch_latency": true,
"reth_sync_state_provider_total_storage_fetch_latency": true,
"reth_sync_state_provider_total_account_fetch_latency": true,
"reth_sync_state_provider_total_code_fetch_latency": true,
"reth_sync_execution_execution_duration": true,
"reth_sync_block_validation_state_root_duration": true,
"reth_sync_state_provider_storage_fetch_latency": true,
"reth_sync_state_provider_account_fetch_latency": true,
"reth_sync_state_provider_code_fetch_latency": true,
"reth_sync_state_provider_total_storage_fetch_latency": true,
"reth_sync_state_provider_total_account_fetch_latency": true,
"reth_sync_state_provider_total_code_fetch_latency": true,
"reth_flashblocks_upstream_errors": true,
"reth_flashblocks_upstream_messages": true,
"reth_flashblocks_block_processing_duration": true,
"reth_flashblocks_sender_recovery_duration": true,
"reth_flashblocks_unexpected_block_order": true,
"reth_flashblocks_flashblocks_in_block": true,
"reth_flashblocks_block_processing_error": true,
"reth_flashblocks_pending_clear_catchup": true,
"reth_flashblocks_pending_clear_reorg": true,
"reth_flashblocks_pending_snapshot_fb_index": true,
"reth_flashblocks_pending_snapshot_height": true,
"reth_flashblocks_reconnect_attempts": true,
"reth_flashblocks_rpc_get_transaction_count": true,
"reth_flashblocks_rpc_get_transaction_receipt": true,
"reth_flashblocks_rpc_get_transaction_by_hash": true,
"reth_flashblocks_rpc_get_balance": true,
"reth_flashblocks_rpc_get_block_by_number": true,
"reth_flashblocks_rpc_call": true,
"reth_flashblocks_rpc_estimate_gas": true,
"reth_flashblocks_rpc_simulate_v1": true,
"reth_flashblocks_rpc_get_logs": true,
"reth_flashblocks_rpc_get_block_transaction_count_by_number": true,
"reth_flashblocks_bundle_state_clone_duration": true,
"reth_flashblocks_bundle_state_clone_size": true,
}
}

Expand Down
29 changes: 20 additions & 9 deletions runner/network/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,18 @@ func getAverage(metrics []metrics.BlockMetrics, metricName string) float64 {
}

const (
UpdateForkChoiceLatencyMetric = "latency/update_fork_choice"
NewPayloadLatencyMetric = "latency/new_payload"
GetPayloadLatencyMetric = "latency/get_payload"
SendTxsLatencyMetric = "latency/send_txs"
GasPerBlockMetric = "gas/per_block"
GasPerSecondMetric = "gas/per_second"
TransactionsPerBlockMetric = "transactions/per_block"
UpdateForkChoiceLatencyMetric = "latency/update_fork_choice"
NewPayloadLatencyMetric = "latency/new_payload"
GetPayloadLatencyMetric = "latency/get_payload"
SendTxsLatencyMetric = "latency/send_txs"
GasPerBlockMetric = "gas/per_block"
GasPerSecondMetric = "gas/per_second"
TransactionsPerBlockMetric = "transactions/per_block"
FlashblockProcessingDurationMetric = "reth_flashblocks_block_processing_duration"
FlashblockSenderRecoveryMetric = "reth_flashblocks_sender_recovery_duration"
FlashblocksInBlockMetric = "reth_flashblocks_flashblocks_in_block"
FlashblockUpstreamMessagesMetric = "reth_flashblocks_upstream_messages"
FlashblockBundleStateCloneDuration = "reth_flashblocks_bundle_state_clone_duration"
)

type SequencerKeyMetrics struct {
Expand All @@ -152,7 +157,9 @@ type SequencerKeyMetrics struct {

type ValidatorKeyMetrics struct {
CommonKeyMetrics
AverageNewPayloadLatency float64 `json:"newPayload"`
AverageNewPayloadLatency float64 `json:"newPayload"`
AverageFlashblockProcessingDuration float64 `json:"flashblockProcessingDuration,omitempty"`
AverageFlashblocksInBlock float64 `json:"flashblocksInBlock,omitempty"`
}

type CommonKeyMetrics struct {
Expand All @@ -163,9 +170,13 @@ type CommonKeyMetrics struct {
func BlockMetricsToValidatorSummary(metrics []metrics.BlockMetrics) *ValidatorKeyMetrics {
averageNewPayloadLatency := getAverage(metrics, NewPayloadLatencyMetric)
averageGasPerSecond := getAverage(metrics, GasPerSecondMetric)
averageFlashblockProcessingDuration := getAverage(metrics, FlashblockProcessingDurationMetric)
averageFlashblocksInBlock := getAverage(metrics, FlashblocksInBlockMetric)

return &ValidatorKeyMetrics{
AverageNewPayloadLatency: averageNewPayloadLatency,
AverageNewPayloadLatency: averageNewPayloadLatency,
AverageFlashblockProcessingDuration: averageFlashblockProcessingDuration,
AverageFlashblocksInBlock: averageFlashblocksInBlock,
CommonKeyMetrics: CommonKeyMetrics{
AverageGasPerSecond: averageGasPerSecond,
},
Expand Down