Commit Graph

20465 Commits

Author SHA1 Message Date
Andrew Ashikhmin
d4cd712da0
Revisit getPayloadBodiesByHash (#8758)
Revisit PR #8750
2023-11-17 13:04:02 +01:00
Mark Holt
f3ce5f8a36
Bor proofgen tests (#8751)
Added initial proof generation tests for polygon reverse flow for devnet

Blocks tested, receipts need trie proof clarification
2023-11-17 10:41:45 +00:00
battlmonstr
a5ff524740
p2p: fix discovery shutdown (#8725) - alternative fix (#8757)
Making the addReplyMatcher channel unbuffered makes the loop
going too slow sometimes for serving parallel requests.
This is an alternative fix for keeping the channel buffered.
2023-11-17 11:02:28 +01:00
Håvard Anda Estensen
fdab99d0e8
core: run tests in parallel (#8743) 2023-11-17 10:52:40 +07:00
battlmonstr
3ca7fdf7e9
p2p: fix discovery shutdown (#8725) (#8735)
Problem:
Some goroutines are blocked on shutdown:
1. table close <-tab.closed // because table loop pending
1. table loop <-refreshDone // because lookup shutdown blocks doRefresh
1. lookup shutdown <-it.replyCh // because it.queryfunc (findnode -
ensureBond) is blocked, and not returning errClosed (if it returns and
pushes to it.replyCh, then shutdown() will unblock)
1. findnode - ensureBond <-rm.errc // because the related replyMatcher
was added after loop() exited, so there's nothing to push errClosed and
unlock it

If addReplyMatcher channel is buffered, it is possible that
UDPv4.pending() adds a new reply matcher after closeCtx.Done().
Such reply matcher's errc result channel will never be updated, because
the UDPv4.loop() has exited at this point. Subsequent discovery
operations will deadlock.

Solution:
Revert to an unbuffered channel.
2023-11-17 09:13:44 +07:00
lupin012
1b14921a9d
rpctest: Adapts rpctest error handling all tests (#8744) 2023-11-17 08:57:08 +07:00
Giulio rebuffo
273ca0694d
Fixed getPayloadBodiesByHash (#8750)
fixed https://github.com/ledgerwatch/erigon/issues/8746
2023-11-16 21:39:27 +01:00
Giulio rebuffo
274f84598c
Automation tool to automatically upload caplin's snapshot files to R2 (#8747)
Upload beacon snapshots to R2 every week by default
2023-11-16 20:59:43 +01:00
Dmytro
a6b5297b3e
dvovk/tunnelwws (#8745)
- changed communication tunnel to web socket in order to connect to
remote nodes
- changed diagnostics.url flag to diagnostics.addr as now user need to
enter only address and support command will connect to it through
websocket
- changed flag debug.urls to debug.addrs in order to have ability to
change connection type between erigon and support to websocket and don't
change user API
- added auto trying to connect to connect to ws if connection with was
failed
2023-11-16 16:37:29 +00:00
milen
27d8865f35
metrics: switch to using prometheus library (#8741)
# Background

Erigon currently uses a combination of Victoria Metrics and Prometheus
client for providing metrics.

We want to rationalize this and use only the Prometheus client library,
but we want to maintain the simplified Victoria Metrics methods for
constructing metrics.

This task is currently partly complete and needs to be finished to a
stage where we can remove the Victoria Metrics module from the Erigon
code base.

## Tests

### Functional
* Make sure that the format change int->float implied by VM to
Prometheus does not impact clients (pay particular attention to block
numbers)
* Check that the prometheus/grafana dashboards defined in cmd/prometheus
are functional after the change
(see docker-compose.yml for details and
https://github.com/ledgerwatch/erigon/tree/devel/cmd/prometheus#readme)
* Confirm that the underlying go metrics are still generated
* Confirm the following flags setting work:
    --metrics, --metrics.addr, --metrics.port with the new code
* Confirm that --metrics and --proff settings and handlers configuration
still allow metrics and pprof to share a port

#### Float counters - scientific notation test case
![Screenshot_2023-11-07_at_15 57
21](https://github.com/ledgerwatch/erigon/assets/94537774/32f0a6f6-968b-477c-8ec8-bb1812f3e848)

![Screenshot 2023-11-15 at 16 26
56](https://github.com/ledgerwatch/erigon/assets/94537774/3f402b2e-e343-4928-9fbb-18fa4d077485)


#### Float counters - NaN test case
![Screenshot_2023-11-07_at_16 04
25](https://github.com/ledgerwatch/erigon/assets/94537774/cbf90d5d-3749-4bd7-971d-e2124e54267c)

![Screenshot 2023-11-15 at 16 28
36](https://github.com/ledgerwatch/erigon/assets/94537774/5924915e-1977-4b7f-8082-23f73d0957d5)

### Performance
* Check the performance of counters created by RPC calls measurements
created by rpc/metrics.go are not impacted by the change.

#### RPC
Performed tests on rpcdaemon & erigon on localhost using
`etc_blockNumber`.
Did tests with 100, 1000, 10000 requests. Got a steady 15 ms response
time.

#### Memory
![Screenshot 2023-11-16 at 09 58
39](https://github.com/ledgerwatch/erigon/assets/94537774/5dd956d7-903f-4bea-a460-d3644da56201)
2023-11-16 16:30:37 +00:00
Delweng
32d05a3b40
eth/tracers: support traceCall with txIndex (#8736)
This is a similar PR of
https://github.com/ethereum/go-ethereum/pull/28460, support traceCall in
the middle of a block

Signed-off-by: jsvisa <delweng@gmail.com>
2023-11-16 16:30:15 +07:00
Håvard Anda Estensen
4873502818
turbo: run tests in parallel (#8738)
Tests that don't affect each other should run in parallel
2023-11-16 16:29:31 +07:00
lupin012
def2457b1c
rpctest: add option to requestAndCompare to permit to save only success tx (#8726) 2023-11-16 16:21:21 +07:00
Alex Sharov
cc8bdc5185
BlockReader: handle nil-body (#8739)
```
EROR] [11-16|07:33:02.592] RPC method eth_getLogs crashed: runtime error: invalid memory address or nil pointer dereference
Nov 16 07:33:02 i-0e4d4ce2636f49d8a erigon.sh[1739584]: [service.go:219 panic.go:914 panic.go:261 signal_unix.go:861 block_reader.go:615 block_reader.go:405 eth_receipts.go:228 value.go:596 value.go:380 service.go:224 handler.go:493 handler.go:443 handler.go:391 handler.go:222 handler.go:315 asm_amd64.s:1650]
```
2023-11-16 15:54:17 +07:00
battlmonstr
5c57204e2d
bor: update mumbai bootnodes (#8671)
Update the list with nodes collected by observer
2023-11-15 15:16:23 +01:00
Giulio rebuffo
51af060450
Added --beacon.api flags to enable experimental beacon api. (#8727)
Make it so that erigon can the enable beacon api.
2023-11-15 15:07:16 +01:00
battlmonstr
b37e980caa
fix erigon-ext-test golang error (#8734)
go: no module declaration in go.mod. To specify the module path:
	go mod edit -module=example.com/mod
2023-11-15 18:49:10 +07:00
Alex Sharov
300931b456
grafana board: fix cpu chart (#8733) 2023-11-15 15:00:25 +07:00
Alex Sharov
9a9db2d90b
downloader: whitelist only .seg.torrent files. (#8729) 2023-11-15 11:23:57 +07:00
Andrew Ashikhmin
957a94e551
Revert ethereum tests back to v12.3 (#8724)
Revert inadvertent change made by PR #8515
2023-11-14 10:50:53 +01:00
Ino Murko
bb44373d95
cli param for MaxGetProofRewindBlockCount (#8515)
https://github.com/ledgerwatch/erigon/issues/7748

Paramatrizing a hardcoded parameter through CLI flags. 100k is the
default, as it was set previously.
2023-11-13 19:11:35 +03:00
Giulio rebuffo
8d8368091c
Add full support to beacon snapshots (#8665)
This PR adds beacon blocks snapshots for the following chains:

* Mainnet snapshots
* Sepolia snapshots
2023-11-13 14:10:57 +01:00
Andrew Ashikhmin
1857aa4a60
Remove stale issues workflow (#8716)
At the team meeting in Istanbul we decided to remove the auto-stale bot.
2023-11-13 13:12:22 +01:00
Andrew Ashikhmin
d60356e05b
params: begin 2.55 release cycle (#8715) 2023-11-13 12:41:39 +01:00
Andrew Ashikhmin
aeec5221c9
params: remove dev from v2.54.0 (#8713) 2023-11-13 11:48:44 +01:00
guangwu
887dd255ff
chore: remove refs to deprecated io/ioutil (#8557) 2023-11-13 10:32:14 +01:00
dependabot[bot]
97e94f6d2c
build(deps): bump github.com/consensys/gnark-crypto from 0.12.0 to 0.12.1 in /erigon-lib (#8680)
Bumps
[github.com/consensys/gnark-crypto](https://github.com/consensys/gnark-crypto)
from 0.12.0 to 0.12.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/consensys/gnark-crypto/releases">github.com/consensys/gnark-crypto's
releases</a>.</em></p>
<blockquote>
<h2>v0.12.1</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: GLV exponentiation in GT with large exponents by <a
href="https://github.com/ThomasPiellard"><code>@​ThomasPiellard</code></a>
in <a
href="https://redirect.github.com/Consensys/gnark-crypto/pull/451">Consensys/gnark-crypto#451</a>
<a
href="https://github.com/Consensys/gnark-crypto/security/advisories/GHSA-pffg-92cg-xf5c">Security
Advisory</a></li>
<li>feat: kzg extended transcript by <a
href="https://github.com/ThomasPiellard"><code>@​ThomasPiellard</code></a>
in <a
href="https://redirect.github.com/Consensys/gnark-crypto/pull/452">Consensys/gnark-crypto#452</a></li>
<li>perf(fft): introduce cache efficient bit reverse shuffling by <a
href="https://github.com/gbotrel"><code>@​gbotrel</code></a> in <a
href="https://redirect.github.com/Consensys/gnark-crypto/pull/446">Consensys/gnark-crypto#446</a></li>
<li>perf: Improve performance of point equality checks by <a
href="https://github.com/jsign"><code>@​jsign</code></a> in <a
href="https://redirect.github.com/Consensys/gnark-crypto/pull/450">Consensys/gnark-crypto#450</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Consensys/gnark-crypto/compare/v0.12.0...v0.12.1">https://github.com/Consensys/gnark-crypto/compare/v0.12.0...v0.12.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="da0317fd01"><code>da0317f</code></a>
clean: remove useless snippet in mulWindowed (<a
href="https://redirect.github.com/consensys/gnark-crypto/issues/453">#453</a>)</li>
<li><a
href="65cdb1d1c2"><code>65cdb1d</code></a>
Feat/kzg extended transcript (<a
href="https://redirect.github.com/consensys/gnark-crypto/issues/452">#452</a>)</li>
<li><a
href="95e674b3d6"><code>95e674b</code></a>
perf(fft): introduce cache efficient bit reverse shuffling (<a
href="https://redirect.github.com/consensys/gnark-crypto/issues/446">#446</a>)</li>
<li><a
href="ec6be1a037"><code>ec6be1a</code></a>
Merge pull request <a
href="https://redirect.github.com/consensys/gnark-crypto/issues/451">#451</a>
from Consensys/fix/glv</li>
<li><a
href="aef1eef48a"><code>aef1eef</code></a>
fix: add GT ExpGLV fix to BLS24 + BW6</li>
<li><a
href="feaf161b4d"><code>feaf161</code></a>
fix: merge and fix tests for expGLV</li>
<li><a
href="ced3076bef"><code>ced3076</code></a>
fix: use max(size(s1), size(s2)) for ExpGLV</li>
<li><a
href="4096ad9913"><code>4096ad9</code></a>
feat: discared useless files</li>
<li><a
href="ace5318b72"><code>ace5318</code></a>
Merge pull request <a
href="https://redirect.github.com/consensys/gnark-crypto/issues/450">#450</a>
from jsign/jsign-eq-improv</li>
<li><a
href="dc4e2d4f77"><code>dc4e2d4</code></a>
feat: added test for [-s]G=-[s]G</li>
<li>Additional commits viewable in <a
href="https://github.com/consensys/gnark-crypto/compare/v0.12.0...v0.12.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/consensys/gnark-crypto&package-manager=go_modules&previous-version=0.12.0&new-version=0.12.1)](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-11-13 10:27:26 +01:00
Alex Sharov
950bb12098
metrics: race fix (#8701) 2023-11-11 18:09:04 +03:00
Alex Sharov
35bfffd621
sys deps up (#8695) 2023-11-11 15:04:18 +03:00
Alex Sharov
6722334671
fix mdbx version in devel branch (#8679) 2023-11-10 19:44:15 +03:00
Alex Sharov
c344144133
defaults change: increase default --db.read.concurrency 4 times (#8683)
we plan step-by-step keep increasing this default
still see users for who it helped to handle more rpc 
tradeoff: increasing of this flag - increasing "historical rpc"
throughput and decreasing "recent data rpc" throughput
2023-11-10 09:52:12 +03:00
Arpit Temani
4297a31155
agra hf mainnet (#8684)
Add Agra HF details for bor mainnet.
2023-11-09 19:03:45 +05:30
pwd123
ff88a9393e
fix-rules-typo (#8681) 2023-11-09 07:40:24 +03:00
pwd123
a0682088ab
Add readonly transaction rollback check rule (#8682) 2023-11-09 07:40:11 +03:00
Dmytro
466031ab8f
add fixes (#8673) 2023-11-08 17:02:30 +03:00
Manav Darji
97f00a1433
headerdownload: handle tie breaker for forkchoice in pow networks (#8616)
Based on https://github.com/maticnetwork/bor/pull/871 in bor, this PR
handles import of same difficulty chains (tie breaker conditions) based
on their height and hash.

This PR also modifies an existing test to check different types of
side-chain import and how the canonical is decided.
2023-11-07 19:24:59 +00:00
Dmytro
9c7c758bda
added snapshot sync diagnostic information, updated diagnostic channel (#8645) 2023-11-07 12:50:36 +00:00
Sixtysixter
d1271268c7
debug_traceBlockByNumber pattern test (#8655)
added debug_traceBlockByNumber API pattern test
2023-11-07 15:51:25 +07:00
Mark Holt
509a7af26a
Discovery zero refresh timer (#8661)
This fixes an issue where the mumbai testnet node struggle to find
peers. Before this fix in general test peer numbers are typically around
20 in total between eth66, eth67 and eth68. For new peers some can
struggle to find even a single peer after days of operation.

These are the numbers after 12 hours or running on a node which
previously could not find any peers: eth66=13, eth67=76, eth68=91.

The root cause of this issue is the following:

- A significant number of mumbai peers around the boot node return
network ids which are different from those currently available in the
DHT
- The available nodes are all consequently busy and return 'too many
peers' for long periods

These issues case a significant number of discovery timeouts, some of
the queries will never receive a response.

This causes the discovery read loop to enter a channel deadlock - which
means that no responses are processed, nor timeouts fired. This causes
the discovery process in the node to stop. From then on it just
re-requests handshakes from a relatively small number of peers.

This check in fixes this situation with the following changes:

- Remove the deadlock by running the timer in a separate go-routine so
it can run independently of the main request processing.
- Allow the discovery process matcher to match on port if no id match
can be established on initial ping. This allows subsequent node
validation to proceed and if the node proves to be valid via the
remainder of the look-up and handshake process it us used as a valid
peer.
- Completely unsolicited responses, i.e. those which come from a
completely unknown ip:port combination continue to be ignored.
-
2023-11-07 08:48:58 +00:00
Giulio rebuffo
e08b031f74
Updated go.sum and go.mod for snapshots (#8664) 2023-11-06 23:39:44 +01:00
Giulio rebuffo
4b580dcc2f
update caplin snapshots hashes (#8663)
This PR also adds snippets to download caplin snapshots
2023-11-06 21:05:07 +01:00
Giulio rebuffo
e67db34145
Caplin: Bumbed down snapshots from 500 to 100k (#8657) 2023-11-06 15:41:19 +01:00
Alex Sharov
bba91e90ec
downloader: demote webseed request errors (#8662) 2023-11-06 14:47:57 +01:00
pwd123
0df5a6c08a
add rollback tx at GetVoteOnHash #8637 (#8660)
At `turbo/jsonrpc/bor_snapshot.go:239` creates read only transaction and
acquire semaphore but does not rollback or commit transaction and
unrelease semaphore lock. Over time, this will result in the locking all
of semaphore resources. Any other resources can't acquire semaphore.

I added defer function to rollback transaction to release semaphore.
2023-11-06 11:39:10 +00:00
ledgerwatch
1185587b20
Move validator set snapshot computation to bor_heimdall stage (#8646)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-11-06 08:24:33 +00:00
NotCoffee418
86e7abecc4
Fix typos and capitalization in --help (#8659) 2023-11-06 13:38:48 +07:00
ledgerwatch
2064edc5e6
Add arguments (no-op) (#8653) 2023-11-04 17:44:34 +00:00
ledgerwatch
138dceb639
Make some functions in bor exportable (no-op) (#8650) 2023-11-04 12:54:31 +00:00
ledgerwatch
6b09679774
Fix typo in make output (#8649) 2023-11-04 11:11:15 +00:00
ledgerwatch
a77e33e7c4
Introduce extra functions for BorSpans (no-op) (#8648) 2023-11-04 10:59:07 +00:00