Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve native tracers #227

Merged
merged 9 commits into from
Mar 29, 2022
Merged

Improve native tracers #227

merged 9 commits into from
Mar 29, 2022

Conversation

trinhdn97
Copy link
Contributor

@trinhdn97 trinhdn97 commented Mar 8, 2022

  • Implement native prestate tracer
  • Make native prestate and noop by default, mark corresponding JS tracers as legacy
  • Implement the native replayTracer to mimic parity debug_replayTransaction and BlockScout JS tracer here
  • Implement the INVALID opcode
  • Benchmark replayTracer vs BlockScout JS tracer
name                                 old time/op    new time/op    delta
Tracers/create-12                      5.06ms ± 5%    0.11ms ±15%  -97.89%  (p=0.000 n=10+10)
Tracers/create2-12                     6.59ms ± 2%    0.05ms ± 4%  -99.20%  (p=0.000 n=9+9)
Tracers/deepCalls-12                   50.5ms ± 2%     0.3ms ± 1%  -99.41%  (p=0.000 n=9+10)
Tracers/delegatecall-12                5.02ms ± 4%    0.04ms ± 1%  -99.27%  (p=0.000 n=10+10)
Tracers/innerCreateOogOuterThrow-12    3.59ms ± 3%    0.12ms ±24%  -96.66%  (p=0.000 n=10+10)
Tracers/innerInstafail-12               964µs ± 3%      11µs ± 7%  -98.82%  (p=0.000 n=10+10)
Tracers/innerThrowOuterRevert-12       5.56ms ± 2%    0.04ms ± 1%  -99.36%  (p=0.000 n=10+10)
Tracers/oog-12                         3.20ms ± 3%    0.02ms ± 0%  -99.27%  (p=0.000 n=10+9)
Tracers/revert-12                       455µs ± 4%      12µs ± 7%  -97.32%  (p=0.000 n=10+10)
Tracers/revertReason-12                1.58ms ± 3%    0.02ms ± 4%  -98.99%  (p=0.000 n=10+10)
Tracers/selfdestruct-12                84.1µs ± 1%    18.0µs ± 9%  -78.54%  (p=0.000 n=10+9)
Tracers/simple-12                      2.83ms ± 1%    0.02ms ± 3%  -99.24%  (p=0.000 n=10+10)
Tracers/throw-12                       1.34ms ± 2%    0.02ms ± 1%  -98.79%  (p=0.000 n=10+9)

name                                 old alloc/op   new alloc/op   delta
Tracers/create-12                       372kB ± 0%      84kB ± 0%  -77.41%  (p=0.000 n=10+10)
Tracers/create2-12                      461kB ± 0%      36kB ± 0%  -92.17%  (p=0.000 n=10+10)
Tracers/deepCalls-12                   3.16MB ± 0%    0.13MB ± 0%  -95.96%  (p=0.000 n=10+10)
Tracers/delegatecall-12                 329kB ± 0%      16kB ± 0%  -95.07%  (p=0.000 n=10+9)
Tracers/innerCreateOogOuterThrow-12     353kB ± 0%      96kB ± 0%  -72.81%  (p=0.000 n=10+10)
Tracers/innerInstafail-12              54.3kB ± 0%     7.2kB ± 0%  -86.77%  (p=0.000 n=10+8)
Tracers/innerThrowOuterRevert-12        381kB ± 0%      12kB ± 0%  -96.73%  (p=0.000 n=10+10)
Tracers/oog-12                          229kB ± 0%       9kB ± 0%  -96.05%  (p=0.000 n=10+10)
Tracers/revert-12                      35.3kB ± 0%     8.3kB ± 0%  -76.52%  (p=0.000 n=10+10)
Tracers/revertReason-12                 116kB ± 0%       9kB ± 0%  -92.36%  (p=0.000 n=10+8)
Tracers/selfdestruct-12                10.4kB ± 0%    12.8kB ± 0%  +22.62%  (p=0.000 n=8+9)
Tracers/simple-12                       188kB ± 0%      12kB ± 0%  -93.86%  (p=0.000 n=10+9)
Tracers/throw-12                       98.8kB ± 0%     7.7kB ± 0%  -92.21%  (p=0.000 n=10+8)

name                                 old allocs/op  new allocs/op  delta
Tracers/create-12                       36.1k ± 0%      0.2k ± 0%  -99.55%  (p=0.000 n=10+10)
Tracers/create2-12                      44.4k ± 0%      0.2k ± 0%  -99.61%  (p=0.000 n=10+10)
Tracers/deepCalls-12                     317k ± 0%        1k ± 0%  -99.59%  (p=0.002 n=8+10)
Tracers/delegatecall-12                 32.7k ± 0%      0.2k ± 0%  -99.47%  (p=0.000 n=10+10)
Tracers/innerCreateOogOuterThrow-12     25.3k ± 0%      0.2k ± 0%  -99.29%  (p=0.000 n=10+10)
Tracers/innerInstafail-12               5.08k ± 0%     0.09k ± 0%  -98.29%  (p=0.000 n=10+10)
Tracers/innerThrowOuterRevert-12        38.3k ± 0%      0.1k ± 0%  -99.64%  (p=0.000 n=10+10)
Tracers/oog-12                          22.9k ± 0%      0.1k ± 0%  -99.62%  (p=0.000 n=10+10)
Tracers/revert-12                       3.27k ± 0%     0.08k ± 0%  -97.46%  (p=0.000 n=10+10)
Tracers/revertReason-12                 11.4k ± 0%      0.1k ± 0%  -99.20%  (p=0.000 n=10+10)
Tracers/selfdestruct-12                   367 ± 0%       137 ± 0%  -62.67%  (p=0.000 n=10+10)
Tracers/simple-12                       18.7k ± 0%      0.1k ± 0%  -99.26%  (p=0.000 n=10+10)
Tracers/throw-12                        9.66k ± 0%     0.08k ± 0%  -99.16%  (p=0.000 n=10+10)

@trinhdn97 trinhdn97 changed the title Ft/native prestate tracer Improve native tracers Mar 29, 2022
@trinhdn97 trinhdn97 requested a review from lewtran March 29, 2022 06:29
@trinhdn97 trinhdn97 marked this pull request as ready for review March 29, 2022 06:29
@lewtran lewtran merged commit 73435fc into master Mar 29, 2022
@trinhdn97 trinhdn97 deleted the ft/native_prestate_tracer branch February 24, 2023 07:24
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.

2 participants