Skip to content

Commit

Permalink
eth/tracers/js: drop duktape engine (#24934)
Browse files Browse the repository at this point in the history
#23773 added a JS tracer which uses Goja as its engine. In this PR I remove the previous tracer which used duktape as well as remove the dependencies.

This PR also comes with 2 fixes in the Goja tracer and one small behavioural change:

    I had handled errors in the native Go functions by panicing. My oversight was that Goja only handles panics with a Goja.Value as argument. The difference is panic(goja.Value) allows JS to catch the exception whereas Interrupt(error) doesn't.
    There was a race in how I handled Stop.
    Because of 1. some of the methods that simply return nil on error (like memory.slice) now throw an exception.
  • Loading branch information
s1na authored May 23, 2022
1 parent af02e97 commit ba47d80
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 1,051 deletions.
4 changes: 0 additions & 4 deletions eth/tracers/internal/tracetest/calltrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ func TestCallTracerNative(t *testing.T) {
testCallTracer("callTracer", "call_tracer", t)
}

func TestCallTracerLegacyDuktape(t *testing.T) {
testCallTracer("callTracerLegacyDuktape", "call_tracer_legacy", t)
}

func testCallTracer(tracerName string, dirPath string, t *testing.T) {
files, err := os.ReadDir(filepath.Join("testdata", dirPath))
if err != nil {
Expand Down
Loading

0 comments on commit ba47d80

Please sign in to comment.