Commit Graph

2726 Commits

Author SHA1 Message Date
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
Andrew Ashikhmin
400ad1ab09
Update EIP-3860 according to ethereum/EIPs/pull/6040 (#6161)
See https://github.com/ethereum/EIPs/pull/6040 &
https://github.com/ethereum/tests/pull/1105
2022-11-30 12:19:16 +01:00
alex.sharov
948b325062 save 2022-11-30 14:59:08 +07:00
Alex Sharov
7239387de0
fix devel build (#6154) 2022-11-30 08:35:31 +07:00
Alex Sharov
60cb4e2bbb
evm tracing interface to use uint256, to avoid value.ToBig() allocations (#5781) 2022-11-30 08:31:39 +07:00
Alex Sharov
16cd87748f
E3: fix unwind changes visibility (#6147) 2022-11-30 08:31:13 +07:00
J1ang
83dae8dad3
feat: enhance API erigon_getLatestLogs (#6078)
feat:
1. `erigon_getLatestLogs` doesn't have to match the exact position of
the topics. It will match logs that contain the topics regardless of the
topics' position with original bloom filter. And it accepts `blockCount`
& `crit.ToBlock` params for better pagination.
2022-11-29 15:14:41 +07:00
hexoscott
0094d1301a
reusable evm caller for purpose of eth_estimateGas (#6112)
One simple change to send the header in rather than the body allowing
re-use in a loop which saves the copy call when looping.

The other one for a reusable evm seems potentially dangerous so feedback
more than welcome on that one, local testing shows it gains me around
6k±rps so if it's safe is a good win, but I feel it will need more work.
I could only validate against goerli chain which seems to always return
the same value for eth_estimateGas so if anybody could validate it
against another chain that would be awesome.
2022-11-28 09:03:03 +07:00
Giulio rebuffo
54d1895542
updated go-verkle (#6126) 2022-11-26 19:36:10 +01:00
Andrew Ashikhmin
03057c4e61
Update consensus tests to v11.2 (#6111)
[v11.2](https://github.com/ethereum/tests/releases/tag/v11.2) includes,
among other things, tests for
[EIP-3860](https://eips.ethereum.org/EIPS/eip-3860): Limit and meter
initcode.
2022-11-22 16:07:31 +01:00
Philippe Schommers
6f61f556a2
test: add fork id tests for Gnosis and Chiado (#6110)
Feels like there's an issue with the latest hardfork
(https://docs.gnosischain.com/specs/hard-forks/21735000), as the fork id
didn't change?

Related: https://github.com/NethermindEth/nethermind/pull/4925
2022-11-22 16:03:36 +01:00
Andrew Ashikhmin
0b28c7ad13
Support genesis constructors for Chiado (#6103)
This is a continuation of PR #6058 and fixes Chiado genesis state root
by supporting genesis constructors (deployment code).
2022-11-21 17:21:59 +01:00