Commit graph

1796 commits

Author SHA1 Message Date
Matthieu Vachon
98dc951764 Fixed wrong gas change since new PR update around that 2023-09-11 10:54:30 -04:00
Matthieu Vachon
996a988b54 Fixed BlockchainLogger tracer not being correctly set up up to Blockchain object 2023-09-11 10:28:00 -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
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
Sina Mahmoodi
f9f377d64f capture call validation errors 2023-07-27 21:57:40 +02:00
Matthieu Vachon
b797e5d261 More fixes towards a 1-1 Firehose tracer against old model 2023-07-27 15:37:36 -04:00
Matthieu Vachon
4e834c10d0 Merge remote-tracking branch 's1na/extended-tracer' into feature/firehose-extended-tracer
# Conflicts:
#	core/state/state_object.go
#	core/state/statedb_test.go
#	core/state_transition.go
#	core/txpool/legacypool/legacypool_test.go
#	core/vm/evm.go
#	core/vm/instructions.go
#	eth/api_debug_test.go
#	eth/tracers/js/tracer_test.go
#	go.sum
2023-07-27 11:47:40 -04:00
Sina Mahmoodi
09ee197723 fix merge conflict 2023-07-27 14:48:26 +02:00
Sina Mahmoodi
b2b32e6ff6 fix merge conflict 2023-07-27 14:41:47 +02:00
Péter Szilágyi
1662228ac6
core/txpool/blobpool: 4844 blob transaction pool (#26940)
* core/blobpool: implement txpool for blob txs

* core/txpool: track address reservations to notice any weird bugs

* core/txpool/blobpool: add support for in-memory operation for tests

* core/txpool/blobpool: fix heap updating after SetGasTip if account is evicted

* core/txpool/blobpool: fix eviction order if cheap leading txs are included

* core/txpool/blobpool: add note as to why the eviction fields are not inited in reinject

* go.mod: pull in inmem billy form upstream

* core/txpool/blobpool: fix review commens

* core/txpool/blobpool: make heap and heap test deterministic

* core/txpool/blobpool: luv u linter

* core/txpool: limit blob transactions to 16 per account

* core/txpool/blobpool: fix rebase errors

* core/txpool/blobpool: luv you linter

* go.mod: revert some strange crypto package dep updates
2023-07-27 13:45:35 +03:00
Matthieu Vachon
8d75122911 Fixed a bunch of small issues here and there (genesis block is equal to oracle now!) 2023-07-26 20:22:40 -04:00
Matthieu Vachon
ad1293e8f9 Completed patch porting, now fixing bugs 2023-07-26 14:38:01 -04: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
Matthieu Vachon
75e8c96f4e WIP 2023-07-25 10:40:30 -04:00
rjl493456442
88f3d61468
all: expose block number information to statedb (#27753)
* core/state: clean up

* all: add block number infomration to statedb

* core, trie: rename blockNumber to block
2023-07-24 13:22:09 +03:00
Matthieu Vachon
939c4ec7d8 Merge remote-tracking branch 's1na/extended-tracer' into feature/firehose-extended-tracer
# Conflicts:
#	core/blockchain.go
#	eth/tracers/printer.go
2023-07-20 14:35:52 -04:00
Matthieu Vachon
e93892267f Continued our work on new Firehose tracer 2023-07-19 09:34:40 -04:00
Felix Lange
e86ad52640
beacon/engine, eth/catalyst: EIP-4844 updates for the engine API (#27736)
This is a spin-out from the EIP-4844 devnet branch, containing just the Engine API modifications
and nothing else. The newPayloadV3 endpoint won't really work in this version, but we need the
data structures for testing so I'd like to get this in early.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2023-07-18 09:44:16 +02:00
Felföldi Zsolt
d4d88f9bce
les: remove obsolete code related to PoW header syncing (#27737)
This change removes PoW header syncing related code from LES and also deletes 
duplicated packages les/catalyst, les/downloader and les/fetcher. These package copies
were created because people wanted to make changes in their eth/ counterparts, but weren't
able to adapt LES code to the API changes.
2023-07-17 20:48:11 +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
Delweng
714f75943b
eth, miner: rm redundant type declare (#27713)
* eth: rm redundant type from array, slice, or map

* miner: rm redundant type from array, slice, or map
2023-07-13 09:55:31 +03: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
Matthieu Vachon
7cc206e494 Merge remote-tracking branch 's1na/extended-tracer' into feature/firehose-extended-tracer 2023-07-11 21:08:34 -04:00
Matthieu Vachon
daa722a93f Initial working Firehose native tracer implementation 2023-07-11 21:08:05 -04:00