Commit Graph

18568 Commits

Author SHA1 Message Date
Somnath Banerjee
a699f64761
Txpool upgrades for EIP-4844 Blob Transactions (#8004)
See https://github.com/ledgerwatch/erigon-lib/pull/1075
2023-09-11 09:38:58 +07:00
alex.sharov
008d968519 add go.work.sum to .gitignore 2023-09-11 09:36:39 +07:00
maohuazhu
34c0df8bdd
config: fix CreateConsensusEngineBareBones (#8154)
Fix ``CreateConsensusEngineBareBones`` for bor and aura. Current codes
will pass a ``**chain.BorConfig`` or ``**chain.AuraConfig to``
``CreateConsensusEngine`` and cause a panic

Co-authored-by: Maohua Zhu <zhumaohua@cobo.com>
2023-09-11 09:21:18 +07:00
Giulio rebuffo
346b278a3b
Caplin: Improved logging (#8169) 2023-09-10 22:10:21 +02:00
Andrew Ashikhmin
0ebc5fe24e
Don't mark block as bad if execution was cancelled (#8161)
A potential small fix that I made while looking at the Polygon bad
header issue (don't think it's the root cause though).
2023-09-10 11:25:02 +02:00
alex.sharov
6c1cf0a9b0 save 2023-09-10 15:49:13 +07:00
Alex Sharov
2318138c6c
Downloader: don't fail when see unusual file, skip it (backward/forward compatibility) (#8170) 2023-09-10 15:46:30 +07:00
Giulio rebuffo
6c22b77451
Added /config route to the beacon api (#8168) 2023-09-09 15:33:23 +02:00
alex.sharov
fd242ae8dd fix truncate blocks logs 2023-09-09 17:32:45 +07:00
alex.sharov
b72dd9bcbd save 2023-09-09 17:25:42 +07:00
Alex Sharov
d3ab41034d
more sepolia snapshots (#8165) 2023-09-09 17:22:44 +07:00
alex.sharov
66c94d9760 retire snapshots - nil ptr fix 2023-09-09 08:33:42 +07:00
Giulio rebuffo
5951db2e22
Added /blocks/{block_id}/root api method (#8164) 2023-09-09 00:33:24 +02:00
Giulio rebuffo
b92f6d9814
Finished jsonification of solid package (#8163) 2023-09-08 23:02:34 +02:00
Giulio rebuffo
4733f7fb52
Added json tags to beacon block (#8162) 2023-09-08 22:26:02 +02:00
Mark Holt
35c98cdce9 Added write of vm default set to metrics (#8151)
Metrics handler was missing erigon-lib metrics - which where added to
the VM default set

This fixes that whilst avoiding duplicates from erigon registrations
2023-09-08 15:28:25 +02:00
alex.sharov
97255efdb4 merge stable 2023-09-08 19:26:14 +07:00
Alex Sharov
5d3e294f3c
remove small snapshots from polygons .toml (#8158) 2023-09-08 19:09:31 +07:00
Alex Sharov
93f8a0602d
grpc v1.58 (#8157) 2023-09-08 12:32:54 +07:00
Mark Holt
8a74df8000
Added write of vm default set to metrics (#8151)
Metrics handler was missing erigon-lib metrics - which where added to
the VM default set

This fixes that whilst avoiding duplicates from erigon registrations
2023-09-07 17:48:01 +01:00
Somnath Banerjee
a9c3c90347
Fix pre cancun conditions (#8152) 2023-09-07 22:15:26 +05:30
Mark Holt
034ef63818 Strip labels when writing metric metadata (#8149)
This is a fix for 

```cache_total{target="acc_read"} counter it's invalid syntax of metric type. prometheus parsing error```

which does not remove the whole metadata tag
2023-09-07 16:25:25 +02:00
Mark Holt
077266606c
Strip labels when writing metric metadata (#8149)
This is a fix for 

```cache_total{target="acc_read"} counter it's invalid syntax of metric type. prometheus parsing error```

which does not remove the whole metadata tag
2023-09-07 16:23:13 +02:00
Giulio rebuffo
22bd173ab3
Updating Libs (#8147)
* BLS
* Sqlite
2023-09-06 23:20:26 +02:00
Somnath Banerjee
86cec41426
Update lib (#8146) 2023-09-06 22:29:19 +05:30
battlmonstr
29f348e86e p2p: limit ping requests from a single peer (#8113)
see:
https://github.com/ethereum/go-ethereum/pull/27887
2023-09-06 17:58:40 +02:00
battlmonstr
d6df923dd8
p2p: limit ping requests from a single peer (#8113)
see:
https://github.com/ethereum/go-ethereum/pull/27887
2023-09-06 17:56:03 +02:00
Andrew Ashikhmin
ba1e4679fc
Remove unused methods in version.go (#8144) 2023-09-06 11:02:04 +02:00
Alex Sharov
d60940d7db
Avoid leaking more popped items (#8145) 2023-09-06 15:47:06 +07:00
Park Changwan
ef84972e7c
Add addPeer RPC (#7804)
This PR mirrors https://github.com/testinprod-io/op-erigon/pull/54.

Actual implementation for `admin_addPeer` method.
RPC Spec: Refer to
https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-admin.

> The addPeer administrative method requests adding a new remote node to
the list of tracked static nodes. The node will try to maintain
connectivity to these nodes at all times, reconnecting every once in a
while if the remote connection goes down.

Requires https://github.com/ledgerwatch/erigon-lib/pull/1033/

After https://github.com/ledgerwatch/erigon-lib/pull/1033 is merged,
will update erigon-lib version, removing replace at go.mod.

Note that even if RPC response returns `true`, it does not guarantee
that RLPx protocol is established between peers. It just adds node
entrypoint to its static peer list, and periodically tries and tests
connections.

## Testing

This RPC needs integration testing, so I made some scenario.

Use below command for testing:

Spin up two dev nodes which p2p enabled:

Start Node 1: RPC running at port 8545:
```sh
./build/bin/erigon --datadir=dev --chain=dev --port=30303 --http.port=8545 --authrpc.port=8551 --torrent.port=42069  --no-downloader --nodiscover --private.api.addr=127.0.0.1:9090 --http --ws --http.api=admin --p2p.allowed-ports=30306,30307,30308  --authrpc.jwtsecret=/tmp/jwt1 --p2p.protocol=67,68  --log.console.verbosity=5
```

Start Node 2: RPC running at port 8546:
```sh
./build/bin/erigon --datadir=dev2 --chain=dev --port=30304 --http.port=8546 --authrpc.port=8552 --torrent.port=42068 --no-downloader --nodiscover --private.api.addr=127.0.0.1:9091 --http --ws --http.api=admin --p2p.allowed-ports=30309,30310,30311  --authrpc.jwtsecret=/tmp/jwt2  --p2p.protocol=67,68  --log.console.verbosity=5
```

Get nodeInfo of node 1 using `admin_nodeInfo` RPC:
```sh
curl --location 'localhost:8545/' \
--header 'Content-Type: application/json' \
--data '{
	"jsonrpc":"2.0",
	"method":"admin_nodeInfo",
	"params":[],
	"id":1
}' 
```
Example response:
```
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "id": "b75e0c4d2113b6f144ea8fd356a8f90e612a2a5f48a13c78d7e0e176e5724eb2",
        "name": "erigon/v2.47.0-dev-5d86cdb5/darwin-arm64/go1.19.6",
        "enode": "enode://05ab575d947f2d73065ea0f795dc2d96ed0ad603f3e730ab90dc881122d552c9f59ffcb148fe50546bec8b319daeb3c22ec02e7d12a7c4f2ac4cd26456a04a7c@127.0.0.1:30303?discport=0",
   ...
```

Get nodeInfo of node 2 using `admin_nodeInfo` RPC:
```sh
curl --location 'localhost:8546/' \
--header 'Content-Type: application/json' \
--data '{
	"jsonrpc":"2.0",
	"method":"admin_nodeInfo",
	"params":[],
	"id":2
}' 
```
Example response:
```
{
    "jsonrpc": "2.0",
    "id": 2,
    "result": {
        "id": "32d721e4d75219b021d7f83235f1f1eb8b705d6f85e634bccde564b8f7f94d78",
        "name": "erigon/v2.47.0-dev-5d86cdb5/darwin-arm64/go1.19.6",
        "enode": "enode://1abb8579647779e13b7f68d18f9c776cbd29281841c7f950e9cf9afa996e31120a6f481cea8e90e0f42a0eb1aa00aeafee81c4bae6c31aa16810b795c6d6e069@127.0.0.1:30304?discport=0",
   ...
```

Call `admin_addPeer` RPC to node 2:
```sh
curl --location 'localhost:8546/' \
--header 'Content-Type: application/json' \
--data '{
	"jsonrpc":"2.0",
	"method":"admin_addPeer",
	"params":["enode://05ab575d947f2d73065ea0f795dc2d96ed0ad603f3e730ab90dc881122d552c9f59ffcb148fe50546bec8b319daeb3c22ec02e7d12a7c4f2ac4cd26456a04a7c@127.0.0.1:30303"],
	"id":2
}' 
```
Example response:
```
{
    "jsonrpc": "2.0",
    "id": 2,
    "result": true
}
```


Check peer info of node 1 using `admin_peers` RPC:
```sh
curl --location 'localhost:8545/' \
--header 'Content-Type: application/json' \
--data '{
	"jsonrpc":"2.0",
	"method":"admin_peers",
	"params":[],
	"id":1
}' 
```
Example response:
```
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
        {
            "enode": "enode://1abb8579647779e13b7f68d18f9c776cbd29281841c7f950e9cf9afa996e31120a6f481cea8e90e0f42a0eb1aa00aeafee81c4bae6c31aa16810b795c6d6e069@127.0.0.1:55426",
            "id": "32d721e4d75219b021d7f83235f1f1eb8b705d6f85e634bccde564b8f7f94d78",
            "name": "erigon/v2.47.0-dev-5d86cdb5/darwin-arm64/go1.19.6",
            "caps": [
                "eth/66",
                "eth/67"
            ],
            "network": {
                "localAddress": "127.0.0.1:30303",
                "remoteAddress": "127.0.0.1:55426",
                "inbound": true,
                "trusted": false,
                "static": false
            },
            "protocols": null
        }
    ]
}
```

---------

Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2023-09-06 15:31:02 +07:00
Alex Sharov
1c4819ffe3
compress.Next: return empty byte slice instead of nil when wordLen == 0 (#8143) 2023-09-06 15:03:16 +07:00
Alex Sharov
ff54df073e
etl: do sort and file flush in another goroutine (#7915) 2023-09-06 14:51:23 +07:00
alex.sharov
1160df12a3 save 2023-09-06 14:44:51 +07:00
Alex Sharov
4e1c86e5a2
deps up (after release) (#8142) 2023-09-06 14:43:48 +07:00
Alex Sharov
0b633cfa08
txpool: switch db to durable mode - with fsync outside of pool's global lock (#8141) 2023-09-06 14:30:36 +07:00
Andrew Ashikhmin
75be4fee3d
stable VersionModifier (#8138) 2023-09-06 08:44:01 +02:00
yperbasis
a6a0a851b6 Bump release version 2023-09-06 08:29:28 +02:00
Alex Sharov
b8f1955f96
prometheus can't parse metric type fix (#8137) 2023-09-06 12:40:21 +07:00
alex.sharov
e33561e960 save 2023-09-06 10:33:18 +07:00
alex.sharov
70908def7e merge stable into devel 2023-09-06 10:26:13 +07:00
alex.sharov
09772da881 Merge branch 'stable' into devel 2023-09-06 10:24:35 +07:00
Alex Sharov
608341b636
shutdown deadlock (#8135) 2023-09-06 10:23:59 +07:00
Alex Sharov
6c0c0ef75e exec server: run 1st cycle not in global txn. run exec in async tx, run prune in sync tx. partial progress loss fix (partial fix) (#8128) 2023-09-06 10:23:11 +07:00
Giulio rebuffo
544d4188af Fixed snapshots logging (#8132)
Problem was errgroup subroutines finished before their logs could
internally trigger
2023-09-06 10:03:54 +07:00
Giulio rebuffo
fccc563f69
Fixed snapshots logging (#8132)
Problem was errgroup subroutines finished before their logs could
internally trigger
2023-09-06 09:59:54 +07:00
Alex Sharov
1c4eb4f280
fix macos user homedir in makefile (#8133) 2023-09-06 09:49:08 +07:00
Alex Sharov
13fc0f2a7e
exec server: run 1st cycle not in global txn. run exec in async tx, run prune in sync tx. partial progress loss fix (partial fix) (#8128) 2023-09-06 08:48:07 +07:00
Giulio rebuffo
841327e212
BeaconAPI: Implemented /Spec (#8131) 2023-09-05 22:37:18 +02:00
Alex Sharov
8983128d24
Restore genesis reads code - remote rpc case. Remove ctx parameter from baseApi func (tx already has internal ctx) (#8122) 2023-09-04 12:42:08 +07:00
Giulio rebuffo
1cfb1eb1e7
Caplin: fixed canonical tracking (#8120) 2023-09-03 13:40:10 +02:00