Commit Graph

17259 Commits

Author SHA1 Message Date
Andrew Ashikhmin
ecf0a59624
Cosmetic change to go.mod (#6236) 2022-12-07 13:31:46 +01:00
Andrew Ashikhmin
767f5f7edd
Demote "[Downloader] posAnchor" log to debug (#6234)
The message floods the log.
2022-12-07 12:47:03 +01: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
554a21cf79
mdbx: runtime options are changeable in Ascedee mode (#6232) 2022-12-07 17:10:36 +07:00
Alex Sharov
43934c6f4a
mdbx: expose dirtySpace option (#6231) 2022-12-07 16:39:13 +07:00
Alex Sharov
79f259d902
mdbx bindings: remove txn.RawRead field #769 (#6225) 2022-12-07 13:08:48 +07:00
Alex Sharov
724e93a239
e3: no wal support (#6224) 2022-12-07 12:15:57 +07:00
Alex Sharov
002140daae
mdbx: add BeginRwAsync method (#6221) 2022-12-07 11:19:05 +07:00
alex.sharov
7788802e96 save 2022-12-07 10:32:06 +07:00
Andrew Ashikhmin
5059ace03a
Gnosis Chain TTD (#6220)
See https://github.com/NethermindEth/nethermind/pull/4901
2022-12-06 15:28:02 +01:00
Alex Sharov
12ee33a492
e3: don't put nil to pool (#6219) 2022-12-06 13:07:16 +07:00
Alex Sharov
bdc9da0162
e3: don't jump over StageSenders by reconstitution (#6218) 2022-12-06 13:00:23 +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
Max Revitt
39487c1752
tweak(p2p): trace log level for error from t.matchWithCall (#6214)
Potentially helps with: #6123
2022-12-06 09:29:41 +07:00
Krishna Upadhyaya
03d0dfe5ce
Update TxLookupRange error to warning (#6213) 2022-12-05 20:22:31 +07:00
Alex Sharov
f9cf18a4ac
e3: pool read list (#6210) 2022-12-05 18:48:08 +07:00
Alex Sharov
c555c03bb3
e3: use ibs.Reset() in rpc-daemon (#6207) 2022-12-05 12:42: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
daf2867194
e3: Recon heap mem leak (#6203) 2022-12-05 08:42:26 +07:00
Giulio rebuffo
6e76643c09
Added Handshake protocol to Erigon-CL Lightclient and Fullclient (#6206) 2022-12-05 01:25:12 +01: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
7e6a177eec
e3: recon speedup (#6201) 2022-12-04 16:11:24 +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
Håvard Anda Estensen
099fb7c627
Grow string builders (#6192)
Strings builders have a buffer (slice) that can be pre-allocated
2022-12-04 10:51:20 +07:00
Alex Sharov
0efda1f19f
trace: change type of self destruct arg to uint256 (#6189) 2022-12-03 21:43:53 +07: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
8108085012 fix integration merge conflict 2022-12-03 13:38:57 +07:00
Alex Sharov
ded79088e9
remove code of exeriments (#6187) 2022-12-03 13:04:09 +07:00
Alex Sharov
f9c8d556a5
log experiment enabling (#6186) 2022-12-03 12:56:44 +07:00
alex.sharov
9d1eec8cb3 fix integration merge conflict 2022-12-03 12:38:04 +07:00
Alex Sharov
9b65c533c9
e3: optimize incremental hashstate (#6179) 2022-12-03 12:23:01 +07:00
hexoscott
09a01bc6a0
txpool to pull blocks of transactions until no gas remains for the block (#6160)
Moving the txpool transaction pull into the execution phase and looping
until the gas is used up or the txpool runs dry.

Removed the concept of local vs remote transactions as comments/code
showed this split was no longer in use.

Created a `PreparedTxs` collection to satisfy the use case in the
integration tool when mining is active.

Untested locally as I have no way of mining/validating currently.

Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
2022-12-03 12:20:47 +07:00
Giulio rebuffo
1fd3a01edf
Added Consensus Layer staged sync (#6183) 2022-12-03 03:16:26 +01:00
alex.sharov
5e36c9fb5f save 2022-12-02 21:01:43 +07:00
Alex Sharov
76bd23d46d
mdbx: print some logs about settings (#6181) 2022-12-02 20:57:31 +07:00
alex.sharov
bae905b573 save 2022-12-02 18:41:36 +07: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
Alex Sharov
5f5a9c23cd
e3: support of --snap.stop (#6175) 2022-12-02 09:03:29 +07:00
Giulio rebuffo
cea51685fe
attempt at fixing lightclient performance leaks (#6169) 2022-12-02 00:21:33 +01:00
Mike Neuder
3a8c9ccdb3
Add state transition function and unit test. (#6170)
Part of https://github.com/ledgerwatch/erigon/issues/5965

See
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#beacon-chain-state-transition-function.
2022-12-01 20:57:41 +01:00
Alex Sharov
08469bf5dc
e3: fix dao test (#6173) 2022-12-01 15:32:10 +07:00