Skip to content

feat(builder): add RLP block size metrics#1866

Merged
shekhirin merged 2 commits intomainfrom
codex/implement-metric-for-rlp-size-in-block-builder
Jan 8, 2026
Merged

feat(builder): add RLP block size metrics#1866
shekhirin merged 2 commits intomainfrom
codex/implement-metric-for-rlp-size-in-block-builder

Conversation

@shekhirin
Copy link
Copy Markdown
Member

Motivation

  • Add visibility into the RLP-encoded size of built blocks so operators can monitor block size and investigate block-too-large or gas/rlp-related issues.
  • Provide both a histogram and a latest-value gauge to expose per-payload and last-payload RLP size in metrics dashboards.
  • Avoid duplicate work by computing the RLP length once and reusing it for the Osaka block size check and metric reporting.

Description

  • Added rlp_block_size_bytes (histogram) and rlp_block_size_bytes_last (gauge) to TempoPayloadBuilderMetrics in crates/payload/builder/src/metrics.rs.
  • Compute rlp_block_size_bytes = sealed_block.rlp_length() in crates/payload/builder/src/lib.rs and reuse it for the Osaka max-size check and error payload.
  • Record the new metrics with self.metrics.rlp_block_size_bytes.record(...) and self.metrics.rlp_block_size_bytes_last.set(...) right after payload finalization.

Testing

  • Ran cargo fmt, which completed successfully but emitted warnings about unstable rustfmt options.
  • No additional automated tests were executed as part of this change.

Codex Task

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
tempo-docs Ignored Ignored Preview Jan 6, 2026 1:21pm

@shekhirin shekhirin changed the title Add RLP block size metrics to payload builder feat(builder): add RLP block size metrics Jan 6, 2026
@shekhirin shekhirin marked this pull request as ready for review January 6, 2026 13:22
@shekhirin shekhirin added this pull request to the merge queue Jan 8, 2026
Merged via the queue into main with commit d675df6 Jan 8, 2026
17 checks passed
@shekhirin shekhirin deleted the codex/implement-metric-for-rlp-size-in-block-builder branch January 8, 2026 17:27
Zygimantass pushed a commit that referenced this pull request Jan 11, 2026
### Motivation
- Add visibility into the RLP-encoded size of built blocks so operators
can monitor block size and investigate block-too-large or
gas/rlp-related issues.
- Provide both a histogram and a latest-value gauge to expose
per-payload and last-payload RLP size in metrics dashboards.
- Avoid duplicate work by computing the RLP length once and reusing it
for the Osaka block size check and metric reporting.

### Description
- Added `rlp_block_size_bytes` (histogram) and
`rlp_block_size_bytes_last` (gauge) to `TempoPayloadBuilderMetrics` in
`crates/payload/builder/src/metrics.rs`.
- Compute `rlp_block_size_bytes = sealed_block.rlp_length()` in
`crates/payload/builder/src/lib.rs` and reuse it for the Osaka max-size
check and error payload.
- Record the new metrics with
`self.metrics.rlp_block_size_bytes.record(...)` and
`self.metrics.rlp_block_size_bytes_last.set(...)` right after payload
finalization.

### Testing
- Ran `cargo fmt`, which completed successfully but emitted warnings
about unstable rustfmt options.
- No additional automated tests were executed as part of this change.

------
[Codex
Task](https://chatgpt.com/codex/tasks/task_b_695cf977cc5c83219d1ea3383dcca640)
dankrad pushed a commit that referenced this pull request Jan 12, 2026
### Motivation
- Add visibility into the RLP-encoded size of built blocks so operators
can monitor block size and investigate block-too-large or
gas/rlp-related issues.
- Provide both a histogram and a latest-value gauge to expose
per-payload and last-payload RLP size in metrics dashboards.
- Avoid duplicate work by computing the RLP length once and reusing it
for the Osaka block size check and metric reporting.

### Description
- Added `rlp_block_size_bytes` (histogram) and
`rlp_block_size_bytes_last` (gauge) to `TempoPayloadBuilderMetrics` in
`crates/payload/builder/src/metrics.rs`.
- Compute `rlp_block_size_bytes = sealed_block.rlp_length()` in
`crates/payload/builder/src/lib.rs` and reuse it for the Osaka max-size
check and error payload.
- Record the new metrics with
`self.metrics.rlp_block_size_bytes.record(...)` and
`self.metrics.rlp_block_size_bytes_last.set(...)` right after payload
finalization.

### Testing
- Ran `cargo fmt`, which completed successfully but emitted warnings
about unstable rustfmt options.
- No additional automated tests were executed as part of this change.

------
[Codex
Task](https://chatgpt.com/codex/tasks/task_b_695cf977cc5c83219d1ea3383dcca640)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants