Commit Graph

16812 Commits

Author SHA1 Message Date
Alex Sharov
8d1ed547b0
E3: parallel exec, apply on roTx (#5879) 2022-10-28 08:47:45 +07:00
Giulio rebuffo
5a321d6240
Dispersed fixes for incremental verkle trees (#5880) 2022-10-27 10:22:53 +02:00
Andrew Ashikhmin
d9ff645fbf
Make lint happy (#5874)
Fixes
```
eth/stagedsync/exec3.go:885:6: ineffectual assignment to txs (ineffassign)
        b, txs = nil, nil
           ^
```
2022-10-26 14:41:56 +02:00
Andrew Ashikhmin
6a5968e7f0
AuRa service transactions are free (#5873)
and the don't pay baseFee after EIP-1559.

See https://openethereum.github.io/Permissioning.html#gas-price
2022-10-26 13:03:47 +02:00
Alex Sharov
fe49acdbe6
revert_o2 changes (#5872) 2022-10-26 15:19:40 +07:00
Alex Sharov
3babe19f73
revert last mdbx change - because some suspicious bug-report #705 (#5869)
for https://github.com/ledgerwatch/erigon/issues/5863
2022-10-26 14:05:14 +07:00
Alex Sharov
7056ef07be
don't stop stageLoop if error happen during background blocks snapshot creation (#5868) 2022-10-26 09:43:10 +07:00
dtan3847
42aa80e059
rpc: fix implemented filter methods being forbidden (#5801)
Addresses issue #4833

Removes implemented methods from the forbidden method list. The
forbidden list seems to have been created as a bugfix before the filters
methods were implemented. Now that the filter methods are implemented,
these entries are causing unexpected behaviour.
2022-10-26 09:08:09 +07:00
Mike Neuder
29ff8daa92
req/resp heartbeat handler modifications (#5859)
addressing some aspects of the req/resp portion of the CL spec:
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#reqresp-interaction.

this PR does a few things: 
1. moves `blocksByRangeHandler` and `beaconBlocksByRootHandler` handlers
to a different file in the `handlers` package. these are going to be the
more complicated handlers so they will be better in their own files.
2. makes `pingHandler` a method on the `*ConsensusHandlers` receiver and
starts returning the sequence number instead of the request. (see
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#ping
`Peers request and respond with their local metadata sequence number`).
3. adds a `goodbyeHandler` to respond with a status message of 1. (see
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#goodbye).
4. makes `statusHandler` a method on the `*ConsensusHandlers` receiver.
(the rest of this handler is still not implemented.
5. refactored the `heartbeats_test` into a table driven test. this makes
the test much more readable:
https://dave.cheney.net/2019/05/07/prefer-table-driven-tests.
2022-10-25 19:30:11 +02:00
Andrew Ashikhmin
b71ba5326f
txpool: prevent index out of range 2 (#5862)
Pick up https://github.com/ledgerwatch/erigon-lib/pull/704
2022-10-25 14:39:40 +02:00
Alex Sharov
2d7cd0fae2
e3: better prune logs, apply thread can work without rwTx (#5860) 2022-10-25 16:08:01 +07:00
Alex Sharov
26fdf9169d
move all packages from "internal" folder - to simplify users live (#5857) 2022-10-25 09:58:25 +07:00
Alex Sharov
b1680de12d
e3: goerli snapshots (#5858) 2022-10-25 09:48:24 +07:00
Mike Neuder
4b5880e8d3
Adding VoluntaryExit, ProposerSlashing, and AttesterSlashing topics to pubsub service (#5851)
This is a follow on PR in support of
https://github.com/ledgerwatch/erigon/issues/5824. See
https://github.com/ledgerwatch/erigon/pull/5841 for the
`beacon_aggregate_and_proof` topic.

This PR adds support for the `voluntary_exit, proposer_slashing, and
attester_slashing` topics as defined in the phase 0 spec
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#global-topics.

The CL types were already defined so this just adds the listening to the
pub sub service.
2022-10-24 17:52:49 +02:00
Alex Sharov
592ad57921
add DECOMPRESS_CONDENSITY env variable (#5853) 2022-10-24 10:00:55 +07:00
Alex Sharov
4ca4aa7144
e3: bsc recon leack fix (#5852) 2022-10-24 09:14:34 +07:00
Mike Neuder
db1c2d2d82
Adding the AggregateAndProof global topic to the sentinel pubsub service (#5841)
This is the first PR in support of
https://github.com/ledgerwatch/erigon/issues/5824.

The phase 0 sepc
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#global-topics
specifies 6 global pubsub topics that CL nodes need to handle.

This PR implements the `beacob_aggregate_and_proof` topic: 

https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof.

The `AggregateAndProof` and `SignedAggregateAndProof` types are defined
here:
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/validator.md#aggregateandproof.

I followed the implementation of `SignedBeaconBlockBellatrix`, which has
the following references:

1. cmd/lightclient/cltypes/types.go‎: defines the struct with relevant
SSZ annotations on the fields.
2. cmd/lightclient/cltypes/clone.go: this just returns a reference to an
empty object, so not super clear to me if it is necessary:
3. cmd/lightclient/rpc/common.go: this decodes gossip data, switching on
the type of gossip message that is received.
4. ‎cmd/lightclient/sentinel/service/service.go: this listens on the
pubsub channel and notifies when a packet of the relevant type comes in.
5. cmd/lightclient/sentinel/pubsub.go: this defines the gossip topic
struct.
6. cmd/lightclient/lightclient/subscriber.go: this is the lightclient
interface for the incoming messages that come from the sentinel.
2022-10-23 20:22:33 +02:00
Alex Sharov
a1cd46c5be
e3: recon metrics (#5850) 2022-10-23 19:31:24 +07:00
Daniel DeLima
dcb42b1537
Improved readability in README System Requirements section (#5843) 2022-10-23 19:25:20 +07:00
Alex Sharov
8d75d0dc4b
e3: return old reader version  (#5849) 2022-10-23 19:22:33 +07:00
Alex Sharov
993fde4d92
E3: par logs (#5839) 2022-10-23 18:51:14 +07:00
Alex Sharov
cd4ce6291f
don't accumulate state changes for jumps > 1K blocks (#5845) 2022-10-23 18:50:11 +07:00
Alex Sharov
a1e21260ad
e3: reduce reconstitute ram estimation (#5848) 2022-10-23 18:49:57 +07:00
Alex Sharov
96233cfa7f
e3: metrics (#5846) 2022-10-23 17:05:26 +07:00
Alex Sharov
866ebe9ffb
snapshots: new blocks snapshot for mainnet (#5842) 2022-10-23 10:05:48 +07:00
Enrique Jose Avila Asapche
a874459835
got rid of time.Sleep (#5840) 2022-10-22 17:38:29 +01:00
Krishna Upadhyaya
aea019a3ff
Fix BorTxLookup (#5800) 2022-10-22 17:37:01 +01:00
Alex Sharov
c8a7bb6c37
fix linter warnings (#5838) 2022-10-22 13:19:33 +07:00
Alex Sharov
8641d81511
downloader: nil ptr verify (#5833) 2022-10-22 11:52:05 +07:00
Alex Sharov
f2eee19de0
eliasfano: To fix checkptr fatal error (#5831) 2022-10-22 11:16:50 +07:00
Alex Sharov
eb6fab868d
e3: remove some mainnet snapshots (#5829) 2022-10-22 08:44:10 +07:00
Enrique Jose Avila Asapche
199a9a633c
lowered the amount of max peers (#5828)
Change the amount of max peers from 200 -> 33
2022-10-22 02:10:00 +02:00
Alex Sharov
d6de913a34
e3: fix races (#5822) 2022-10-21 21:02:18 +07:00
Andrew Ashikhmin
da354bc01a
Unify Bor burntContract with Gnosis eip1559FeeCollector (#5798) 2022-10-21 13:03:38 +02:00
Andrew Ashikhmin
64a3156112
Support BaseFee in AuRa headers (#5820)
BaseFee is required in AuRa headers when
[EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) is activated.

Also:
- Basic AuRa header verification
- Extract some common RLP methods
- Tiny log clean-up
2022-10-21 12:43:44 +02:00
Alex Sharov
a64e041611
e3: disable paralel index (#5819) 2022-10-21 15:30:43 +07:00
Alex Sharov
b9f6b098c3
downloader: log files progress at debug level (#5818) 2022-10-21 15:08:16 +07:00
Alex Sharov
86551e82f4
e3: parallel build missed indices (#5817) 2022-10-21 13:45:20 +07:00
Alex Sharov
606ce5c99a
add logging cli flags to various cmd (#5816) 2022-10-21 12:36:17 +07:00
Levi Aul
e85d4b76aa
Return bor receipts correctly in getTransactionReceipt and getBlockReceipts (#5787)
Fixes a nil-pointer dereference in Decode when attempting to call
`getTransactionReceipt` / `getBlockReceipts` on blocks containing
stateSync events.
2022-10-20 19:25:46 +01:00
Max Revitt
07ffa36d44
File system logging (#5812)
- lives in internal/logging
- all log flags moved to internal/logging/flags
- allows continued use of root logger via log.Info etc.
- update logger to take change allowing string to lvl for 'trace'

Verbosity flag is overridden by log.console.verbosity. Logs will be
colocated if all run as one process, only split where progs are run as
separate processes, in a future update this will be addressed so for
example rpcdeamon will always log to it's own file
2022-10-20 19:25:06 +01:00
Giulio rebuffo
889164e847
Strenghtened safety system for LC (#5811) 2022-10-20 16:07:17 +02:00
Leonard Chinonso
4c376b06da
Tests for lightclient/sentinel (#5772) 2022-10-20 15:41:28 +02:00
Alex Sharov
5d5d14532d
mdbx_to_mdbx preserve destination (#5810) 2022-10-20 19:20:22 +07:00
Alex Sharov
9d2d51e0ae
e3: mainnet (#5809) 2022-10-20 19:07:25 +07:00
a
d697b6fe7c
large performance optimization for filterLogs (getLogs) when doing queries with many addresses and logs. (#5805)
this pr changes filterLogs to use a pre computed hashset of addresses,
instead of iterating across the list of addresses once per log.

this greatly increases the speed of filter queries that use many
addresses and also return a large number of logs. In our case, we are
performing a query for all the trades performed in a uniswap v3 pool in
a 250 block range.
 
my benchmarks were performed with the data & code below:
 
address list gist is here
[addrs](2c30b0df43/gistfile1.txt)

 ```
 c := NewRpcClient()
 addrs := []common.Address{AddressListGist}
logs, err := c.FilterLogs(context.TODO(), ethereum.FilterQuery{
	FromBlock:big.NewInt(15640000),
	ToBlock:   big.NewInt(15640250),
	Addresses: addrs,
	Topics: [][]common.Hash{
		{

common.HexToHash("c42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"),
		},
	},
```
the query contains 8442 addresses, while the response contains 1277 logs

On average, current devel averages a 15.57 second response time on my machine after 10 runs, while the new filterLogs averages 1.05 seconds.

for CURRENT DEVEL, the profile is here: https://pprof.aaaaa.news/cd8dkv0tidul37sctmi0/flamegraph 

for the filterLogs branch, the profile is here: https://pprof.aaaaa.news/cd8dlmgtidul37sctmig/flamegraph

while the tests pass with this branch, I am not really sure why filterLogs was originally programmed the way it was. Is there some sort of edge case / compatibility thing that I am missing with this change?

Co-authored-by: a <a@a.a>
2022-10-20 17:34:20 +07:00
Andrew Ashikhmin
af46c3c069
txpool: prevent index out of range (#5808)
Pick up https://github.com/ledgerwatch/erigon-lib/pull/690
2022-10-20 11:34:21 +02:00
Alex Sharov
c5d905fae2
e3: more snapshots (#5806) 2022-10-20 13:02:59 +07:00
Alex Sharov
6405425465
add fileName to decompressor panic (#5804) 2022-10-20 12:51:02 +07:00
Alex Sharov
0db6b9b44b
e3: move skip analysis out of the loop (#5803) 2022-10-20 10:39:40 +07:00