Commit graph

217 commits

Author SHA1 Message Date
Sina Mahmoodi
0484068df5 fix lint issues 2023-12-11 14:17:29 +03:30
Sina Mahmoodi
c5e407ba66 resolve merge conflicts 2023-12-05 18:13:41 +03:30
Sina Mahmoodi
f862531c25 rm chainConfig from OnGenesisBlock 2023-12-05 16:49:03 +03:30
Sina Mahmoodi
9e5c96fdff add chainConfig to block events 2023-12-05 16:31:16 +03:30
Martin Holst Swende
3dc071e036
eth/tracers/logger: make structlog/json-log stack hex again (#28628)
* common/hexutil: define hex wrappers for uint256.Int

* eth/tracers/logger: make structlog/json-log stack hex again

* common/hexutil: goimports
2023-12-05 09:37:48 +01:00
Delweng
5fb8ebc9ec
eth/tracers: tx-level state in debug_traceCall (#28460) 2023-12-01 16:38:52 +03:30
Sina Mahmoodi
bbc5db8405
eth/tracers/js: fix type inconsistencies (#28488)
This change fixes two type-inconsistencies in the JS tracer:

- In most places we return byte arrays as a `Uint8Array` to the tracer. However it seems we missed doing the conversion for `ctx` fields which are passed to the tracer during `result`. They are passed as simple arrays. I think Uint8Arrays are more suitable and we should change this inconsistency. Note: this will be a breaking-change. But I believe the effect is small. If we look at our tracers we see that these fields (`ctx.from`, `ctx.to`, etc.) are used in 2 ways. Passed to `toHex` which takes both array or buffer. Or the length was measured which is the same for both types.
- The `slice` taking in `int, int` params versus `memory.slice` taking `int64, int64` params. I suggest changing `slice` types to `int64`. This should have no effect almost in any case.
2023-11-28 15:00:35 +01:00
Sina Mahmoodi
8610f8f68c add hooks for beacon block root processing 2023-11-24 19:08:42 +03:30
Sina Mahmoodi
5bc3f62647 move makeTest to own file 2023-11-24 18:29:27 +03:30
Sina Mahmoodi
8a1f67c7c8 forgot prestate testcase 2023-11-24 18:21:12 +03:30
Sina Mahmoodi
9c00b1290b fix merge conflict 2023-11-24 16:09:47 +03:30
Sina Mahmoodi
cc6b68eb3b Fix prestate create issue, add test 2023-11-11 16:29:50 +03:00
Sina Mahmoodi
0d268b796c fix TxStart for traceCall 2023-11-08 19:28:42 +03:00
Sina Mahmoodi
dc1175e3e1
rm unnecessary line
Co-authored-by: Delweng <delweng@gmail.com>
2023-11-07 16:35:13 +03:00
Sina Mahmoodi
e4399a672a Use applyTransaction in tracer instead of applyMessage 2023-11-03 16:59:24 +01:00
Alvaro Sevilla
b1cec853be
eth/tracers: add position field for callTracer logs (#28389)
Currently, one can use the "withLogs" parameter to include logs in the
callTracer results, which allows the user to see at which trace level
was each log emitted.
This commit adds a position field to the logs which determine
the exact ordering of a call's logs and its subcalls. This would
be useful e.g. for explorers wishing to display the flow of execution.

Co-authored-by: jsvisa <delweng@gmail.com>
2023-11-03 10:28:27 +01:00
Sina Mahmoodi
6ee4fb8eac resolve merge conflicts 2023-09-13 16:17:36 +02:00
Matthieu Vachon
ff3c15ff90
Full OnGasConsumed loop and added GasChangeReason (#16) 2023-09-12 17:19:15 +02:00
Sina Mahmoodi
9c999c36ff Use noopTracer as base for loggers 2023-08-31 16:31:30 +02:00
Sina Mahmoodi
659043a1d9 pass tracer name via cli 2023-08-30 18:14:06 +02:00
Felix Lange
9b46986edc
all: use rlp.DecodeBytes instead of rlp.Decode where possible (#27994) 2023-08-24 11:47:42 +03:00
Péter Szilágyi
0c6bbeb423
core, eth, trie: expose more detailed dirty ram tracking for diff layers (#27971) 2023-08-23 14:08:39 +03:00
Joe Netti
e0b119884c
eth/tracers/js: use t.toBig on ctx.GasPrice for js tracing (#27903)
This change fixes a bug in js tracer, where `ctx.GasPrice.toString(16)` returns a number string in base `10`.
2023-08-15 14:19:37 -04:00
Péter Szilágyi
be65b47645
all: update golang/x/ext and fix slice sorting fallout (#27909)
The Go authors updated golang/x/ext to change the function signature of the slices sort method. 
It's an entire shitshow now because x/ext is not tagged, so everyone's codebase just 
picked a new version that some other dep depends on, causing our code to fail building.

This PR updates the dep on our code too and does all the refactorings to follow upstream...
2023-08-12 00:04:12 +02:00
rjl493456442
503f1f7ada
all: activate pbss as experimental feature (#26274)
* all: activate pbss

* core/rawdb: fix compilation error

* cma, core, eth, les, trie: address comments

* cmd, core, eth, trie: polish code

* core, cmd, eth: address comments

* cmd, core, eth, les, light, tests: address comment

* cmd/utils: shorten log message

* trie/triedb/pathdb: limit node buffer size to 1gb

* cmd/utils: fix opening non-existing db

* cmd/utils: rename flag name

* cmd, core: group chain history flags and fix tests

* core, eth, trie: fix memory leak in snapshot generation

* cmd, eth, internal: deprecate flags

* all: enable state tests for pathdb, fixes

* cmd, core: polish code

* trie/triedb/pathdb: limit the node buffer size to 256mb

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2023-08-10 22:21:36 +03:00
Sina Mahmoodi
f9f377d64f capture call validation errors 2023-07-27 21:57:40 +02:00
Sina Mahmoodi
b2b32e6ff6 fix merge conflict 2023-07-27 14:41:47 +02:00
Sina Mahmoodi
2faf3dbfd6 emit err on tx validation failure 2023-07-26 20:07:13 +02:00
Matthieu Vachon
5466fa3133
Capture balance reason (#12) 2023-07-26 10:49:04 +02:00
jwasinger
d233b6b23a
core: replace instances of 'suicide' with 'selfdestruct' to improve code consistency. (#27716)
---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2023-07-15 10:35:30 -04:00
Ryan Schneider
517ac886d4
eth/tracers/native: panic on memory read in prestateTracer (#27691)
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2023-07-13 14:44:42 +02:00
Delweng
1e069cf802
eth/tracers: add ReturnData in the tracer's response (#27704)
The struct logger (or opcode tracer) was missing the return data field even
if this was explicitly enabled by user via `"enableReturnData": true` in the config.
This PR fixes this issue.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2023-07-13 14:43:25 +02:00
Sina Mahmoodi
2a59d24b73 add genesis alloc to hook 2023-07-12 17:38:19 +02:00
Sina Mahmoodi
b692a68a3b add final & safe headers to BlockStart 2023-07-12 17:22:52 +02:00
Sina Mahmoodi
0aeec7f1b5 mv td to OnBlockStart 2023-07-12 16:44:00 +02:00
Sina Mahmoodi
add825e9c9 fix BlockEnd in case of err 2023-07-10 19:01:55 +02:00
Sina Mahmoodi
d799c68159 nicer printer output 2023-07-10 17:53:19 +02:00
Sina Mahmoodi
3cabef4c66 capture block end errors 2023-06-30 15:29:38 +02:00
Sina Mahmoodi
54171ee4a8 pass env in TxStart 2023-06-28 21:58:38 +02:00
Sina Mahmoodi
619ac2948c provide StateLogger for short-lived tracers 2023-06-28 18:00:44 +02:00
Sina Mahmoodi
378781654f Upgrade TxStart and TxEnd hooks 2023-06-28 13:28:53 +02:00
Guillaume Ballet
85b8d1c06c
params, trie: add verkle fork management + upgrade go-verkle (#27464)
* params, trie: add verkle fork management + upgrade go-verkle

* remove the two verkle files

* core, eth, params: add missing function

* Gary's feedback

* remove trie/utils/verkle.go

* add verkle block override

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2023-06-28 12:08:48 +03:00
Sina Mahmoodi
ee791b2b20 add gas consumption hook 2023-06-23 16:40:58 +02:00
Sina Mahmoodi
84d6432708 add log and newAccount hooks 2023-06-22 13:10:05 +02:00
Sina Mahmoodi
f67ac095a6 add hooks to state object & genesis 2023-06-20 13:43:45 +02:00
Dan Laine
b1ef0bfe03
eth: use slices package for sorting (#27490)
Also adds Hash.Less method for sorting purposes.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-06-19 23:38:57 +02:00
Sina Mahmoodi
e25065bfc3 capture keccak preimage 2023-06-15 18:42:57 +02:00
Sina Mahmoodi
642a374b9d Initial support for extended tracer 2023-06-15 17:40:49 +02:00
Sina Mahmoodi
7823ff6d06
eth/tracers: refactor exporting js buffer (#27472)
We had to do this workaround because it wasn't possible to export typed arrays from
JS to []byte. This was added in dop251/goja@2352993, so we can use the better way now.
2023-06-14 19:07:24 +02:00
Delweng
8a78a4f79f
eth,consensus: replace noarg fmt.Errorf with errors.New (#27330)
* eth: replace noarg fmt.Errorf with errors.New

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

* consensus: replace noarg fmt.Errorf with errors.New

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

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2023-05-25 02:57:34 -04:00