Commit Graph

18465 Commits

Author SHA1 Message Date
Alex Sharov
2b6c21fddb
move mdbx to new org (#8061) 2023-08-24 18:00:24 +07:00
Andrew Ashikhmin
ece8010d0d
Remove unused transaction and node packets from eth/protocols (#8057)
Transactions are served by erigon-lib's txpool and we don't serve
NodeData.
2023-08-24 06:50:04 +02:00
Alex Sharov
65d8b1d328
metrics: prevent commit metrics duplication (#8059) 2023-08-24 09:24:02 +07:00
Giulio rebuffo
db4533acd0
fixed small inconsistency with sqlite3 (#8054) 2023-08-23 22:44:22 +02:00
Andrew Ashikhmin
83d767c861
Revert "EIP-4788: set nonce of beacon root history address to nonzero… (#8055)
[devnet-8](https://notes.ethereum.org/@ethpandaops/dencun-devnet-8)
doesn't include https://github.com/ethereum/EIPs/pull/7431 since it's
rendered obsolete by upcoming https://github.com/ethereum/EIPs/pull/7456
(to be implemented by PR #8038).

This reverts PR #7952.
2023-08-23 15:40:49 +02:00
battlmonstr
2e29ff33e1
bor: BroadcastNewBlock to all peers from validator nodes (#8030)
Currently PropagateNewBlockHashes and BroadcastNewBlock
selects a subset of all sentries by taking a `Sqrt(len(sentries))`,
and then for each sentry SendMessageToRandomPeers
selects a subset of its peers by taking `Sqrt(len(peerInfos))`.

This behaviour limits the broadcast scope with a lot of peers, e.g. 100
becomes 10,
but is not great with very few peers, or if the message is very
important
to broadcast to everyone, which is the case of bor validator/proposer
nodes.

* send to all sentries in both BroadcastNewBlock and PropagateNewBlockHashes
* remove peerCountConstrained sqrt logic in SendMessageToRandomPeers
* add maxPeers provider func as a parameter to MultiClient
* default it to 10 for eth and 0 (unlimited) for bor validators

---------

Co-authored-by: Mark Holt <mark@distributed.vision>
2023-08-23 14:28:39 +02:00
alex.sharov
7e8c1130b9 grafana version up 2023-08-23 12:25:22 +07:00
alex.sharov
02b7c28a94 bor: integration cmd support 2023-08-23 12:07:36 +07:00
Alex Sharov
523504c557
rapid lib support go21 (#8051) 2023-08-23 07:21:32 +07:00
Alex Sharov
af72e993cd
torrent lib to support go21 (#8050) 2023-08-23 07:15:42 +07:00
Alex Sharov
804248a528
disable linter which failing wihout enough info (#8049) 2023-08-23 06:56:35 +07:00
battlmonstr
a83a478bae
bor: fix panic reading total difficulty for isChainPoS (#8032)
because bor doesn't have headers,
ReadCurrentHeader returns nil as expected

refactor isChainPoS to only call ReadCurrentHeader/ReadTd if needed and
use chain config IDs
2023-08-22 13:40:36 +02:00
battlmonstr
b7c4dcd5d1
p2p: add sepolia DNS discovery host name (#8027) 2023-08-22 10:51:21 +02:00
battlmonstr
6c017c33f9
p2p: log NAT ExternalIP error (#8026) 2023-08-22 10:51:00 +02:00
battlmonstr
d2d261e560
cli: die if a config file is invalid (#8025) 2023-08-22 10:50:31 +02:00
battlmonstr
5b843fbddc
sentry: do not process empty responses (#8029)
if dropUselessPeers = false,
skip processing empty responses same as if it was true

Co-authored-by: Mark Holt <mark@distributed.vision>
2023-08-22 10:16:12 +02:00
battlmonstr
61364e8a01
sentry: fix eth handshake sequence (#8031)
problem: it was possible to call startSync
and start sending messages before our Status is sent

solution: wait for the sender goroutine to finish
before calling startSync

refactor handShake parameters to not require peerID and a startSync
callback

Co-authored-by: Mark Holt <mark@distributed.vision>
2023-08-22 10:15:35 +02:00
Giulio rebuffo
bd81e15981
Caplin: Implemented SQL beacon indexer (#8043) 2023-08-22 01:24:26 +02:00
Andrew Ashikhmin
64d483e23a
To in EIP-4844 transactions must be non-nil (#8047)
See https://github.com/ethereum/EIPs/pull/7100
2023-08-21 18:00:11 +02:00
Andrew Ashikhmin
6bc0ca9e85
Correctly compute fork id when timestamp fork is activated in genesis (#8046)
See https://github.com/ethereum/go-ethereum/pull/27895
2023-08-21 15:35:13 +02:00
Alex Sharov
863a706858
caplin: use tmpdir inside datadir (#8041) 2023-08-20 15:26:34 +02:00
ledgerwatch
532cc13a03
Fix panic due to Borevents snapshots changes (#8042) 2023-08-20 10:42:09 +01:00
Giulio rebuffo
6d2a9aed2f
Fixed startup panic (#8040) 2023-08-18 22:16:30 +02:00
ledgerwatch
6b6c0caad0
Snapshots of Bor events (#7901)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
Co-authored-by: Alex Sharp <alexsharp@alexs-mbp-2.home>
2023-08-18 17:10:35 +01:00
Somnath Banerjee
384c6ba9ee
Go mod update lib (#8039)
Pick up https://github.com/ledgerwatch/erigon-lib/pull/1080
2023-08-18 19:55:54 +05:30
Giulio rebuffo
38db2ed2e7
[Caplin Phase 2]: Initial working implementation (#8033)
caplin just using execution.proto
2023-08-18 15:43:22 +02:00
Andrew Ashikhmin
611145c385
updateForkChoice: send state changes to txpool after tx is committed (#8035)
[txpool](https://github.com/ledgerwatch/erigon-lib/blob/main/txpool/pool.go)
expects an `OnNewBlock` update only after the DB transaction is
committed.

This fixes, for example, a nonce gap mis-detection in Hive test
"engine-cancun/Blob Transactions On Block 1, Cancun Genesis".
2023-08-17 16:03:12 +02:00
Andrew Ashikhmin
f82bc1def9
Don't call AuRa Initialize after The Merge (#7989)
With The Merge Gnosis Chain is much closer to Ethereum and there's no
need to call AuRa `Initialize`.
2023-08-17 12:46:53 +02:00
Giulio rebuffo
cab6d30322
Caplin's Persistence data format (#8028) 2023-08-16 23:03:25 +02:00
Giulio rebuffo
c8db11f150
Sentinel: improvements to block download (#8023) 2023-08-16 17:02:30 +02:00
a
521f0df55b
Historical block downloader (#8016) 2023-08-16 04:32:40 +02:00
Giulio rebuffo
114dd684eb
Caplin Optimization: Efficient Processing of Epoch and Reuse of checkpoint states (#8020) 2023-08-15 12:45:48 +02:00
Somnath Banerjee
1867d9393a
Fix duplicate commitments in GetPayloadV3 response (#8018) 2023-08-14 17:57:33 +05:30
Somnath Banerjee
143ff4695c
Fix 17 hive tests (#8014) 2023-08-14 09:24:59 +02:00
Andrew Ashikhmin
2a4b1b3077
Pass proper timestamp in stage senders (#8013)
This fixes "blob tx is not supported by signer", which occurred in some
Hive tests.
2023-08-13 21:38:01 +02:00
Andrew Ashikhmin
7947fc8ad1
Always encode EIP-4844 transactions unwrapped (without blobs) (#8012)
The only time we need to serialize blobs/commitments/proofs is when we
reply to `GetPooledTransactions` (and that's handled by the txpool).
2023-08-13 22:32:47 +05:30
Somnath Banerjee
b7070a9c08
Fix 12 hive tests (#8011) 2023-08-13 19:46:25 +05:30
Andrew Ashikhmin
9609ca9120
Fix JSON marshalling of BlobsBundleV1 (EIP-4844) (#8010)
According to the
[spec](https://github.com/ethereum/execution-apis/blob/main/src/engine/cancun.md#blobsbundlev1),
commitments/proofs/blobs in `BlobsBundleV1` should have the
[DATA](https://github.com/ethereum/execution-apis/blob/main/src/engine/common.md#encoding)
encoding.
2023-08-13 15:43:55 +02:00
Giulio rebuffo
98db1e97b5
Better caplin logging (#8009) 2023-08-12 22:29:30 +02:00
jack meng
d370ea7ac2
fixed bitmap performance when write index (#7986)
Here is my case:

writeIndex function takes about 39% in pprof flame graph. I dive into it
and find out that we use POA consensus, therefore mining addresses have
a big bitmap.

```
func writeIndex(blocknum uint64, changes *historyv2.ChangeSet, bucket string, changeDb kv.RwTx) error {
	buf := bytes.NewBuffer(nil)
	for _, change := range changes.Changes {
		k := dbutils.CompositeKeyWithoutIncarnation(change.Key)
		index, err := bitmapdb.Get64(changeDb, bucket, k, math.MaxUint32, math.MaxUint32)
		if err != nil {
			return fmt.Errorf("find chunk failed: %w", err)
		}
		index.Add(blocknum)
		if err = bitmapdb.WalkChunkWithKeys64(k, index, bitmapdb.ChunkLimit, func(chunkKey []byte, chunk *roaring64.Bitmap) error {
			buf.Reset()
			if _, err = chunk.WriteTo(buf); err != nil {
				return err
			}
			return changeDb.Put(bucket, chunkKey, common.CopyBytes(buf.Bytes()))
		}); err != nil {
			return err
		}
	}
	return nil
}
```
assume that a mining address has a big bitmap (Cardinality 400000), then
"writeIndex" will split it into 300 small bitmaps according to
”ChunkLimit“ and next time "writeIndex" will union all small bitmaps
into a big bitmap, then use binary search to split it into 300 small
bitmaps. over and over again.

I think blockNum > index.Maximum(), so that we only need get the last
one of 300 small bitmaps .

Co-authored-by: mengweifu <75886642@qq.com>
2023-08-13 02:07:43 +06:00
Alex Sharov
d0ce7380aa
up 'x' packages versions (#8005) 2023-08-12 11:58:32 +06:00
Giulio rebuffo
de5706dbc6
Direct sentinel instead of over the network sentinel (#8006) 2023-08-12 01:54:45 +02:00
Giulio rebuffo
7c0d6e15bb
Added gnosis fields and removed body gap. (#7993) 2023-08-11 23:07:36 +02:00
Alex Sharov
c464d84334
tmpdb: move to tmpdir (#8003) 2023-08-12 01:06:15 +06:00
Andrew Ashikhmin
e377cea51d
Fix CopyTxs for BlobTxWrapper (EIP-4844) (#8002) 2023-08-11 20:30:02 +02:00
dependabot[bot]
8809a4acd3
Bump github.com/supranational/blst from 0.3.10 to 0.3.11 (#7988)
Bumps
[github.com/supranational/blst](https://github.com/supranational/blst)
from 0.3.10 to 0.3.11.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/supranational/blst/releases">github.com/supranational/blst's
releases</a>.</em></p>
<blockquote>
<h2>Release v0.3.11</h2>
<p>Essential changes:</p>
<ul>
<li>security bugfix in Go bindings</li>
<li>run-time switch in portable build</li>
<li>no-std support [exercised with limited stack size of 56K]</li>
<li>serde support</li>
<li>blst_miller_loop_n interface, with parallelized Rust and Go
counterparts</li>
<li>optional blst_fr_pentaroot subroutine</li>
<li>Emscripten bindings</li>
<li>hardened security on non-asm platforms</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3dd0f804b1"><code>3dd0f80</code></a>
bindings/rust/Cargo.toml: bump the version number.</li>
<li><a
href="fb91221c91"><code>fb91221</code></a>
bindings/go/blst.go: fix logical error in SigValidate.</li>
<li><a
href="c6a3cc00ca"><code>c6a3cc0</code></a>
build.sh: don't pass -mno-avx unless actually required.</li>
<li><a
href="9fa8bcfb93"><code>9fa8bcf</code></a>
vect.h: tolerate compilation with -std=cNM flag.</li>
<li><a
href="5aa7ce1d6f"><code>5aa7ce1</code></a>
bindings/&lt;swig-based&gt;/*: minimize dynamic library symbol
pollution.</li>
<li><a
href="e1a44c97c0"><code>e1a44c9</code></a>
build.sh: drop --version-script linker argument.</li>
<li><a
href="492319a8c0"><code>492319a</code></a>
cpuid.c: adjust symbol visibility.</li>
<li><a
href="6dd7aa4ed9"><code>6dd7aa4</code></a>
Execute build/refresh.sh.</li>
<li><a
href="701e42a70b"><code>701e42a</code></a>
asm/ct_*: add missing .hidden directives.</li>
<li><a
href="dce883beb4"><code>dce883b</code></a>
Execute build/refresh.sh.</li>
<li>Additional commits viewable in <a
href="https://github.com/supranational/blst/compare/v0.3.10...v0.3.11">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/supranational/blst&package-manager=go_modules&previous-version=0.3.10&new-version=0.3.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/ledgerwatch/erigon/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 16:23:54 +02:00
Andrew Ashikhmin
f854a73185
Add enough blob gas for block building (EIP-4844) (#8001) 2023-08-11 16:09:03 +02:00
Andrew Ashikhmin
03927d3e27
Call InitializeBlockExecution in SpawnMiningExecStage (EIP-4788) (#7999)
This fixes the trie state root issue that was occurring in the Hive
tests for Cancun.
2023-08-11 14:04:53 +02:00
Andrew Ashikhmin
6adad0afde
Add parentBeaconBlockRoot to RPCMarshalHeader (EIP-4788) (#7997) 2023-08-11 10:26:44 +02:00
Alex Sharov
d2bde8c096
Recsplit: cancelable build (#7994) 2023-08-11 11:54:59 +06:00