Commit Graph

17311 Commits

Author SHA1 Message Date
Alex Sharov
5f77c8a025
Snap flags docs (#6302) 2022-12-14 11:09:13 +07:00
Alex Sharov
1b4dbefa95
grafana/prometheus version up (#6301) 2022-12-14 10:57:47 +07:00
Alex Sharov
99a3ab88f2
e3: cli command to retire/prune history (#6300) 2022-12-14 10:01:11 +07:00
alex.sharov
b9e54fa2e1 save 2022-12-14 09:53:38 +07:00
Alex Sharov
ce9203d80d
e3: more aggressive prune #780 (#6299) 2022-12-14 09:50:48 +07:00
Alex Sharov
fed1be256c
e3: auto-remove useless files (#6298) 2022-12-14 09:03:16 +07:00
Alex Sharov
f92f525d8f
e3: return err from parallel exec (#6283) 2022-12-14 09:02:57 +07:00
ledgerwatch
f03d29293c
Kick useless peers instead of putting them on stand-by (#6296)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-13 22:21:10 +00:00
Enrique Jose Avila Asapche
287a3d1d6c
added erigon_GetBlockReceiptsByBlockHash (#6292)
I added a way to get canonical receipts through block hash under the
erigon name space
#6229


Tested: 
BlockHash:
0xb5d50393734894e02a94a500a5a5aade9c66f388438aeed8d7775b3b344745f1
<img width="1727" alt="Screenshot 2022-12-12 at 22 16 18"
src="https://user-images.githubusercontent.com/19207637/207166860-436ecf26-a777-4b2f-8377-22acec732486.png">
2022-12-13 20:41:51 +00:00
Andrew Ashikhmin
1e206e375b
Set default for externalcl based on whether embedded CL is supported (#6294)
Embedded CL is not supported for Gnosis Chain, so it makes sense to set
`externalcl` to true by default for it.

Also, this PR sets `terminalTotalDifficultyPassed` for Gnosis Chain &
Chiado (see https://docs.gnosischain.com/updates/20221210-merge).
2022-12-13 14:51:13 +01:00
ledgerwatch
5616ec2529
Disable validator set check in historical due to BEP-131, restore Ske… (#6290)
…letons

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-12 20:46:20 +00:00
Changyoung Koh
27ec4f02d7
Fix Trace RPCs for Bor Transactions (#6288)
FIrst of all, thanks in advance for your advice.

I've found that `trace_replayTransaction` is having trouble tracing some
Polygon State Sync transactions such as
[`0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131`](https://polygonscan.com/tx/0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131),
just like [the case of the previous PR][p].

[p]: https://github.com/ledgerwatch/erigon/pull/6286

```shell
$ curl -XPOST 'http://localhost:8545' \
      -H 'Content-Type: application/json' \
     --data '{"method":"trace_replayTransaction","params":["0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131",["trace","stateDiff"]],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"result":null}
```

This is because RPCDaemon doesn't query for blocks by Bor Hash, even
though `api.txnLookup` has failed. Same as #6286.
2022-12-12 16:39:17 +00:00
Changyoung Koh
72de9410d7
Fix eth_getTransactionReceipt for Bor Transactions (#6289)
Same as #6286 and #6288

This patch closes #6276 

```shell
$ curl -XPOST 'http://localhost:8545' \
     -H 'Content-Type: application/json' \
     --data '{"method":"eth_getTransactionReceipt","params":["0x31ce15ce9a1ff347f4204a1ed3625861165c53ae08743c1f36a32865c62744c6"],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"block has less receipts than expected: 0 \u003c= 0, block: 36635776"}}
```

cc. @0xKrishna
2022-12-12 15:21:30 +00:00
Changyoung Koh
4c02fef323
Fix eth_getTransactionByHash for Bor Transactions (#6286)
FIrst of all, thanks in advance for your advice.

I've found that `eth_getTransactionByHash` is having trouble retrieving
some Polygon State Sync transactions such as
[`0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131`](https://polygonscan.com/tx/0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131),
while `eth_getBlockByNumber` can retrieve them without problem.

```shell
$ curl -XPOST 'http://localhost:8545' \
     -H 'Content-Type: application/json' \
     --data '{"method":"eth_getTransactionByHash","params":["0xd5f4f8c3cd85cf65e8df23a2c1ae02aefda1e6293db0c3a9ddcc08cee8ca1131"],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"result":null}
```

This is because RPCDaemon doesn't query for blocks by Bor Hash, even
though `api.txnLookup` has failed.
2022-12-12 13:26:00 +00:00
awskii
a124bcf6ac
added --p2p.allowed-port flag (#6263)
Regarding https://github.com/ledgerwatch/erigon/issues/6260

added flag `--p2p.allowed-ports=<porta>,<portb>` to restrict which ports
to use for sentries for different protocol versions.

Default for this flag is `30303, 30304` (first port is inherited from
`--port` flag defaults.
If `--port` is changed and it's new value is not presented in allowed
port list, provided port will be allowed as well as list provided via
`--p2p.allowed-ports`

Port picking is straightforward, we create sentry gRPC server for
protocol over first allowed port that is not already taken.
If there are no allowed ports left, erigon exits with hint.
2022-12-12 13:25:47 +00:00
hexoscott
c0d2523b06
reset txpool yielded flags before starting mining (#6284) 2022-12-12 17:27:57 +07:00
Alex Sharov
9d20045ad3
e3: reconDB - to use 64kb pageSize (#6282) 2022-12-12 14:06:33 +07:00
ledgerwatch
1c3c486d00
Avoid using peers returning empty responses, not sending skeleton requests (#6281)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-11 23:03:10 +00:00
ledgerwatch
ec582dd9b3
Bump version (#6280) 2022-12-11 15:17:55 +00:00
ledgerwatch
4ab76849d8
Use old method of peer selection for non-POS networks (#6279)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-11 15:14:49 +00: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
Giulio rebuffo
0f0d0de783
Use of proper beacon state interface (#6277) 2022-12-11 15:12:38 +01:00
Alex Sharp
d8ae12b6fd Revert "Add passive peer parameter"
This reverts commit 786179646b.
2022-12-11 12:33:08 +00:00
Alex Sharp
786179646b Add passive peer parameter 2022-12-11 12:32:47 +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
df21079ae0
vmTrace - prevent panic at stack underflow (#6275)
Fixes https://github.com/ledgerwatch/erigon/issues/4778

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-10 22:41:14 +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
983f41790d
Fetch header correctly (including snapshots) for debug_traceCall, fix… (#6273)
… formatting when error

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

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-10 15:22:07 +00:00
Mike Neuder
f512c887dc
Add ComputeShuffledIndex algorithm. (#6267)
This is described in:
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_shuffled_index.

I ran the prysm implementation locally to generate the expected outputs:
babfc66c5b/beacon-chain/core/helpers/shuffle.go (L73)

Part of https://github.com/ledgerwatch/erigon/issues/5965
2022-12-10 13:59:29 +01: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
Alex Sharov
e21b1b6e25
e3: commit earlier (#6271) 2022-12-10 16:00:19 +07:00
Alex Sharov
b4fd07b671
e3: earlier flush (#6227) 2022-12-10 15:53:58 +07:00
Giulio rebuffo
5ba6859c92
Added Fully-Working State Trie Computation to Beacon State (#6268) 2022-12-10 01:08:49 +01:00
ledgerwatch
3d7b36e09a
Trace block formatting fix, error handling formatting fix (#6266)
Fixes https://github.com/ledgerwatch/erigon/issues/4935

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-09 22:16:41 +00:00
Giulio rebuffo
1c8a11df40
Added dirty leaves system to beacon state (#6264) 2022-12-09 19:19:01 +01:00
hexoscott
47a6f86f76
use a shared simulated tx when mining (#6253)
This ensures that the filter bad transactions can use the same context
each time, so increases an account nonce in the first batch of
transactions is committed to the simulation just in case the same
account appears in the next batch of transactions.

Also makes use of the new txpool candidate functionality to ensure we're
getting fresh transactions each time.
2022-12-09 21:16:10 +07:00
Max Revitt
ebea8298df
feat(ci): run 2x dev nodes for automated-testing (#5346) 2022-12-09 20:07:57 +07:00
Alex Sharov
5c05ff4c2a
Exec new blocks in TxnNoSync. Prune after sending notifications in TxnSync (#6222)
Change from: 
```
begin(TxNoSync)
exec new block, index nee data
do limited pruning 
commit()
send notifications about new data arrival to other apps, they may start reading new data at this time (by new read transactions) 
```
Change to: 
```
begin(TxNoSync)
exec new block, index nee data
commit() // no fsync here
send notifications about new data arrival to other apps, they may start reading new data at this time (by new read transactions) 
begin()
do pruning 
commit() // fsync here
```

it allows notify earlier. Fsync (of all changes) on modern drives is
fast, but on cloud-drives it’s about 1sec in worst cases.
2022-12-09 19:48:56 +07:00
Max Revitt
722d357844
cmd: initialize config before logger (#6251)
Co-authored-by: nanevardanyan <nanevardanyants@gmail.com>
2022-12-09 18:04:47 +07:00
Krishna Upadhyaya
9b9417f746
Fix bor-devent config by genesis hash (#6257) 2022-12-09 18:04:08 +07:00
Giulio rebuffo
ecf34b2493
Proper Beacon State Repressentation attempt (#6254) 2022-12-09 00:55:31 +01:00
Martin Holst Swende
40b28d70a2
cmd/evm: show staterooot in result from running statetest (#6252)
Closes #6244
2022-12-08 21:37:02 +00:00
ledgerwatch
70b18aff1f
Bump version (#6249) 2022-12-08 08:31:54 +00:00
ledgerwatch
cf237138d7
Kludge for BSC eth/67 errors (unknown message code 11) (#6248)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-08 08:01:55 +00:00
ledgerwatch
35c279d291
Optimize modexp (#6247)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-08 06:43:40 +00:00
Max Revitt
5d767e2b2c
tweak(makefile): pull hive container before hive run (#6241) 2022-12-08 05:51:24 +07:00
hexoscott
c48040ca33
fix nil pointer in getting next transactions mining_exec (#6242) 2022-12-08 05:50:56 +07:00
Giulio rebuffo
0da12e4c94
Verification by root and not by slot (#6243) 2022-12-07 21:26:45 +01:00
Andrew Ashikhmin
7eab12d90d
Shanghai & Cancun forks should be based on timestamp (#6238) 2022-12-07 18:45:44 +01:00