Skip to content

Conversation

@edg-l
Copy link
Contributor

@edg-l edg-l commented Nov 21, 2025

Motivation

Basic integers like u64 used static_left_pad, that uses a temporary zeroed array, now they directly produce the integer. Did this by using decode_be_integer_u64, whose result can be casted to the relevant iX and decode_be_integer_u128, separate to avoid paying the cost of u128 always.

Modified decode_rlp_item so that it doesnt use usize::from_be_bytes(static_left_pad(x)), and instead uses a dedicated method parse_be_length which has less overhead.

Improved static_left_pad to not always zero init an array, and added the special case for data.len() == N to avoid a saturating sub.

Helps with #4956

@github-actions github-actions bot added L1 Ethereum client performance Block execution throughput and performance in general labels Nov 21, 2025
@github-actions
Copy link

github-actions bot commented Nov 21, 2025

Lines of code report

Total lines added: 77
Total lines removed: 0
Total lines changed: 77

Detailed view
+------------------------------------+-------+------+
| File                               | Lines | Diff |
+------------------------------------+-------+------+
| ethrex/crates/common/rlp/decode.rs | 730   | +77  |
+------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Nov 21, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 61.106 ± 0.182 60.893 61.440 1.01 ± 0.00
head 60.737 ± 0.210 60.463 60.981 1.00

@edg-l edg-l marked this pull request as ready for review November 24, 2025 11:07
@edg-l edg-l requested a review from a team as a code owner November 24, 2025 11:07
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client performance Block execution throughput and performance in general

Projects

Status: In Review
Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants