Comparative Analysis: debug_executionWitness Latency
This document presents the results of measurements conducted to analyze the latency improvements of the debug_executionWitness RPC method across different configurations.
note
All measurements were obtained using an RPC node running on the same machine, avoiding network-related latency.
Each configuration was measured over a different block range at different points in time. While block characteristics vary, the sample sizes are large enough to provide meaningful comparisons.
Configurations
- Pre-Serialized (added in PR #5956): Execution witnesses are generated during payload execution, converted to
RpcExecutionWitness, and stored as pre-serialized JSON bytes in the database. On read, the bytes are parsed directly toserde_json::Valuewithout any additional traversal or serialization. - Pre-Generated: Execution witnesses are generated during payload execution and stored in the database (but require
encode_subtrie()traversal and serialization on each read). - On-Demand: Execution witnesses are generated when calling
debug_executionWitness.
Measurements
| Metric | Pre-Serialized | Pre-Generated | On-Demand |
|---|---|---|---|
| Total Blocks Analyzed | 199 | 176 | 176 |
| Min Time | 6 ms | 3 ms | 56 ms |
| Max Time | 268 ms | 255 ms | 521 ms |
| Average Time | 94 ms | 131 ms | 242 ms |
| Median Time | 91 ms | 130 ms | 224 ms |
| Block Range | 24335714 – 24335912 | 24191178 – 24191353 | 24190748 – 24190923 |
Conclusions
Pre-Serialized vs On-Demand
The average latency drops from 242 ms (on-demand) to 94 ms (pre-serialized), representing an improvement of approximately 61%. Median latency shows a similar improvement, decreasing from 224 ms to 91 ms.
Pre-Serialized vs Pre-Generated
The average latency drops from 131 ms (pre-generated) to 94 ms (pre-serialized), representing an additional improvement of approximately 28%. This improvement comes from eliminating the encode_subtrie() depth-first traversal that was previously performed on every read to convert ExecutionWitness to RpcExecutionWitness.
Pre-Generated vs On-Demand
The average latency drops from 242 ms (on-demand) to 131 ms (pre-generated), representing an improvement of approximately 46%. Median latency shows a similar improvement, decreasing from 224 ms to 130 ms.
Overall
Pre-serialized execution witnesses exhibit the tightest latency distribution. On-demand requests frequently experience high-latency spikes due to witness generation at request time. Pre-generating and pre-serializing execution witnesses during payload execution effectively eliminates most of these spikes and results in more predictable response times.
How These Measurements Were Done
These metrics were obtained from an ethrex node synced to the Ethereum mainnet.
Each configuration was measured over a contiguous range of blocks, and latency was recorded for each request.
How to Get Metrics
-
Ensure the node is synced.
Use the--precompute-witnessesflag to generate and store execution witnesses upon receiving anewPayloadmessage. -
Enable debug logging for
ethrex-replayby editingsrc/main.rs:21:add_directive(Directive::from(tracing::Level::DEBUG)) -
Run
ethrex-replayusing the--endlessflag:cargo run -r -- blocks --endless --rpc-url [RPC_URL] -
Filter logs to capture execution witness latency:
cargo run -r -- blocks --endless --rpc-url [RPC_URL] 2>&1 | grep --line-buffered 'Got execution witness for block' | tee execution_witness_times.txt -
Post-process the captured measurements to compute min, max, average, and median latencies.
Appendix
Full Measurement Data
Pre-Serialized
Total blocks analyzed: 199
| Block Number | Time (ms) |
|---|---|
| 24335714 | 110 |
| 24335715 | 87 |
| 24335716 | 97 |
| 24335717 | 71 |
| 24335718 | 62 |
| 24335719 | 105 |
| 24335720 | 62 |
| 24335721 | 72 |
| 24335722 | 33 |
| 24335723 | 98 |
| 24335724 | 95 |
| 24335725 | 139 |
| 24335726 | 61 |
| 24335727 | 88 |
| 24335728 | 81 |
| 24335729 | 97 |
| 24335730 | 73 |
| 24335731 | 126 |
| 24335732 | 112 |
| 24335733 | 120 |
| 24335734 | 66 |
| 24335735 | 106 |
| 24335736 | 87 |
| 24335737 | 97 |
| 24335738 | 161 |
| 24335739 | 27 |
| 24335740 | 114 |
| 24335741 | 85 |
| 24335742 | 133 |
| 24335743 | 36 |
| 24335744 | 164 |
| 24335745 | 129 |
| 24335746 | 44 |
| 24335747 | 46 |
| 24335748 | 36 |
| 24335749 | 141 |
| 24335750 | 145 |
| 24335751 | 119 |
| 24335752 | 112 |
| 24335753 | 78 |
| 24335754 | 82 |
| 24335755 | 142 |
| 24335756 | 21 |
| 24335757 | 131 |
| 24335758 | 99 |
| 24335759 | 77 |
| 24335760 | 107 |
| 24335761 | 97 |
| 24335762 | 132 |
| 24335763 | 78 |
| 24335764 | 83 |
| 24335765 | 48 |
| 24335766 | 131 |
| 24335767 | 83 |
| 24335768 | 60 |
| 24335769 | 59 |
| 24335770 | 147 |
| 24335771 | 75 |
| 24335772 | 70 |
| 24335773 | 146 |
| 24335774 | 78 |
| 24335775 | 104 |
| 24335776 | 94 |
| 24335777 | 97 |
| 24335778 | 106 |
| 24335779 | 91 |
| 24335780 | 57 |
| 24335781 | 60 |
| 24335782 | 186 |
| 24335783 | 122 |
| 24335784 | 53 |
| 24335785 | 143 |
| 24335786 | 79 |
| 24335787 | 83 |
| 24335788 | 100 |
| 24335789 | 68 |
| 24335790 | 114 |
| 24335791 | 64 |
| 24335792 | 102 |
| 24335793 | 132 |
| 24335794 | 67 |
| 24335795 | 111 |
| 24335796 | 73 |
| 24335797 | 96 |
| 24335798 | 77 |
| 24335799 | 38 |
| 24335800 | 171 |
| 24335801 | 140 |
| 24335802 | 78 |
| 24335803 | 105 |
| 24335804 | 75 |
| 24335805 | 107 |
| 24335806 | 84 |
| 24335807 | 78 |
| 24335808 | 39 |
| 24335809 | 107 |
| 24335810 | 108 |
| 24335811 | 146 |
| 24335812 | 82 |
| 24335813 | 118 |
| 24335814 | 87 |
| 24335815 | 86 |
| 24335816 | 82 |
| 24335817 | 97 |
| 24335818 | 106 |
| 24335819 | 31 |
| 24335820 | 158 |
| 24335821 | 86 |
| 24335822 | 71 |
| 24335823 | 77 |
| 24335824 | 73 |
| 24335825 | 113 |
| 24335826 | 41 |
| 24335827 | 137 |
| 24335828 | 92 |
| 24335829 | 81 |
| 24335830 | 100 |
| 24335831 | 119 |
| 24335832 | 80 |
| 24335833 | 85 |
| 24335834 | 6 |
| 24335835 | 45 |
| 24335836 | 171 |
| 24335837 | 134 |
| 24335838 | 268 |
| 24335839 | 79 |
| 24335840 | 169 |
| 24335841 | 158 |
| 24335842 | 23 |
| 24335843 | 164 |
| 24335844 | 97 |
| 24335845 | 104 |
| 24335846 | 93 |
| 24335847 | 19 |
| 24335848 | 119 |
| 24335849 | 78 |
| 24335850 | 121 |
| 24335851 | 79 |
| 24335852 | 138 |
| 24335853 | 74 |
| 24335854 | 92 |
| 24335855 | 106 |
| 24335856 | 82 |
| 24335857 | 83 |
| 24335858 | 74 |
| 24335859 | 77 |
| 24335860 | 41 |
| 24335861 | 91 |
| 24335862 | 17 |
| 24335863 | 91 |
| 24335864 | 118 |
| 24335865 | 109 |
| 24335866 | 85 |
| 24335867 | 84 |
| 24335868 | 74 |
| 24335869 | 73 |
| 24335870 | 90 |
| 24335871 | 102 |
| 24335872 | 85 |
| 24335873 | 109 |
| 24335874 | 42 |
| 24335875 | 72 |
| 24335876 | 130 |
| 24335877 | 67 |
| 24335878 | 109 |
| 24335879 | 102 |
| 24335880 | 75 |
| 24335881 | 120 |
| 24335882 | 74 |
| 24335883 | 85 |
| 24335884 | 82 |
| 24335885 | 94 |
| 24335886 | 95 |
| 24335887 | 57 |
| 24335888 | 108 |
| 24335889 | 41 |
| 24335890 | 131 |
| 24335891 | 156 |
| 24335892 | 105 |
| 24335893 | 119 |
| 24335894 | 91 |
| 24335895 | 64 |
| 24335896 | 139 |
| 24335897 | 144 |
| 24335898 | 86 |
| 24335899 | 40 |
| 24335900 | 52 |
| 24335901 | 180 |
| 24335902 | 121 |
| 24335903 | 42 |
| 24335904 | 66 |
| 24335905 | 70 |
| 24335906 | 92 |
| 24335907 | 104 |
| 24335908 | 82 |
| 24335909 | 85 |
| 24335910 | 78 |
| 24335911 | 97 |
| 24335912 | 86 |
Pre-Generated
Total blocks analyzed: 176
| Block Number | Time (ms) |
|---|---|
| 24191178 | 103 |
| 24191179 | 156 |
| 24191180 | 61 |
| 24191181 | 127 |
| 24191182 | 103 |
| 24191183 | 126 |
| 24191184 | 132 |
| 24191185 | 106 |
| 24191186 | 97 |
| 24191187 | 136 |
| 24191188 | 64 |
| 24191189 | 212 |
| 24191190 | 50 |
| 24191191 | 167 |
| 24191192 | 132 |
| 24191193 | 131 |
| 24191194 | 97 |
| 24191195 | 124 |
| 24191196 | 99 |
| 24191197 | 99 |
| 24191198 | 113 |
| 24191199 | 104 |
| 24191200 | 113 |
| 24191201 | 135 |
| 24191202 | 157 |
| 24191203 | 120 |
| 24191204 | 120 |
| 24191205 | 131 |
| 24191206 | 186 |
| 24191207 | 116 |
| 24191208 | 108 |
| 24191209 | 44 |
| 24191210 | 181 |
| 24191211 | 119 |
| 24191212 | 114 |
| 24191213 | 111 |
| 24191214 | 135 |
| 24191215 | 167 |
| 24191216 | 61 |
| 24191217 | 155 |
| 24191218 | 131 |
| 24191219 | 143 |
| 24191220 | 4 |
| 24191221 | 139 |
| 24191222 | 66 |
| 24191223 | 246 |
| 24191224 | 194 |
| 24191225 | 111 |
| 24191226 | 153 |
| 24191227 | 30 |
| 24191228 | 136 |
| 24191229 | 152 |
| 24191230 | 112 |
| 24191231 | 124 |
| 24191232 | 123 |
| 24191233 | 116 |
| 24191234 | 71 |
| 24191235 | 187 |
| 24191236 | 89 |
| 24191237 | 226 |
| 24191238 | 145 |
| 24191239 | 130 |
| 24191240 | 120 |
| 24191241 | 189 |
| 24191242 | 3 |
| 24191243 | 197 |
| 24191244 | 117 |
| 24191245 | 142 |
| 24191246 | 144 |
| 24191247 | 143 |
| 24191248 | 166 |
| 24191249 | 106 |
| 24191250 | 35 |
| 24191251 | 236 |
| 24191252 | 141 |
| 24191253 | 121 |
| 24191254 | 109 |
| 24191255 | 165 |
| 24191256 | 125 |
| 24191257 | 128 |
| 24191258 | 130 |
| 24191259 | 89 |
| 24191260 | 126 |
| 24191261 | 124 |
| 24191262 | 118 |
| 24191263 | 147 |
| 24191264 | 108 |
| 24191265 | 136 |
| 24191266 | 159 |
| 24191267 | 98 |
| 24191268 | 157 |
| 24191269 | 98 |
| 24191270 | 100 |
| 24191271 | 145 |
| 24191272 | 119 |
| 24191273 | 150 |
| 24191274 | 119 |
| 24191275 | 107 |
| 24191276 | 127 |
| 24191277 | 41 |
| 24191278 | 236 |
| 24191279 | 147 |
| 24191280 | 86 |
| 24191281 | 205 |
| 24191282 | 117 |
| 24191283 | 172 |
| 24191284 | 122 |
| 24191285 | 39 |
| 24191286 | 177 |
| 24191287 | 143 |
| 24191288 | 118 |
| 24191289 | 115 |
| 24191290 | 146 |
| 24191291 | 115 |
| 24191292 | 173 |
| 24191293 | 143 |
| 24191294 | 118 |
| 24191295 | 86 |
| 24191296 | 159 |
| 24191297 | 133 |
| 24191298 | 154 |
| 24191299 | 132 |
| 24191300 | 118 |
| 24191301 | 141 |
| 24191302 | 111 |
| 24191303 | 179 |
| 24191304 | 86 |
| 24191305 | 37 |
| 24191306 | 171 |
| 24191307 | 255 |
| 24191308 | 211 |
| 24191309 | 138 |
| 24191310 | 133 |
| 24191311 | 173 |
| 24191312 | 153 |
| 24191313 | 109 |
| 24191314 | 135 |
| 24191315 | 181 |
| 24191316 | 128 |
| 24191317 | 85 |
| 24191318 | 126 |
| 24191319 | 121 |
| 24191320 | 83 |
| 24191321 | 214 |
| 24191322 | 197 |
| 24191323 | 180 |
| 24191324 | 141 |
| 24191325 | 160 |
| 24191326 | 128 |
| 24191327 | 86 |
| 24191328 | 181 |
| 24191329 | 158 |
| 24191330 | 84 |
| 24191331 | 178 |
| 24191332 | 134 |
| 24191333 | 117 |
| 24191334 | 128 |
| 24191335 | 152 |
| 24191336 | 139 |
| 24191337 | 136 |
| 24191338 | 170 |
| 24191339 | 131 |
| 24191340 | 136 |
| 24191341 | 181 |
| 24191342 | 126 |
| 24191343 | 123 |
| 24191344 | 168 |
| 24191345 | 68 |
| 24191346 | 42 |
| 24191347 | 249 |
| 24191348 | 172 |
| 24191349 | 178 |
| 24191350 | 127 |
| 24191351 | 150 |
| 24191352 | 138 |
| 24191353 | 32 |
On-Demand
Total blocks analyzed: 176
| Block Number | Time (ms) |
|---|---|
| 24190748 | 228 |
| 24190749 | 286 |
| 24190750 | 308 |
| 24190751 | 290 |
| 24190752 | 272 |
| 24190753 | 334 |
| 24190754 | 208 |
| 24190755 | 189 |
| 24190756 | 118 |
| 24190757 | 367 |
| 24190758 | 128 |
| 24190759 | 411 |
| 24190760 | 226 |
| 24190761 | 179 |
| 24190762 | 451 |
| 24190763 | 489 |
| 24190764 | 350 |
| 24190765 | 254 |
| 24190766 | 304 |
| 24190767 | 220 |
| 24190768 | 154 |
| 24190769 | 521 |
| 24190770 | 56 |
| 24190771 | 311 |
| 24190772 | 436 |
| 24190773 | 226 |
| 24190774 | 235 |
| 24190775 | 216 |
| 24190776 | 222 |
| 24190777 | 259 |
| 24190778 | 165 |
| 24190779 | 232 |
| 24190780 | 197 |
| 24190781 | 206 |
| 24190782 | 424 |
| 24190783 | 209 |
| 24190784 | 232 |
| 24190785 | 213 |
| 24190786 | 262 |
| 24190787 | 190 |
| 24190788 | 233 |
| 24190789 | 206 |
| 24190790 | 178 |
| 24190791 | 277 |
| 24190792 | 167 |
| 24190793 | 329 |
| 24190794 | 408 |
| 24190795 | 368 |
| 24190796 | 160 |
| 24190797 | 221 |
| 24190798 | 208 |
| 24190799 | 296 |
| 24190800 | 256 |
| 24190801 | 222 |
| 24190802 | 131 |
| 24190803 | 318 |
| 24190804 | 270 |
| 24190805 | 179 |
| 24190806 | 220 |
| 24190807 | 201 |
| 24190808 | 205 |
| 24190809 | 279 |
| 24190810 | 252 |
| 24190811 | 140 |
| 24190812 | 378 |
| 24190813 | 221 |
| 24190814 | 325 |
| 24190815 | 241 |
| 24190816 | 186 |
| 24190817 | 193 |
| 24190818 | 174 |
| 24190819 | 327 |
| 24190820 | 210 |
| 24190821 | 208 |
| 24190822 | 195 |
| 24190823 | 244 |
| 24190824 | 80 |
| 24190825 | 128 |
| 24190826 | 363 |
| 24190827 | 231 |
| 24190828 | 286 |
| 24190829 | 368 |
| 24190830 | 198 |
| 24190831 | 293 |
| 24190832 | 275 |
| 24190833 | 309 |
| 24190834 | 219 |
| 24190835 | 91 |
| 24190836 | 319 |
| 24190837 | 269 |
| 24190838 | 292 |
| 24190839 | 193 |
| 24190840 | 203 |
| 24190841 | 188 |
| 24190842 | 124 |
| 24190843 | 305 |
| 24190844 | 236 |
| 24190845 | 179 |
| 24190846 | 148 |
| 24190847 | 280 |
| 24190848 | 208 |
| 24190849 | 265 |
| 24190850 | 197 |
| 24190851 | 225 |
| 24190852 | 266 |
| 24190853 | 181 |
| 24190854 | 225 |
| 24190855 | 256 |
| 24190856 | 216 |
| 24190857 | 374 |
| 24190858 | 225 |
| 24190859 | 296 |
| 24190860 | 175 |
| 24190861 | 171 |
| 24190862 | 406 |
| 24190863 | 236 |
| 24190864 | 196 |
| 24190865 | 184 |
| 24190866 | 265 |
| 24190867 | 172 |
| 24190868 | 123 |
| 24190869 | 470 |
| 24190870 | 184 |
| 24190871 | 244 |
| 24190872 | 172 |
| 24190873 | 99 |
| 24190874 | 387 |
| 24190875 | 209 |
| 24190876 | 207 |
| 24190877 | 133 |
| 24190878 | 161 |
| 24190879 | 223 |
| 24190880 | 217 |
| 24190881 | 234 |
| 24190882 | 261 |
| 24190883 | 203 |
| 24190884 | 234 |
| 24190885 | 263 |
| 24190886 | 193 |
| 24190887 | 211 |
| 24190888 | 168 |
| 24190889 | 344 |
| 24190890 | 88 |
| 24190891 | 399 |
| 24190892 | 191 |
| 24190893 | 244 |
| 24190894 | 140 |
| 24190895 | 195 |
| 24190896 | 275 |
| 24190897 | 121 |
| 24190898 | 462 |
| 24190899 | 291 |
| 24190900 | 192 |
| 24190901 | 183 |
| 24190902 | 268 |
| 24190903 | 294 |
| 24190904 | 277 |
| 24190905 | 271 |
| 24190906 | 190 |
| 24190907 | 222 |
| 24190908 | 109 |
| 24190909 | 335 |
| 24190910 | 252 |
| 24190911 | 91 |
| 24190912 | 143 |
| 24190913 | 414 |
| 24190914 | 73 |
| 24190915 | 457 |
| 24190916 | 93 |
| 24190917 | 148 |
| 24190918 | 479 |
| 24190919 | 156 |
| 24190920 | 80 |
| 24190921 | 421 |
| 24190922 | 411 |
| 24190923 | 220 |