Skip to content

perf(mpt): specialize common witness RLP forms - #664

Closed
Qumeric wants to merge 1 commit into
valery/mpt-nonzero-childrenfrom
codex/mpt-witness-rlp-forms
Closed

perf(mpt): specialize common witness RLP forms#664
Qumeric wants to merge 1 commit into
valery/mpt-nonzero-childrenfrom
codex/mpt-witness-rlp-forms

Conversation

@Qumeric

@Qumeric Qumeric commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Stacked on #658.

Specialize the dominant MPT witness encodings during decoding: empty branch-child references and fixed 32-byte unresolved digest nodes. The shared RLP-item helper also removes repeated header bookkeeping across leaf, extension, and branch decoding, while uncommon encodings continue through the generic alloy_rlp decoder.

A digest-root round-trip test covers the fixed unresolved-node representation.

Benchmark results

Block 24001988, RVR execution, comparing the #658 baseline 29744549529 with the RLP-only run 29811228788:

metric #658 this PR delta
execute_metered_insns 651,377,749 644,085,446 −7,292,303 (−1.12%)
metered_rows_unpadded 934,824,479 927,550,243 −7,274,236 (−0.78%)
metered_main_cells_unpadded 47,673,439,230 47,415,274,554 −258,164,676 (−0.54%)
metered_interaction_cells_unpadded 14,613,892,025 14,470,176,137 −143,715,888 (−0.98%)

Block 24003902

RVR execution: #658, this PR.

metric #658 this PR delta
execute_metered_insns 513,794,871 512,092,682 −1,702,189 (−0.33%)
metered_rows_unpadded 694,528,733 692,838,316 −1,690,417 (−0.24%)
metered_main_cells_unpadded 30,209,487,536 30,149,424,975 −60,062,561 (−0.20%)
metered_interaction_cells_unpadded 12,028,309,965 11,994,791,134 −33,518,831 (−0.28%)
metered_memory_unpadded_bytes 575,999,821,960 575,266,433,578 −733,388,382 (−0.13%)
memory-triggered segment cuts 51 51 0

@Qumeric

Qumeric commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Collapsed into #684 together with the other two RLP PRs. They were one idea split across three stacked PRs; #684 carries the union plus an rlp module and differential tests against alloy_rlp.

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.

1 participant