Commit Graph

24 Commits

Author SHA1 Message Date
Mark Holt
5935b11b24
Devnet macos startup and windows committed memory startup fixes (#7832)
The fixes here fix a couple of issues related to devnet start-up

1. macos threading and syscall error return where causing multi node
start to both not wait and fail
2. On windows creating DB's with the default 2 TB mapsize causes the os
to reserve about 4GB of committed memory per DB. This may not be used -
but is reserved by the OS - so a default bor node reserves around 10GB
of storage. Starting many nodes causes the OS page file to become
exhausted.

To fix this the consensus DB's now use the node's OpenDatabase function
rather than their own, which means that the consensus DB's take notice
of the config.MdbxDBSizeLimit.

This fix leaves one 4GB committed memory allocation in the TX pool which
needs its own MapSize setting.

---------

Co-authored-by: Alex Sharp <akhounov@gmail.com>
2023-07-02 22:37:23 +01:00
ledgerwatch
90cb6be425
[devnet tool] fixing port conflicts (#7520)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-05-15 20:31:35 +01:00
Andrew Ashikhmin
cc11462860
Prioritize eth/68 by default (#7463)
Set `DefaultConfig.ProtocolVersion` to [68, 67, 66] instead of [67, 68].
See https://github.com/ethereum/hive/pull/776
2023-05-08 16:03:59 +02:00
ledgerwatch
fdd385cef1
[Devnet tool] Side-quest to improve logging - part 1 (#7445)
This is the beginning of the series of changes to make it possible to
run multiple instances of erigon inside a single process (as devnet tool
does), with the logging from these processes going to respective log
files correctly.
This is the first part where the initial infrastructure is being
established

---------

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-05-07 07:28:15 +01:00
Alex Sharov
69a3396433
add flag --db.size.limit (#7325) 2023-04-17 12:48:57 +00:00
Stéphane Loeuillet
195a72bf74
Initial GraphQL interface implementation (#6821)
That's an initial PR mostly for code review, not ready for production
use

Got basic GraphQL working when querying a single block

---------

Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
2023-02-20 11:23:06 +00:00
ledgerwatch
bf24018205
Add support for eth/68 (#6764)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
Co-authored-by: Alex Sharp <alexsharp@surfer-172-29-1-65-hotspot.internet-for-guests.com>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-02-01 22:21:31 +00:00
a
007234b489
allow rpcdaemon to bind to tcp (#6184)
this pr adds CLI flag to allow the rpcdaemon to bind to a TCP port.

this is very useful if one wants to maintain a remote connection with
the rpcdaemon without using websocket. This is useful because a lot of
issues come with the websocket protocol (compression, max size, etc).
TCP socket gets around these things (it is just raw json over tcp
stream)

the rpc package already supports this, it was just a matter of adding
the bind.

try `echo
'{"jsonrpc":"2.0","method":"eth_blockNumber","id":"1","params":[""]}' |
nc localhost 8548` as a basic test

to test. Subscriptions are also working (idk how to send keepalives with
netcat)

the default rpc.(*Client).Dial method does not support TCP. I have not
included that in this PR. The code for such is as follow

```
// DialTCP create a new TCP client that connects to the given endpoint.
//
// The context is used for the initial connection establishment. It does not
// affect subsequent interactions with the client.
func DialTCP(ctx context.Context, endpoint string) (*Client, error) {
	parsed, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	ans := make(chan *Client)
	errc := make(chan error)
	go func() {
		client, err := newClient(ctx, func(ctx context.Context) (ServerCodec, error) {
			conn, err := net.Dial("tcp", parsed.Host)
			if err != nil {
				return nil, err
			}
			return NewCodec(conn), nil
		})
		if err != nil {
			errc <- err
			return
		}
		ans <- client
	}()
	select {
	case err := <-errc:
		return nil, err
	case a := <-ans:
		return a, nil
	case <-ctx.Done():
		return nil, ctx.Err()
	}
}

// DialContext creates a new RPC client, just like Dial.
//
// The context is used to cancel or time out the initial connection establishment. It does
// not affect subsequent interactions with the client.
func DialContext(ctx context.Context, rawurl string) (*Client, error) {
	u, err := url.Parse(rawurl)
	if err != nil {
		return nil, err
	}
	switch u.Scheme {
	case "http", "https":
		return DialHTTP(rawurl)
	case "ws", "wss":
		return DialWebsocket(ctx, rawurl, "")
	case "tcp":
		return DialTCP(ctx, rawurl)
	case "stdio":
		return DialStdIO(ctx)
	case "":
		return DialIPC(ctx, rawurl)
	default:
		return nil, fmt.Errorf("no known transport for URL scheme %q", u.Scheme)
	}
}


```

let me know if you would like me to add this to the PR as well. the TCP
connection can then be established with `rpc.Dial("tcp://host:port")`
2022-12-03 14:22:47 +07:00
Alex Sharov
8afeee56c8
Downloader extract, step2 (#6076) 2022-11-20 10:41:30 +07:00
Andrew Ashikhmin
14c0643476
Enable both eth/66 and eth/67 by default (#6048) 2022-11-15 10:41:56 +01:00
Andrew Ashikhmin
7286a0fef7
Create in-memory MDBX inside dirs.Tmp (#5702)
Previously "in-memory" MDBX instances for fork validation and mining
were created inside `os.TempDir()`. We should create them inside
Erigon's datadir so that the file permissions and the disk are the same
as for the main database.

Prerequisite: https://github.com/ledgerwatch/erigon-lib/pull/676.
2022-10-11 16:49:38 +01:00
Alex Sharov
9fb8a190bc
erigon22: folder snapshots/history (#5351) 2022-09-18 17:41:01 +07:00
Håvard Anda Estensen
7c15ed59e4
Enable prealloc linter (#5177)
* Enable prealloc linter

* Set inital slice len to 0
2022-08-26 10:04:36 +07:00
Alex Sharov
f83032533f
Revert "move exec22 to package, call it from stage_exec (#5000)" (#5001)
This reverts commit efa6dfd8ce.
2022-08-11 11:18:23 +07:00
Alex Sharov
efa6dfd8ce
move exec22 to package, call it from stage_exec (#5000) 2022-08-11 11:17:03 +07:00
Andrew Ashikhmin
7199dcf7a2
Rename engine.* flags to authrpc.* for consistency with geth (#4890)
* Update README re. Engine API

* Remove obsolete code

* Don't apply --rpc.accessList to Engine API listener

* Simplify startAuthenticatedRpcServer

* Rename engine.* cmd flags to authrpc.* for consistency with geth

* More renamings

* Introduce --authrpc.vhosts flag
2022-08-02 13:15:01 +07:00
Andrew Ashikhmin
eec5fa4d41
Add support for eth/67 (#4564)
* Add eth/67

* Listen to eth/66 on a separate port

* Fix compilation error

* Fix cfg66.ListenAddr

* Update erigon ports in README

* Expose port 30304 in docker

* P2pProtocolVersionFlag instead of second sentry

* Remove "66 by default" from usage

* Small comment
2022-07-08 11:14:16 +02:00
Alex Sharov
afd07e5dee
--no-downloader flag support (#4545) 2022-06-26 17:13:32 +06:00
Alex Sharov
974b1d8844
more use of dirs config #4391 2022-06-07 12:08:24 +07:00
Alex Sharov
e146b66e35
more usage of dirs object #4390 2022-06-07 11:54:04 +07:00
Alex Sharov
a53642b4bf
datadir.Dirs configuration object to group dir config (#4387) 2022-06-07 10:24:50 +07:00
battlmonstr
0c5d1d64a3
observer: sentry candidates intake (#4321)
* sentry client: log connected peer info

* observer: unseen sentry peers report

* observer: refactoring node.go to node_utils

* observer: sentry candidates intake
2022-06-01 22:48:24 +01:00
Alex Sharov
955c669d21
Group few sync configs (#4303)
* save

* save
2022-05-30 17:08:49 +07:00
Alex Sharov
66248c4bfb
Torrent: verify all files (#4270) 2022-05-26 12:27:44 +07:00