Commit Graph

883 Commits

Author SHA1 Message Date
Giulio rebuffo
f1dd51ccb3
Added Historical Summary and FromBlsToExecution (#6658)
Added Capella specific Data types.
2023-01-22 11:48:17 +01:00
alex.sharov
99e535561b save 2023-01-22 16:51:09 +07:00
Alex Sharov
5a7e0eb5db
e3: eth_getLogs simplify (#6660) 2023-01-22 16:48:54 +07:00
Alex Sharov
0ee8c175d9
e3: simplify history reader (#6659) 2023-01-22 16:42:24 +07:00
Alex Sharov
43d39762c2
e3: ots_searchTransactionsBefore (#6656) 2023-01-22 15:35:18 +07:00
lupin012
5c82faa44b
eth_callBundle fixes (#6628)
There are two fixes:
1) the blockNumber in the CreateHistoryStateReader should be blockNumber
+ 1 as in the eth_call, eth_createAccessList:
- eth_call: already use blockNumber + 1 see
CreateStateReaderFromBlockNumber where the blockNumber
- passed to the CreateHistoryStateReader is blockNumber + 1
- eth_createAccessList: call CreateHistoryStateReader directly with
blockNumber + 1
2) The eth_callBudle allows to execute the original transaction (here
the sender nonce is assigned to the tx) on a user defined block; the
original transition could be performed in another block . The sender's
nonce when the original transaction was performed had a value that may
be different to the nonce of the sender when the tx is "executed" on new
block. So during the execution of the eth_callBundle must not be
verified that the nonce is progressive (original nonce of the tx + 1:
see preCheck() in state_transition.go that; if the checkNonce fails an
error is arised, nonce too low or nonce to high)
The eth_call does not check the nonce because is using ToMessage(calls
types.NewMessage with checkNonce = false) with checkNonce disabled;
while the eth_callBundle uses AsMessage object (where is built the
Message with checkNonce = true) where the checkNonce is enabled.
Action: Disable the checkNonce as proposed
2023-01-22 07:13:28 +00:00
Alex Sharov
184c2eb5b1
e3: fix test (#6652) 2023-01-21 14:18:29 +07:00
Andrew Ashikhmin
9927ca3171
Unify Engine API V1 & V2 methods (#6638)
Reduce code duplication.

Prerequisite: https://github.com/ledgerwatch/erigon-lib/pull/841.
2023-01-20 18:43:08 +01:00
Alex Sharov
b71725ecb3
e3: reverse/limited iterators, stream tooling (#6637) 2023-01-20 18:08:20 +07:00
Alex Sharov
d317722aef
e3: storageRangeAt (#6580) 2023-01-17 14:16:36 +07:00
Devon Bear
4bfcc1ee5c
Convert *vm.EVM to vm.VMInterface in Tracers (#6590)
Useful for integration with external tools as one can just utilize an
interface opposed to having to import and build a real EVM object.
2023-01-16 22:28:50 +00:00
a
69d36f4e2d
Make websocket flag more clear (#6579)
Discord user had issue 

`
hey guys, any tips how to enable ws ? (other than --ws)? Ah its running
on 8545 by default. I was expecting it on 8546. I would like if this
could also be set by a flag same way as a HTTP flag.
`
later conversation
```
Q: yeah, is it not clear that it's enabling websocket for the http handler?
A: Its not super obvious no.
```

Adds a small copy to ws flag to make this more obvious
2023-01-16 19:10:15 +00:00
Ariel Tempelhof
f3f2c16b25
prepare state in replay blocks in callMany (#6586)
Some transactions in replayed blocks do not get reverted, although they
were originally reverted due to out of gas. This causes false balance
calculations for some addresses
2023-01-16 19:09:57 +00:00
lupin012
6338bacc95
Fix erigon_blockNumber (#6582)
erigon_blockNumber returns "latest executed block number" or any block
number requested.
In this last case the rpcBlockNum variable was not initialized
2023-01-16 10:48:43 +07:00
hexoscott
7dcbfbc283
reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
Ariel Tempelhof
89eb3ac267
block BaseFee in callMany (#6569)
Continuing the work of https://github.com/ledgerwatch/erigon/pull/6381 .
We encountered a problem in blocks with type 2 transactions,
specifically blocks with two transactions with the same `tx.from`. When
the first tx is replayed, a high `gasPrice` is being calculate in
`txn.AsMessage` causing the second replayed tx to fail with the
following error:
```
insufficient funds for gas * price + value: address ...
```
This happens in both `eth_callMany` and `debug_traceCallMany`.
This pull request follows the `debug_traceTransaction` usage of
`tx.AsMessage` in `ComputeTxEnv`
2023-01-12 16:56:22 +00:00
ledgerwatch
b658bb8f00
Fix for trace_ regression when using vmTrace for transactions with SELFDESTRUCT (#6565)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-12 10:30:15 +00:00
Andrew Ashikhmin
f33993b43c
GetEffectiveGasTip in getTxValueForBlockValue (#6559)
Small simplification to PR #6554.
2023-01-12 10:41:27 +01:00
Alex Sharov
7e9522d2d0
e3: abstract 1 tx exec, to avoid variables bloating (#6563) 2023-01-12 11:09:47 +07:00
Alex Sharov
41e9356f61
e3: stream.ToBitamp() (#6562) 2023-01-12 09:58:21 +07:00
Alex Sharov
731569bbb7
e3: invalid txnum table (#6540) 2023-01-12 09:31:41 +07:00
Max Revitt
4d09a697d0
GetPayloadV2 change (#6554)
- calculates blockValue for updated engine_getPayloadV2 spec
- adds tests for pre/post Shanghai RawBody RLP
2023-01-11 18:33:55 +01:00
alex.sharov
e22e5f933a linter 2023-01-11 15:45:18 +07:00
alex.sharov
2db82a8e4f Revert "save"
This reverts commit b080f3fcdf.
2023-01-11 15:33:25 +07:00
alex.sharov
b080f3fcdf save 2023-01-11 15:33:09 +07:00
Alex Sharov
2f97c7bf8b
extract traceFilterBitmaps method (prepare for kv.temporal) (#6553) 2023-01-11 15:01:18 +07:00
Alex Sharov
381d90a52a
eth_getLogs: add getAddrsBitmap method (#6551) 2023-01-11 11:55:16 +07:00
ledgerwatch
1149b59641
Fix for regression in trace_ processing SELFDESTRUCT (#6547)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-10 16:41:40 +00:00
Alex Sharov
2621ef45f6
e3: fix trace json (#6535) 2023-01-09 17:33:18 +07:00
alex.sharov
7aa056e179 save 2023-01-09 10:59:34 +07:00
ledgerwatch
389a2e8392
Eth call limits (#6523)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-07 21:16:43 +00:00
Alex Sharov
4c3bb1cca5
kv_temporal: DomainGet (#6511) 2023-01-06 14:27:54 +07:00
alex.sharov
9d1f0a9a33 save 2023-01-06 12:43:32 +07:00
a
06de4aeb91
filterlogs deadlock fix (#6429)
Refactors filters.go such that map+locks are now in their own class 

Move logic for safely canceling & draining channel to its own class

changed subscriptions to ask for size of buffer and construct its own
channel

marked as draft b/c need to do live testing.
2023-01-02 11:42:40 +07:00
Alex Sharov
4a9c871628
a bit rename 22 to v3 (#6476) 2022-12-30 21:53:42 +07:00
Alex Sharov
b0af04f2df
bsc: incrementally calc and store all old snapshots. slower initial stage_snapshots, but faster restart during initial sync (#6457) 2022-12-30 12:44:54 +07:00
Alex Sharov
5ec19c5b2d
fix standalone rpcdaemon block reader (#6469) 2022-12-30 10:27:02 +07:00
Alex Sharov
c04668d0ff
e3: agg cancel background jobs (#6463) 2022-12-29 15:04:07 +07:00
Alex Sharov
fa6f6038e7
kv: tx.Prefix method (#6441) 2022-12-26 17:58:21 +07:00
ledgerwatch
387b4d7f35
Native tracers step 10 - remove duplicate SelfDestruct capture, clean up (#6440)
Moved some of the tracers to `eth/tracers/logger` to make it more
similar to go-ethereum.

Removed Erigon-specific `Capture-` functions

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-26 04:56:39 +00:00
ledgerwatch
24040f3044
Native tracers step 9 - add native tracers (#6434)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-25 07:28:41 +00:00
Alex Sharov
ade933be6b
kv_remote: server to support thread-safe multi-streams per 1 tx (#6402) 2022-12-24 13:11:15 +07:00
ledgerwatch
f364eff389
Native tracers step 7 - restructure js tracer files (#6415)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-23 18:10:37 +00:00
ledgerwatch
a49e287618
Native tracers step 6: Rename Tracer to EVMLogger, reduce args CaptureExit (#6410)
Getting closer to Geth's tracer interfaces

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-23 05:43:08 +00:00
ledgerwatch
8433afd99a
Native tracers step 5 - tests for debug_traceBlock and trace_block before transformations (#6405)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-22 10:13:38 +00:00
Alex Sharov
130ab85bea
e3: kv/temporal prototype 3 (#6395) 2022-12-22 09:37:32 +07:00
Ariel Tempelhof
870b5baa19
Finalize state after each call in callMany (#6381)
In `debug_traceCallMany` and `eth_callMany` the `IntraBlockState` is not
being finalized after each replayed transaction and after each call.
This can cause several problems:

- False gas consumption calculation. Specifically in `SSTORE` dynamic
gas calculation being affected by "warm" and "cold" storage slots, and
by "original" value comparison.
- Ability to call contracts that were `SELFDESTRUCT`ed in the replayed
transactions or during previous calls, as the self-destruction has not
been finalized.

see https://github.com/ledgerwatch/erigon/issues/6373 as an example.

This pull request adds a call to `FinalizeTx` after each `ApplyMessage`
and `TraceTx`
2022-12-21 16:32:36 +07:00
Alex Sharov
c32d88f729
simplify StageLoopStep (#6390) 2022-12-21 14:39:19 +07:00
Alex Sharov
65f3af30eb
use one state reader type (#6380) 2022-12-21 11:27:14 +07:00
Willian Mitsuda
0b9eec66d0
Fix otterscan tx tracing for delegatecall (#6368)
This fixes Otterscan tx tracer, which broke on the following
refactoring:
60cb4e2bbb

It used to receive value == -1 for delegatecall, now it is receiving
nil, so we safeguard against it now.
2022-12-20 13:29:12 +07:00