Commit Graph

17143 Commits

Author SHA1 Message Date
Giulio rebuffo
14cf0771a4
slight modification to computation of indexes (#6345) 2022-12-17 01:01:24 +01:00
awskii
222dc96581
add missed break clause during protocols port picking (#6343)
Missing break clause leaded to unnecessary incrementing of `pi` when
port is already picked.
2022-12-16 16:59:22 +00:00
Andrew Ashikhmin
9d1e4ec37f
Update Gnosis Chain boot nodes (#6340)
See https://github.com/NethermindEth/nethermind/pull/5007
2022-12-16 14:41:09 +01:00
Giulio rebuffo
de8bae6fe0
optimized beacon state computation (#6341) 2022-12-16 13:38:54 +01: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
ledgerwatch
56e64fcb24
Change block snapshots (#6338)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-16 08:38:02 +00:00
ledgerwatch
66c44a739e
Add another mainnet block snapshot range (15.5m - 16m) (#6330)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-16 08:24:17 +00:00
Alex Sharov
2f143523d5
e3: to fix integration test (#6337) 2022-12-16 14:21:38 +07:00
Alex Sharov
d95f0ca51e
e3: apply inline-retry (#6336) 2022-12-16 14:14:00 +07:00
Alex Sharov
43f83cd7d8
e3: use of ordered-map generic (#6335) 2022-12-16 13:59:57 +07:00
Alex Sharov
895fe97f29
e3: fix devel overlap tx (#6334) 2022-12-16 13:13:18 +07:00
Alex Sharov
625bb39a82
E3: unlimited inline-apply (#6333) 2022-12-16 12:22:52 +07:00
Alex Sharov
a8c5318c56
e3: exec tx right after conflict (but only 1 such exec per applyLoopStep) (#6332) 2022-12-16 11:10:12 +07:00
Mike Neuder
d1f6ed29ff
Add ComputeProposerIndex (#6297)
This is described in
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_proposer_index.

Part of https://github.com/ledgerwatch/erigon/issues/5965

I compared with the Prysm tests to confirm the implementation is
correct:
2e49fdb3d2/beacon-chain/core/helpers/validators_test.go (L506-L614)
2022-12-16 00:06:49 +01:00
ledgerwatch
cb04e1166c
Fix precompile filtering in trace_ methods (#6328) 2022-12-15 18:54:05 +00:00
ledgerwatch
e4d4a985b4
Demote TxLookup warning to debug (#6327) 2022-12-15 15:24:29 +00:00
Andrew Ashikhmin
4b289ce83e
Apply AuRa rewards even after Merge (#6310) 2022-12-15 15:00:00 +00:00
ledgerwatch
0a5fa7463d
gas estimation to use a fresh intrablock state (#6326)
Co-authored-by: Scott Fairclough <scott@hexosoft.co.uk>
2022-12-15 12:25:42 +00:00
ledgerwatch
0104698033
Not kick static and trusted peers due to empty responses (#6325)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-15 12:25:35 +00:00
formatting
7fee016cf4
Fix eth_getBlockByNumber and eth_getTransactionReceipt some bugs for polygon (#6319)
Get bor state sync tx and receipt has some error:

```
Reqeust:
curl -X "POST" "{{polygon_rpc_endpoint}}" -H 'Content-Type: application/json; charset=utf-8' -d $'{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getTransactionByHash",
  "params": [
    "0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad"
  ]
}'

Response:
{"jsonrpc":"2.0","id":1,"result":null}
```

```
Reqeust:
curl -X "POST" "{{polygon_rpc_endpoint}}" -H 'Content-Type: application/json; charset=utf-8' -d $'{
  "id": 1,
  "method": "eth_getTransactionReceipt",
  "jsonrpc": "2.0",
  "params": [
    "0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad"
  ]
}'

Response
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"EOF"}}
```


fixed:

```
Request:
curl -X "POST" "{{polygon_rpc_endpoint}}" -H 'Content-Type: application/json; charset=utf-8' -d $'{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getTransactionByHash",
  "params": [
    "0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad"
  ]
}'

Response:
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","blockNumber":"0x1c317c0","from":"0x0000000000000000000000000000000000000000","gas":"0x0","gasPrice":"0x0","hash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","input":"0x","nonce":"0x0","to":"0x0000000000000000000000000000000000000000","transactionIndex":"0x89","value":"0x0","type":"0x0","chainId":"0x89","v":"0x0","r":"0x0","s":"0x0"}}
```

```
curl -X "POST" "{{polygon_rpc_endpoint}}" -H 'Content-Type: application/json; charset=utf-8' -d $'{
  "id": 1,
  "method": "eth_getTransactionReceipt",
  "jsonrpc": "2.0",
  "params": [
    "0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad"
  ]
}'
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","blockNumber":"0x1c317c0","contractAddress":null,"cumulativeGasUsed":"0x0","effectiveGasPrice":"0xd532a03e6","from":"0x0000000000000000000000000000000000000000","gasUsed":"0x0","logs":[{"address":"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000038830f36f752ed29039f441cfb543639a6e07b41"],"data":"0x000000000000000000000000000000000000000000000000009c51c4521e0000","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2ee","removed":false},{"address":"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000f93bcb6f00c1a90050a60a9f737b4cb87126b8f8"],"data":"0x000000000000000000000000000000000000000000000000006a6674f260d000","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2ef","removed":false},{"address":"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000fd1091c0e49bf1d44b4786747e034d65ab46f36e"],"data":"0x000000000000000000000000000000000000000000000000002386f26fc10000","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2f0","removed":false},{"address":"0x7f280dac515121dcda3eac69eb4c13a52392cace","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000882d04c3d8410ddf2061b3cba2c3522854316feb"],"data":"0x000000000000000000000000000000000000000000001850e2f557310490f925","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2f1","removed":false},{"address":"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000028515b56512cb168ad6e6a2428bb39cb696d8bee"],"data":"0x0000000000000000000000000000000000000000000000000058d15e17628000","blockNumber":"0x1c317c0","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","blockHash":"0xb308eeda80e2a20e1f934d5d37e5f82a078b828128a60283978286ddf0a25264","logIndex":"0x2f2","removed":false}],"logsBloom":"0x000000000100a0000000000000000000000000000040000000000000000000000000000000000020000000000000000000000000000080000000000000000800000000000000000000000008000000000800000000000000040000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000020000002000000000008000000001000000000000002000000000000000020001000040000008000000000000000000080000000000000000000000000000000","status":"0x1","to":"0x0000000000000000000000000000000000000000","transactionHash":"0x9916e99b24daba1fb01e093105bc6988b49125ea15fd4b3c4cfa18719e1631ad","transactionIndex":"0x89","type":"0x0"}}
```
2022-12-15 11:13:52 +00:00
ledgerwatch
71fb4ccc8e
Workaround for gnosis chain POS downloader (#6315)
Workaround for https://github.com/ledgerwatch/erigon/issues/6308

Very inefficient, because it get 1 single header from the request of 192
headers, so moves quite slowly

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-15 11:13:28 +00:00
Alex Sharov
b2bf12827c
e3: cancel background build (#6323) 2022-12-15 17:18:00 +07:00
Enrique Jose Avila Asapche
e5ddccf212
Disable ipv6 flag (#6295)
This was a great idea #6261 
Added two new flags to turn off downloader ipv6 and/or ipv4 usage
2022-12-15 16:40:59 +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
Enrique Jose Avila Asapche
941a228ec9
fixed tx index being empty (#6316)
#6309
2022-12-15 09:53:14 +07:00
Alex Sharov
7de7b37418
hash_state/ih: enable ReadAhead for "promote cleanly" case (#6317) 2022-12-15 09:25:31 +07:00
Igor Mandrigin
94d12a5d3c
fix debug_traceBlock* methods for Gnosis Chain (#6312) 2022-12-14 16:06:24 +01:00
alex.sharov
62125a0dc1 save 2022-12-14 21:41:54 +07:00
Igor Mandrigin
786610df3f
Fix debug_traceTransaction on Gnosis Chain (#6311)
Support 0-gas service transactions in tracing module.
2022-12-14 14:35:28 +01:00
ledgerwatch
47692bb334
Prevent empty responses to skeleton requests (#6305)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-14 12:02:23 +00:00
Andrew Ashikhmin
98f6743726
Temporary boot nodes for Gnosis Chain (#6306)
See https://docs.gnosischain.com/updates/20221208-temporary-bootnodes
2022-12-14 11:19:02 +01:00
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