Commit Graph

2737 Commits

Author SHA1 Message Date
alex.sharov
dd9f117a0c save 2022-12-20 22:27:11 +07:00
Max Revitt
4bdb35f94c
Withdrawals part 2 (#6180)
Continuation of PR #6009. Storage and retrieval of withdrawals.

- [x] storage of withdrawals on writeblock
- [x] composite key (block number | block hash)
- [x] value ([]withdrawal)
- [x] retrieval of withdrawals with block
- [x] tests around storing/retrieving withdrawals
- [x] tested in hive
- [x] commits tidied


## Hive Failures
- [x] Withdrawals Fork on Block 2
- [x] Withdrawals Fork on Block 3
- [ ] Sync after 2 blocks - Withdrawals on Block 1 - Single Withdrawal
Account - No Transactions ( Syncing client rejected valid chain)
- [ ] Sync after 2 blocks - Withdrawals on Block 1 - Single Withdrawal
Account (Timeout while waiting for secondary client to sync)
- [ ] Sync after 2 blocks - Withdrawals on Genesis - Single Withdrawal
Account (Timeout while waiting for secondary client to sync)
- [ ] Sync after 2 blocks - Withdrawals on Block 2 - Single Withdrawal
Account - No Transactions (Syncing client rejected valid chain)
- [ ] Sync after 2 blocks - Withdrawals on Block 2 - Single Withdrawal
Account (Timeout while waiting for secondary client to sync)
- [ ] Sync after 128 blocks - Withdrawals on Block 2 - Multiple
Withdrawal Accounts (Unexpected error on BalanceAt: Post
"http://172.17.0.4:8545/": context deadline exceeded, expected=<None>)
- [ ] Withdrawals Fork on Block 1 - 8 Block Re-Org, Sync (Expected no
error on EngineNewPayloadV2: error=Post "http://172.17.0.4:8551/":
context deadline exceeded)
- [ ] Withdrawals Fork on Block 8 - 10 Block Re-Org Sync (Expected no
error on EngineNewPayloadV2: error=Post "http://172.17.0.4:8551/":
context deadline exceeded)
- [ ] Withdrawals Fork on Canonical Block 8 / Side Block 7 - 10 Block
Re-Org Sync (Expected no error on EngineNewPayloadV2: error=Post
"http://172.17.0.4:8551/": context deadline exceeded)
- [ ] Withdrawals Fork on Canonical Block 8 / Side Block 9 - 10 Block
Re-Org Sync (Expected no error on EngineNewPayloadV2: error=Post
"http://172.17.0.4:8551/": context deadline exceeded)
2022-12-20 09:09:04 +00:00
Andrew Ashikhmin
31d30df59f
core/vm: fill gaps in jump table with opUndefined (#6372)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/24031

Co-authored-by: Paweł Bylica <chfast@gmail.com>
2022-12-20 08:18:24 +01:00
Alex Sharov
cce0f251b4
e3: kv/temporal prototype 2 (#6377) 2022-12-20 09:28:10 +07:00
Andrew Ashikhmin
e5f818c832
core/vm: remove unused 'unofficial' opcodes (#6371)
Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-12-19 14:47:29 +01:00
Andrew Ashikhmin
a00a4000a4
core/vm: simplify op lookup in contract (#6370)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/23974

Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
2022-12-19 14:10:45 +01:00
Alex Sharov
dfa6505f93
e3: kv/temporal prototype (#6367) 2022-12-19 15:38:54 +07:00
ledgerwatch
97c9a9108d
Native tracers - step 4 (#6363)
Remove `callType` argument from `CaptureStart`, and change `callType
vm.CallType` to `typ vm.OpCode` in `CaptureEnter` and move to the first
position (as it is in geth)

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-19 03:12:08 +00:00
ledgerwatch
0761671607
Native tracers step 3 (#6362)
Remove `env` argument from all Capture functions except for
`CaptureStart`

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-18 17:06:40 +00:00
ledgerwatch
b8c6a4d263
Native tracers - step 2 (#6360)
Splitting function `CaptureStart` into `CaptureStart` (when depth == 0)
and `CaptureEnter` (when depth > 0), while removing argument `depth`.
Same with splitting `CaptureEnd` into `CaptureEnd` and `CaptureExit`

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-18 16:11:31 +00:00
ledgerwatch
3999c46046
Native tracers - step 1 (#6356)
In this first step, the new functions `CaptureTxStart` and
`CaptureTxEnd` are introduced to all tracers

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-18 04:36:57 +00:00
alex.sharov
c5d720591a save 2022-12-18 11:10:40 +07:00
Alex Sharov
4ef39ea43c
unify logs a bit (#6354) 2022-12-18 09:23:11 +07:00
Andrew Ashikhmin
0fc2022a0e
Extend fork ID to timestamp-based forks (#6324)
Starting from
[Shanghai](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md),
forks are based on timestamps rather than block heights (see PR #6238).
This PR extends [EIP-2124](https://eips.ethereum.org/EIPS/eip-2124) Fork
ID to include timestamp-based blocks. See also
https://github.com/ethereum/go-ethereum/pull/25878.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2022-12-16 12:08:54 +01:00
Alex Sharov
43f83cd7d8
e3: use of ordered-map generic (#6335) 2022-12-16 13:59:57 +07:00
Roberto Bayardo
cf6173d042
Make empty but non-nil Withdrawals arrays decode as empty but non-nil. (#6291) 2022-12-15 08:52:14 +00:00
Alex Sharov
863e1ed07b
e3: handle "kill -9" during merge, auto-hide history .ef file if not corresponding .v file (#6304) 2022-12-15 13:49:06 +07:00
Alex Sharov
ce9203d80d
e3: more aggressive prune #780 (#6299) 2022-12-14 09:50:48 +07:00
ledgerwatch
556a81ce6f
Fix tests (#6278)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-11 14:57:24 +00:00
Alex Sharov
7a055a51d4
e3: graceful shutdown (#6272) 2022-12-11 13:15:55 +07:00
Andrew Ashikhmin
ecefc53dd0
Remove Ropsten & Fermion (#6262)
See https://blog.ethereum.org/2022/11/30/ropsten-shutdown-announcement
2022-12-10 22:55:31 +00:00
ledgerwatch
0a31f5ac2a
Workaround for the code history of BSC system contracts (#6274)
Works around a flaw in the upgrade logic of the system contracts. Since
they are updated directly, without first being self-destructed and then
re-created, the usual incarnation logic does not get activated, and all
historical records of the code of these contracts are retrieved as the
most recent version. This problem will not exist in erigon3, but until
then, a workaround will be used to access code of such contracts through
a special structure, `SystemContractCodeLookup`

Fixes https://github.com/ledgerwatch/erigon/issues/5865

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-10 22:41:04 +00:00
ledgerwatch
b5a7faa8db
[e3] Incremental reconstitution (#6270)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-10 09:34:17 +00:00
ledgerwatch
35c279d291
Optimize modexp (#6247)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-08 06:43:40 +00:00
Andrew Ashikhmin
7eab12d90d
Shanghai & Cancun forks should be based on timestamp (#6238) 2022-12-07 18:45:44 +01:00
hexoscott
499c40fe4f
fix for nil pointer dereference in mining (#6237) 2022-12-07 16:54:22 +00:00
Krishna Upadhyaya
d5199f521b
Added delhiBlock for mumbai-hard-fork (#6233) 2022-12-07 18:34:14 +07:00
calmbeing
0ad765930d
Apply BSC Gibbs upgrade for mainnet (#6211)
For issue #6163, based on pr #5359 of Gibbs , Supported BSC mainnet
Gibbs hardfork
2022-12-07 18:20:14 +07:00
Alex Sharov
12ee33a492
e3: don't put nil to pool (#6219) 2022-12-06 13:07:16 +07:00
Alex Sharov
4e25872e91
e3: use fact that lifecycle of readList smaller than State22 and RoTx (#6212) 2022-12-06 10:11:03 +07:00
Alex Sharov
f9cf18a4ac
e3: pool read list (#6210) 2022-12-05 18:48:08 +07:00
Alex Sharov
061c4ef744
E3: some clean (#6209) 2022-12-05 10:23:49 +07:00
Håvard Anda Estensen
1398703bc5
Use hex package to convert bytes to string (#6205) 2022-12-05 09:06:16 +07:00
Alex Sharov
e3085f9290
e3: experiment with btree "path hint" (#6158) 2022-12-04 18:15:28 +07:00
Alex Sharov
4ffd50c716
hashers to use sync.pool (#6200)
for https://github.com/ledgerwatch/erigon/issues/6195
2022-12-04 17:23:44 +07:00
Alex Sharov
60802ebc78
evm: one pointer is enough (#6198) 2022-12-04 12:40:03 +07:00
Nicolas Gotchac
961a0070cc
Fix trace error in Polygon | Pass Engin to the Base API (#6131)
So there is an issue with tracing certain blocks/transactions on
Polygon, for example:
```
> '{"method": "trace_transaction","params":["0xb198d93f640343a98f90d93aa2b74b4fc5c64f3a649f1608d2bfd1004f9dee0e"],"id":1,"jsonrpc":"2.0"}'
```
gives the error `first run for txIndex 1 error: insufficient funds for
gas * price + value: address 0x10AD27A96CDBffC90ab3b83bF695911426A69f5E
have 16927727762862809 want 17594166808296934`

The reason is that this transaction is from the author of the block,
which doesn't have enough ETH to pay for the gas fee + tx value if he's
not the block author receiving transactions fees.

The issue is that currently the APIs are using `ethash.NewFaker()`
Engine for running traces, etc. which doesn't know how to get the author
for a specific block (which is consensus dependant); as it was noting in
several TODO comments.

The fix is to pass the Engine to the BaseAPI, which can then be used to
create the right Block Context. I chose to split the current Engine
interface in 2, with Reader and Writer, so that the BaseAPI only
receives the Reader one, which might be safer (even though it's only
used for getting the block Author).
2022-12-04 12:17:39 +07:00
Alex Sharov
63b88c7d16
use crypto pool (#6197) 2022-12-04 11:59:02 +07:00
Alex Sharov
c401a2e9d2
e3: experiment with Ibs.Reset (#6159) 2022-12-04 11:45:06 +07:00
Alex Sharov
82c7779a85
evm: txContext.gasPrice to uint256 type (#6188) 2022-12-04 11:44:50 +07:00
Håvard Anda Estensen
31ec791d5a
Avoiding leaking the popped item (#6193)
Set the deleted item to its zero val so it can be garbage collected.
2022-12-04 11:17:02 +07:00
Alex Sharov
0efda1f19f
trace: change type of self destruct arg to uint256 (#6189) 2022-12-03 21:43:53 +07:00
Alex Sharov
9b65c533c9
e3: optimize incremental hashstate (#6179) 2022-12-03 12:23:01 +07:00
Giulio rebuffo
1fd3a01edf
Added Consensus Layer staged sync (#6183) 2022-12-03 03:16:26 +01:00
Alex Sharov
c7c445e167
e3: reset without race (#6177) 2022-12-02 11:46:25 +07:00
Alex Sharov
509a8d9b50
e3: reset table (#6176) 2022-12-02 09:17:05 +07:00
Andrew Ashikhmin
d82c778ab3
Withdrawals part 1 (#6009)
This PR partially implements
[EIP-4895](https://eips.ethereum.org/EIPS/eip-4895): Beacon chain push
withdrawals as operations. The new Engine API methods
(https://github.com/ethereum/execution-apis/pull/195) are implemented.

_Body downloader and saving withdrawals into DB are not implemented
yet!_
2022-12-01 09:15:01 +01:00
Alex Sharov
fd3c44f6e1
e3: fix dao integration test (#6171) 2022-12-01 14:42:39 +07:00
alex.sharov
5d9e74d39c save 2022-12-01 13:47:35 +07:00
Alex Sharov
cb8f609dc0
e3: fix nil ptr bsc (#6162) 2022-11-30 18:24:42 +07:00