Commit Graph

13 Commits

Author SHA1 Message Date
Sina Mahmoodi
0f4942214d
eth/tracers: fix gasUsed for native and JS tracers (#26048)
* eth/tracers: fix gasUsed in call tracer

* fix js tracers gasUsed

* fix legacy prestate tracer

* fix restGas in test

* drop intrinsicGas field from js tracers
2022-10-28 12:28:29 +02:00
Martin Holst Swende
ee301c750b
all: fix docstrings 2022-10-04 09:18:02 +02:00
Sina Mahmoodi
4dc212d4f1
eth/tracers: pad memory slice on OOB case (#25213)
* eth/tracers: pad memory slice on oob case

* eth/tracers/js: fix testfailure due to err msg capitalization

Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-09-26 09:56:45 +02:00
Felix Lange
731885809c
eth/tracers/js: improve integer types in log object (#25668)
All fields related to gas must be represented as uint64. Depth is
internally tracked as int, so it makes sense to also store it as int.
2022-09-05 14:06:16 +02:00
Sina Mahmoodi
d6a12bc7b8
eth/tracers/js: fill in log.refund field (#25661)
For some reason, an accessor method for this field exists in JS, but
the value was never actually assigned.
2022-09-02 17:08:25 +02:00
Sina Mahmoodi
86de2e516e
eth/tracers: add onlyTopCall option to callTracer (#25430)
This PR allows users to pass in a config object directly to the tracers. Previously only the struct logger was configurable.

It also adds an option to the call tracer which if enabled makes it ignore any subcall and collect only information about the top-level call. See #25419 for discussion.

The tracers will silently ignore if they are passed a config they don't care about.
2022-08-09 11:04:57 +02:00
Delweng
b196ad1c16
all: add whitespace linter (#25312)
* golangci: typo

Signed-off-by: Delweng <delweng@gmail.com>

* golangci: add whietspace

Signed-off-by: Delweng <delweng@gmail.com>

* *: rm whitesapce using golangci-lint

Signed-off-by: Delweng <delweng@gmail.com>

* cmd/puppeth: revert accidental resurrection

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2022-07-25 13:14:03 +03:00
Seungbae.yu
d2247d9f5d
eth, internal, light: fix error string capitalization (#25364) 2022-07-25 12:53:44 +03:00
Sina Mahmoodi
6135c688b8
eth/tracers: optimize goja buffer conversion (#25156)
This changes the []byte <-> Uint8Array conversion to use an
ArrayBuffer, avoiding inefficient copying of the slice data in Goja.

Co-authored-by: Felix Lange <fjl@twurst.com>
2022-06-23 18:11:47 +02:00
Felix Lange
9244d5cd61
all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
Sina Mahmoodi
ba47d800b1
eth/tracers/js: drop duktape engine (#24934)
#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.
2022-05-23 22:26:10 +02:00
Eduard S
310f751639
eth/tracers/js: add memory.length method (#24887) 2022-05-19 14:35:30 +02:00
Sina Mahmoodi
bf693228a3
eth/tracers/js: goja tracer (#23773)
This adds a JS tracer runtime environment based on the Goja VM. The new
runtime replaces the duktape runtime, which will be removed soon.

Goja is implemented in Go and is faster for cases where the Go <-> JS
transition overhead dominates overall performance. It is faster because
duktape is written in C, and the transition cost includes the cost of using
cgo. Another reason for using Goja is that go-duktape is not maintained
anymore.

We expect the performace of JS tracing to be at least as good or better with
this change.
2022-05-18 16:34:18 +02:00