Commit graph

251 commits

Author SHA1 Message Date
Matthieu Vachon
4862eeba1d Updated to really use Firehose protocol 3.0 2024-01-10 21:28:08 -05:00
Matthieu Vachon
8677894b94 Removed special delegate value logic as it's not needed, the tracer does the correct thing 2024-01-10 20:52:27 -05:00
Matthieu Vachon
4c221a04d4 Fix for code storage out of gas error before homestead 2024-01-09 14:52:39 -05:00
Matthieu Vachon
3e44bf5895 Added more tracing to log computation 2024-01-08 11:58:46 -05:00
Matthieu Vachon
3181acac69 Added mistmatched transaction hash when log are not aligned 2023-12-12 21:26:52 -05:00
Matthieu Vachon
a7f50134bd Account creations can happen before a transaction starts 2023-12-05 10:32:00 -05:00
Matthieu Vachon
c36b44073f Ported back some fixes from Erigon extended native tracer 2023-11-30 10:53:31 -05:00
Matthieu Vachon
e51cbb0c95 Merge branch 'extended-tracer' into firehose-fh3.0
# Conflicts:
#	go.mod
#	go.sum
2023-11-29 13:50:08 -05: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
8af369e181 Merge branch 'extended-tracer' into feature/firehose-extended-tracer
# Conflicts:
#	core/state_transition.go
#	core/vm/contract.go
#	core/vm/evm.go
#	core/vm/instructions.go
#	core/vm/interpreter.go
#	core/vm/logger.go
2023-09-12 14:07:11 -04:00
Matthieu Vachon
ff3c15ff90
Full OnGasConsumed loop and added GasChangeReason (#16) 2023-09-12 17:19:15 +02:00
Matthieu Vachon
ca6c36384b Updated to latest firehose-ethereum/types 2023-09-11 12:31:32 -04:00
Matthieu Vachon
98dc951764 Fixed wrong gas change since new PR update around that 2023-09-11 10:54:30 -04:00
Matthieu Vachon
31f1a01ec5 Merge branch 'feature/gas-full-cycle-and-reason' into feature/firehose-extended-tracer
# Conflicts:
#	core/blockchain.go
#	core/state_transition.go
#	core/vm/contracts.go
#	core/vm/evm.go
#	core/vm/instructions.go
#	core/vm/interpreter.go
#	core/vm/logger.go
#	core/vm/operations_acl.go
#	eth/backend.go
#	eth/tracers/logger/access_list_tracer.go
#	eth/tracers/logger/logger.go
#	eth/tracers/logger/logger_json.go
2023-09-11 10:27:01 -04:00
Matthieu Vachon
daf3f63421 Merge remote-tracking branch 's1na/extended-tracer' into feature/gas-full-cycle-and-reason
# Conflicts:
#	eth/tracers/logger/access_list_tracer.go
#	eth/tracers/logger/logger.go
#	eth/tracers/logger/logger_json.go
2023-09-01 09:34:29 -04: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
Matthieu Vachon
5763314b0d Removed tracer support when doing genesis.Flush(...)
The genesis flush do set the logger, but we receive the genesis block allocs via `OnGenesisBlock` meaning it's not necessary to have the logger in the flush.
2023-08-29 16:12:59 -04:00
Matthieu Vachon
d0dbbaf6a5 Change OnGasConsumed(gas, cost uint64, reason) to OnGasChange(old, new uint64, reason)
This way, we avoid having a `cost` that is negative which does not make sense for a `uint64`. Having the `old, new` also yields correct value and the delta can then be negative and be holded in a `int64`.

# Conflicts:
#	core/vm/evm.go
2023-08-28 19:20:01 -04:00
Matthieu Vachon
01ccd7126e Change OnGasConsumed(gas, cost uint64, reason) to OnGasChange(old, new uint64, reason)
This way, we avoid having a `cost` that is negative which does not make sense for a `uint64`. Having the `old, new` also yields correct value and the delta can then be negative and be holded in a `int64`.
2023-08-28 15:30:10 -04:00
Matthieu Vachon
e0af166ffa Full OnGasConsumed loop and added GasChangeReason
With this change, the full gas loop of a transaction can be tracked going from initial balance (`gasLimit`) back down to 0.

I validated on my regression test suite that those conditions applied to all transactions I have:
- First `OnGasConsumed` is always going from 0 -> `trx.gasLimit`
- Last `OnGasConsumed` "new value" is always 0
- trx.gasLimit - last balance of last `OnGasConsumed` is equal to `trx.gasUsed`

The addition of `reason` make it possible for a logger to filter out unwanted signal, for example one could want to drop all OpCode related gas change and only cares about "transaction" level. The reason is also a good thing for visibility and for creating powerful debug tools for Ethereum transaction execution.

Also, I would like that we change the `OnGasConsumed` logic from `OnGasConsumed(actual, cost uint64, reason)` to `OnGasConsumed(old, new uint64, reason)`. With the new tracing I've done, we now have negative `cost` that needs to be passed around but the `cost` is `uint64` so it creates overflow. Everything works fine if you record the new/old value `gas-cost` as the final value goes back to a valid range. But it's weird for consumer that would log `cost` that it's `18127127187219...`. An alternative would be to accept a `int64` for the cost which is also valid, not full coverage theorically but I don't see why an operation would cost more than i64 max value. Maybe it make more sense than to have signature `OnGasConsumed(gas uint64, cost int64, reason)`, I'm fine with it also, I leave the decision to you.
2023-08-28 15:30:10 -04: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
Matthieu Vachon
db63814064 Now passing finality information if available 2023-08-03 16:39:42 -04:00
Matthieu Vachon
84af9dee0c Removed a FIXME and improved known Firehose issue description 2023-08-02 14:14:57 -04:00
Matthieu Vachon
1792f99bb0 Few small changes around the patch 2023-08-02 14:07:24 -04:00
Matthieu Vachon
1df06e296d Make patch simpler, added clear indications where to fix Firehose know instrumentation issues 2023-08-02 13:55:28 -04:00
Matthieu Vachon
61b11e83e9 Bring in latest changes that make our new Ethereum patch 1:1 2023-08-02 13:22:12 -04:00
Matthieu Vachon
ec154ca444 More fixes towards a working ordinal implementation 2023-08-02 11:48:01 -04:00
Matthieu Vachon
17dcacc575 Removed now unused code 2023-08-02 11:35:06 -04:00
Matthieu Vachon
d1ad0e35d5 Re-implemented OnGenesisBlock using the tracer itself 2023-08-02 11:31:25 -04:00
Matthieu Vachon
09df0e0c95 Merge branch 'extended-tracer' into feature/firehose-extended-tracer
# Conflicts:
#	core/vm/evm.go
2023-08-02 09:49:36 -04:00
Matthieu Vachon
7589c3c8d5 Fixed back missing latest differences, bring back GasChange and proper handling of them, fully aligned 2023-08-02 09:43:32 -04:00
Matthieu Vachon
32c14945da Full OnGasConsumed loop and added GasChangeReason
With this change, the full gas loop of a transaction can be tracked going from initial balance (`gasLimit`) back down to 0.

I validated on my regression test suite that those conditions applied to all transactions I have:
- First `OnGasConsumed` is always going from 0 -> `trx.gasLimit`
- Last `OnGasConsumed` "new value" is always 0
- trx.gasLimit - last balance of last `OnGasConsumed` is equal to `trx.gasUsed`

The addition of `reason` make it possible for a logger to filter out unwanted signal, for example one could want to drop all OpCode related gas change and only cares about "transaction" level. The reason is also a good thing for visibility and for creating powerful debug tools for Ethereum transaction execution.
2023-08-02 09:16:45 -04:00
Matthieu Vachon
ed4349ca90 Fixed BalanceChange for suicide withdraw not being recorded 2023-07-31 21:46:51 -04:00
Matthieu Vachon
2b4614152b More work towards a working 1:1 Firehose tracer patch 2023-07-31 16:53:16 -04:00
Matthieu Vachon
c5eb5faa5f Further work towards having a compatible Firehose code (at battlefied block #15) 2023-07-28 17:05:21 -04:00
Matthieu Vachon
b9bcdef066 More fixes towards a working Firehose patch 2023-07-27 16:32:17 -04:00