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

core/vm: Simplify error handling in interpreter loop #23952

Merged
merged 5 commits into from Nov 29, 2021

Conversation

chfast
Copy link
Contributor

@chfast chfast commented Nov 22, 2021

This simplifies interpreter loop exit condition to just err != nil. This catches:

  • reverting instructions (i.e. just REVERT),
  • halting instructions (by them returning errStopToken).

Also operation.jumps check is removed by setting pc - 1 inside the jump instruction and doing pc++ in the loop unconditionally.

Finally, instructions manipulating return data are handling this themselves. This eliminates another operation.returns check.

@chfast
Copy link
Contributor Author

chfast commented Nov 22, 2021

evmone benchmark suite with go 1.16 (obsolete).

name                                  old time/op  new time/op  delta                                                                                                                                                             
micro/memory_grow_mload/nogrow         295µs ± 0%   280µs ± 1%   -5.08%  (p=0.000 n=9+10)                                                                                                                                         
micro/memory_grow_mload/by1            303µs ± 1%   288µs ± 1%   -4.80%  (p=0.000 n=10+9)                                                                                                                                         
micro/memory_grow_mload/by16           370µs ± 1%   355µs ± 0%   -4.14%  (p=0.000 n=10+10)                                                                                                                                        
micro/memory_grow_mload/by32           451µs ± 0%   436µs ± 0%   -3.22%  (p=0.000 n=9+9)                                                                                                                                          
micro/signextend/zero                  434µs ± 1%   420µs ± 0%   -3.12%  (p=0.000 n=10+9)                                                                                                                                         
micro/signextend/one                   443µs ± 1%   432µs ± 0%   -2.40%  (p=0.000 n=10+10)                                                                                                                                        
micro/jumpdests_0xffff/empty          3.44µs ± 1%  3.45µs ± 1%   +0.34%  (p=0.015 n=10+9)                                                                                                                                         
micro/loop_with_many_jumpdests/empty  3.59µs ± 1%  3.59µs ± 1%     ~     (p=0.713 n=8+10)                                                                                                                                         
micro/jump_around/empty                182µs ± 0%   175µs ± 0%   -4.04%  (p=0.000 n=9+9)                                                                                                                                          
micro/memory_grow_mstore/nogrow        530µs ± 0%   518µs ± 1%   -2.42%  (p=0.000 n=10+9)                                                                                                                                         
micro/memory_grow_mstore/by1           540µs ± 1%   528µs ± 0%   -2.34%  (p=0.000 n=9+8)                                                                                                                                          
micro/memory_grow_mstore/by16          624µs ± 0%   612µs ± 0%   -2.03%  (p=0.000 n=9+10)                                                                                                                                         
micro/memory_grow_mstore/by32          694µs ± 1%   681µs ± 1%   -1.91%  (p=0.000 n=9+10)                                                                                                                                         
micro/JUMPDEST_n0/empty               4.10ms ± 1%  3.52ms ± 0%  -14.28%  (p=0.000 n=10+9)                                                                                                                                         
main/sha1_divs/empty                   219µs ± 0%   208µs ± 0%   -4.92%  (p=0.000 n=8+10)                                                                                                                                         
main/sha1_divs/1351                   4.44ms ± 0%  4.23ms ± 1%   -4.70%  (p=0.000 n=10+10)
main/sha1_divs/2737                   8.64ms ± 0%  8.22ms ± 0%   -4.84%  (p=0.000 n=9+10)
main/sha1_divs/5311                   16.9ms ± 0%  16.1ms ± 0%   -5.02%  (p=0.000 n=10+9)
main/weierstrudel/0                    494µs ± 0%   481µs ± 0%   -2.66%  (p=0.000 n=9+10)
main/weierstrudel/1                   1.05ms ± 0%  1.01ms ± 0%   -3.35%  (p=0.000 n=10+10)
main/weierstrudel/3                   1.64ms ± 1%  1.59ms ± 0%   -3.49%  (p=0.000 n=10+9)
main/weierstrudel/9                   3.42ms ± 1%  3.31ms ± 0%   -3.28%  (p=0.000 n=10+10)
main/weierstrudel/14                  4.90ms ± 0%  4.74ms ± 0%   -3.22%  (p=0.000 n=9+10)
main/sha1_shifts/empty                 177µs ± 1%   170µs ± 0%   -3.69%  (p=0.000 n=10+6)
main/sha1_shifts/1351                 3.61ms ± 1%  3.50ms ± 0%   -3.11%  (p=0.000 n=10+10)
main/sha1_shifts/2737                 7.03ms ± 0%  6.82ms ± 1%   -2.97%  (p=0.000 n=9+10)
main/sha1_shifts/5311                 13.7ms ± 1%  13.3ms ± 0%   -3.08%  (p=0.000 n=10+10)
main/blake2b_huff/empty                111µs ± 1%   109µs ± 1%   -2.52%  (p=0.000 n=10+10)
main/blake2b_huff/2805nulls           2.14ms ± 0%  2.09ms ± 1%   -2.65%  (p=0.000 n=10+10)
main/blake2b_huff/5610nulls           4.18ms ± 1%  4.05ms ± 1%   -3.08%  (p=0.000 n=10+10)
main/blake2b_huff/8415nulls           6.09ms ± 0%  5.93ms ± 1%   -2.62%  (p=0.000 n=7+10)
main/blake2b_shifts/2805nulls         16.8ms ± 2%  15.5ms ± 1%   -7.88%  (p=0.000 n=10+10)
main/blake2b_shifts/5610nulls         33.3ms ± 1%  30.7ms ± 0%   -7.77%  (p=0.000 n=9+9)
main/blake2b_shifts/8415nulls         49.7ms ± 1%  45.8ms ± 1%   -7.91%  (p=0.000 n=9+10)
[Geo mean]                            1.13ms       1.09ms        -3.92%

return res, nil
}
interpreter.returnData = nil
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I'm not happy how returnData is handled after these changes, but wanted to see big impact all changes have. Also please note that returning []byte from instructions is not needed any more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In CREATE and CREATE2 the res is either returned bytecode or revert return data, depending on the error. So we need handle ErrExecutionReverted separately. But I think it would be better to reset returnData = nil before evm.Create() and only assign it in the end in case of ErrExecutionReverted.

I can also move the returnData change to separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it with some better comments.

@@ -36,6 +36,7 @@ var (
ErrGasUintOverflow = errors.New("gas uint64 overflow")
ErrInvalidCode = errors.New("invalid code: must not begin with 0xef")
ErrNonceUintOverflow = errors.New("nonce uint64 overflow")
errStopToken = errors.New("stop token")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this lowercase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lowercase names are not visible outside of a go package

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this name fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ok. Perhaps it should be changed like this

Suggested change
errStopToken = errors.New("stop token")
// errStopToken is an internal stop token which is never returned to outside callers.
errStopToken = errors.New("stop token")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@s1na
Copy link
Contributor

s1na commented Nov 23, 2021

So I built this branch and synced goerli from block 5,416,168 to the current head (5900905) without seeing an issue

@chfast chfast force-pushed the evm_loop_err branch 2 times, most recently from 0bc56c9 to 782e923 Compare November 24, 2021 09:17
}
return nil, nil

if err == errStopToken {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more go-idiomatic

Suggested change
if err == errStopToken {
if errors.Is(err, errStopToken) {

But maybe your variant is more performant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The errors.Is() is not inlined (https://godbolt.org/z/n81qdKTzn), but this does not matter because this check is outside of the loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My slight preference is to leave == because of other usages in EVM, e.g. suberr == ErrCodeStoreOutOfGas.

Copy link
Contributor

@fjl fjl Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to use errors.Is here. The error is purely internal, and this check is performance-critical. errors.Is is appropriate when dealing with unknown and potentially nested errors.

@holiman
Copy link
Contributor

holiman commented Nov 24, 2021

Gave this a test on the existing benchmarks. I had expected it to have a bit of impact on SimpleLoop/loop-100M-6 -- which is mainly a lot trivial operations in a loop, burning through 100M gas. The effects are there, if you squint, but benchstat doesn't think it's statistically significant enough to report (I ran with --count 5).

$ benchstat master.txt ipsilon.txt 
name                                   old time/op    new time/op    delta
SimpleLoop/staticcall-identity-100M-6     276ms ± 0%     277ms ± 1%    ~     (p=0.413 n=4+5)
SimpleLoop/call-identity-100M-6           358ms ± 5%     360ms ± 9%    ~     (p=0.548 n=5+5)
SimpleLoop/loop-100M-6                    521ms ± 9%     505ms ± 5%    ~     (p=0.310 n=5+5)
SimpleLoop/call-nonexist-100M-6           902ms ± 2%     908ms ± 3%    ~     (p=1.000 n=5+5)
SimpleLoop/call-EOA-100M-6                395ms ± 4%     394ms ± 5%    ~     (p=0.841 n=5+5)
SimpleLoop/call-reverting-100M-6          888ms ± 2%     879ms ± 3%    ~     (p=0.310 n=5+5)

@chfast
Copy link
Contributor Author

chfast commented Nov 24, 2021

evmone benchmark suite on go 1.17

name                             old time/op  new time/op  delta                                                                                                                                                                  
micro/memory_grow_mload/nogrow    249µs ± 1%   239µs ± 0%   -4.10%  (p=0.000 n=10+9)                                                                                                                                              
micro/memory_grow_mload/by1       257µs ± 1%   247µs ± 1%   -4.18%  (p=0.000 n=10+10)                                                                                                                                             
micro/memory_grow_mload/by16      321µs ± 1%   311µs ± 1%   -3.29%  (p=0.000 n=10+10)                                                                                                                                             
micro/memory_grow_mload/by32      398µs ± 0%   390µs ± 1%   -2.07%  (p=0.000 n=10+10)                                                                                                                                             
micro/signextend/zero             463µs ± 0%   447µs ± 0%   -3.39%  (p=0.000 n=10+10)                                                                                                                                             
micro/signextend/one              471µs ± 1%   457µs ± 1%   -3.11%  (p=0.000 n=10+10)                                                                                                                                             
micro/jump_around/empty           154µs ± 1%   150µs ± 1%   -2.73%  (p=0.000 n=10+10)                                                                                                                                             
micro/memory_grow_mstore/nogrow   493µs ± 0%   469µs ± 0%   -4.88%  (p=0.000 n=10+9)                                                                                                                                              
micro/memory_grow_mstore/by1      502µs ± 1%   482µs ± 1%   -4.01%  (p=0.000 n=10+8)                                                                                                                                              
micro/memory_grow_mstore/by16     593µs ± 0%   581µs ± 1%   -2.03%  (p=0.000 n=10+10)                                                                                                                                             
micro/memory_grow_mstore/by32     642µs ± 1%   648µs ± 0%   +1.08%  (p=0.000 n=10+10)                                                                                                                                             
micro/JUMPDEST_n0/empty          3.45ms ± 0%  3.14ms ± 0%   -8.96%  (p=0.000 n=8+10)
main/sha1_divs/empty              227µs ± 1%   213µs ± 0%   -6.54%  (p=0.000 n=10+9)
main/sha1_divs/1351              4.60ms ± 0%  4.29ms ± 0%   -6.76%  (p=0.000 n=10+9)
main/sha1_divs/2737              8.94ms ± 0%  8.35ms ± 0%   -6.69%  (p=0.000 n=10+9)
main/sha1_divs/5311              17.5ms ± 1%  16.3ms ± 0%   -6.62%  (p=0.000 n=10+10)
main/weierstrudel/0               491µs ± 0%   478µs ± 0%   -2.77%  (p=0.000 n=9+10)
main/weierstrudel/1              1.05ms ± 1%  0.99ms ± 0%   -5.38%  (p=0.000 n=10+10)
main/weierstrudel/3              1.65ms ± 0%  1.56ms ± 0%   -5.21%  (p=0.000 n=9+10)
main/weierstrudel/9              3.42ms ± 0%  3.25ms ± 0%   -5.04%  (p=0.000 n=10+9)
main/weierstrudel/14             4.89ms ± 1%  4.64ms ± 0%   -5.01%  (p=0.000 n=10+10)
main/sha1_shifts/empty            180µs ± 0%   161µs ± 0%  -10.62%  (p=0.000 n=9+10)
main/sha1_shifts/1351            3.68ms ± 1%  3.28ms ± 1%  -10.75%  (p=0.000 n=9+10)
main/sha1_shifts/2737            7.13ms ± 0%  6.40ms ± 1%  -10.21%  (p=0.000 n=9+10)
main/sha1_shifts/5311            13.9ms ± 0%  12.4ms ± 0%  -10.78%  (p=0.000 n=10+9)
main/blake2b_huff/empty           110µs ± 0%   105µs ± 0%   -4.81%  (p=0.000 n=10+10)
main/blake2b_huff/2805nulls      2.10ms ± 1%  1.99ms ± 1%   -5.50%  (p=0.000 n=10+10)
main/blake2b_huff/5610nulls      4.08ms ± 1%  3.86ms ± 1%   -5.42%  (p=0.000 n=10+10)
main/blake2b_huff/8415nulls      5.96ms ± 1%  5.64ms ± 0%   -5.41%  (p=0.000 n=10+10)
main/blake2b_shifts/2805nulls    16.7ms ± 0%  15.5ms ± 1%   -7.27%  (p=0.000 n=8+10)
main/blake2b_shifts/5610nulls    33.3ms ± 0%  30.8ms ± 0%   -7.36%  (p=0.000 n=8+8)
main/blake2b_shifts/8415nulls    49.9ms ± 2%  45.9ms ± 1%   -7.94%  (p=0.000 n=10+10)
[Geo mean]                       1.58ms       1.49ms        -5.60%

@chfast
Copy link
Contributor Author

chfast commented Nov 24, 2021

name                                           old time/op    new time/op    delta
Call-8                                            132ms ± 0%     131ms ± 0%    ~     (p=0.063 n=9+9)
EVM_CREATE_500-8                                 27.9ms ± 1%    27.9ms ± 1%    ~     (p=0.971 n=10+10)
EVM_CREATE2_500-8                                 106ms ± 0%     106ms ± 0%    ~     (p=0.863 n=9+9)
EVM_CREATE_1200-8                                46.7ms ± 0%    46.7ms ± 0%    ~     (p=0.549 n=10+9)
EVM_CREATE2_1200-8                               91.1ms ± 0%    91.1ms ± 0%    ~     (p=0.573 n=8+10)
SimpleLoop/staticcall-identity-100M-8             224ms ± 1%     224ms ± 1%    ~     (p=0.063 n=10+10)
SimpleLoop/call-identity-100M-8                   291ms ± 0%     291ms ± 1%  -0.32%  (p=0.043 n=10+10)
SimpleLoop/loop-100M-8                            387ms ± 1%     359ms ± 1%  -7.14%  (p=0.000 n=10+10)
SimpleLoop/call-nonexist-100M-8                   650ms ± 0%     640ms ± 1%  -1.56%  (p=0.000 n=9+9)
SimpleLoop/call-EOA-100M-8                        286ms ± 1%     287ms ± 1%    ~     (p=0.133 n=9+10)
SimpleLoop/call-reverting-100M-8                  580ms ± 0%     576ms ± 0%  -0.59%  (p=0.000 n=10+9)
TracerStepVsCallFrame/tracer-step-10M-8           3.75s ± 1%     3.74s ± 0%    ~     (p=0.075 n=10+10)
TracerStepVsCallFrame/tracer-call-frame-10M-8    38.6ms ± 0%    38.2ms ± 0%  -1.09%  (p=0.000 n=9+8)
[Geo mean]                                        197ms          195ms       -0.88%

name                                           old alloc/op   new alloc/op   delta
SimpleLoop/staticcall-identity-100M-8            3.93kB ± 0%    3.85kB ± 8%    ~     (p=0.211 n=10+10)
SimpleLoop/call-identity-100M-8                  4.11kB ± 0%    4.11kB ± 0%    ~     (all equal)
SimpleLoop/loop-100M-8                           3.24kB ± 0%    3.24kB ± 0%    ~     (all equal)
SimpleLoop/call-nonexist-100M-8                  77.6MB ± 0%    77.6MB ± 0%    ~     (p=0.754 n=10+10)
SimpleLoop/call-EOA-100M-8                       2.84kB ±10%    2.84kB ±10%    ~     (p=1.000 n=10+10)
SimpleLoop/call-reverting-100M-8                  217MB ± 0%     217MB ± 0%    ~     (p=0.353 n=10+10)
TracerStepVsCallFrame/tracer-step-10M-8           178MB ± 0%     178MB ± 0%    ~     (p=0.086 n=10+10)
TracerStepVsCallFrame/tracer-call-frame-10M-8    2.30kB ± 0%    2.29kB ± 0%  -0.17%  (p=0.000 n=8+7)
[Geo mean]                                        178kB          178kB       -0.26%

name                                           old allocs/op  new allocs/op  delta
SimpleLoop/staticcall-identity-100M-8              38.0 ± 0%      37.8 ± 3%    ~     (p=0.211 n=10+10)
SimpleLoop/call-identity-100M-8                    39.0 ± 0%      39.0 ± 0%    ~     (all equal)
SimpleLoop/loop-100M-8                             26.0 ± 0%      26.0 ± 0%    ~     (all equal)
SimpleLoop/call-nonexist-100M-8                   1.49M ± 0%     1.49M ± 0%    ~     (p=0.799 n=10+9)
SimpleLoop/call-EOA-100M-8                         25.7 ± 3%      25.7 ± 3%    ~     (p=1.000 n=10+10)
SimpleLoop/call-reverting-100M-8                  4.29M ± 0%     4.29M ± 0%    ~     (p=0.423 n=10+10)
TracerStepVsCallFrame/tracer-step-10M-8           22.3M ± 0%     22.3M ± 0%    ~     (p=0.076 n=10+10)
TracerStepVsCallFrame/tracer-call-frame-10M-8      33.0 ± 0%      33.0 ± 0%    ~     (all equal)
[Geo mean]                                        2.87k          2.87k       -0.07%

@holiman
Copy link
Contributor

holiman commented Nov 24, 2021

SimpleLoop/loop-100M-8                            387ms ± 1%     359ms ± 1%  -7.14%  (p=0.000 n=10+10)

Yes, more like it!

return res, nil
}
interpreter.returnData = nil // clear dirty return data buffer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not covered by tests. Reported in ethereum/tests#993.

@@ -36,6 +36,7 @@ var (
ErrGasUintOverflow = errors.New("gas uint64 overflow")
ErrInvalidCode = errors.New("invalid code: must not begin with 0xef")
ErrNonceUintOverflow = errors.New("nonce uint64 overflow")
errStopToken = errors.New("stop token")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

core/vm/jump_table.go Show resolved Hide resolved
@chfast
Copy link
Contributor Author

chfast commented Nov 24, 2021

SimpleLoop/loop-100M-8                            387ms ± 1%     359ms ± 1%  -7.14%  (p=0.000 n=10+10)

Yes, more like it!

It would be nice to have some other hardware to confirm the numbers.

@karalabe
Copy link
Member

It would be nice to have some other hardware to confirm the numbers.

goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/vm/runtime
cpu: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz
name                                           old time/op    new time/op    delta
Call-8                                            235ms ± 5%     236ms ± 1%    ~     (p=0.690 n=5+5)
EVM_CREATE_500-8                                 49.6ms ± 1%    50.2ms ± 5%    ~     (p=0.548 n=5+5)
EVM_CREATE2_500-8                                 151ms ± 1%     151ms ± 1%    ~     (p=0.690 n=5+5)
EVM_CREATE_1200-8                                79.6ms ± 2%    79.7ms ± 3%    ~     (p=1.000 n=5+5)
EVM_CREATE2_1200-8                                122ms ± 1%     122ms ± 1%    ~     (p=1.000 n=5+5)
SimpleLoop/staticcall-identity-100M-8             303ms ± 8%     285ms ± 6%    ~     (p=0.222 n=5+5)
SimpleLoop/call-identity-100M-8                   372ms ± 2%     367ms ± 2%    ~     (p=0.151 n=5+5)
SimpleLoop/loop-100M-8                            523ms ±13%     485ms ± 7%    ~     (p=0.056 n=5+5)
SimpleLoop/call-nonexist-100M-8                   864ms ± 3%     828ms ± 0%  -4.14%  (p=0.008 n=5+5)
SimpleLoop/call-EOA-100M-8                        386ms ±11%     369ms ± 8%    ~     (p=0.151 n=5+5)
SimpleLoop/call-reverting-100M-8                  827ms ± 2%     826ms ± 3%    ~     (p=0.421 n=5+5)
TracerStepVsCallFrame/tracer-step-10M-8           4.93s ± 1%     4.77s ± 1%  -3.23%  (p=0.008 n=5+5)
TracerStepVsCallFrame/tracer-call-frame-10M-8    51.0ms ± 6%    52.1ms ± 9%    ~     (p=0.548 n=5+5)

name                                           old alloc/op   new alloc/op   delta
SimpleLoop/staticcall-identity-100M-8            3.95kB ± 6%    3.95kB ± 6%    ~     (p=1.000 n=5+5)
SimpleLoop/call-identity-100M-8                  4.42kB ± 0%    4.42kB ± 0%    ~     (all equal)
SimpleLoop/loop-100M-8                           3.34kB ±19%    3.24kB ± 0%    ~     (p=1.000 n=5+4)
SimpleLoop/call-nonexist-100M-8                  77.6MB ± 0%    77.6MB ± 0%    ~     (p=1.000 n=5+5)
SimpleLoop/call-EOA-100M-8                       3.27kB ± 0%    3.27kB ± 0%    ~     (all equal)
SimpleLoop/call-reverting-100M-8                  217MB ± 0%     217MB ± 0%    ~     (p=0.310 n=5+5)
TracerStepVsCallFrame/tracer-step-10M-8           178MB ± 0%     178MB ± 0%    ~     (p=0.452 n=5+5)
TracerStepVsCallFrame/tracer-call-frame-10M-8    2.33kB ± 3%    2.32kB ± 3%    ~     (p=1.000 n=5+5)

name                                           old allocs/op  new allocs/op  delta
SimpleLoop/staticcall-identity-100M-8              38.6 ± 2%      38.6 ± 2%    ~     (p=1.000 n=5+5)
SimpleLoop/call-identity-100M-8                    40.0 ± 0%      40.0 ± 0%    ~     (all equal)
SimpleLoop/loop-100M-8                             25.8 ± 7%      26.0 ± 0%    ~     (p=1.000 n=5+4)
SimpleLoop/call-nonexist-100M-8                   1.49M ± 0%     1.49M ± 0%    ~     (p=0.690 n=5+5)
SimpleLoop/call-EOA-100M-8                         27.0 ± 0%      27.0 ± 0%    ~     (all equal)
SimpleLoop/call-reverting-100M-8                  4.29M ± 0%     4.29M ± 0%    ~     (p=0.317 n=5+5)
TracerStepVsCallFrame/tracer-step-10M-8           22.3M ± 0%     22.3M ± 0%    ~     (p=0.540 n=5+5)
TracerStepVsCallFrame/tracer-call-frame-10M-8      33.0 ± 0%      33.0 ± 0%    ~     (all equal)

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holiman
Copy link
Contributor

holiman commented Nov 29, 2021

>>> build/cache/golangci-lint-1.42.0-linux-amd64/golangci-lint run --config .golangci.yml ./...
core/vm/errors.go:42: File is not `goimports`-ed (goimports)
	errStopToken                = errors.New("stop token")
core/vm/jump_table.go:44: File is not `goimports`-ed (goimports)
	writes  bool // determines whether this a state modifying operation

@holiman holiman merged commit 1fa9172 into ethereum:master Nov 29, 2021
@holiman holiman deleted the evm_loop_err branch November 29, 2021 13:46
@holiman holiman added this to the 1.10.14 milestone Nov 29, 2021
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
* core/vm: break loop on any error

* core/vm: move ErrExecutionReverted to opRevert()

* core/vm: use "stop token" to stop the loop

* core/vm: unconditionally pc++ in the loop

* core/vm: set return data in instruction impls
yperbasis added a commit to ledgerwatch/erigon that referenced this pull request Dec 21, 2022
Cherry-pick ethereum/go-ethereum#23952

Co-authored-by: Paweł Bylica <chfast@gmail.com>
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 27, 2024
* core/vm: break loop on any error

* core/vm: move ErrExecutionReverted to opRevert()

* core/vm: use "stop token" to stop the loop

* core/vm: unconditionally pc++ in the loop

* core/vm: set return data in instruction impls
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Mar 1, 2024
* core/vm: break loop on any error

* core/vm: move ErrExecutionReverted to opRevert()

* core/vm: use "stop token" to stop the loop

* core/vm: unconditionally pc++ in the loop

* core/vm: set return data in instruction impls
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Mar 1, 2024
* core/vm: break loop on any error

* core/vm: move ErrExecutionReverted to opRevert()

* core/vm: use "stop token" to stop the loop

* core/vm: unconditionally pc++ in the loop

* core/vm: set return data in instruction impls
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.

None yet

6 participants