Commit graph

15934 commits

Author SHA1 Message Date
thinkAfCod
7ce7980bd5 fix: go.sum updated by go mod tidy 2024-10-23 23:59:03 +08:00
thinkAfCod
a75e981c5b fix: replace assert to require 2024-10-23 23:59:03 +08:00
thinkAfCod
b44ca3c190 fix: upgrade utp-go 2024-10-23 23:59:03 +08:00
Chen Kai
8563ce1d52 add wait discv5 table 2024-10-23 16:52:52 +08:00
thinkAfCod
cfbffc571f fix: cache id and addr in discv5
revert
2024-10-23 11:29:29 +08:00
thinkAfCod
d34a772ac3 fix: check lint 2024-10-23 11:29:29 +08:00
thinkAfCod
81477ca08b fix: not cache nil node 2024-10-23 11:29:29 +08:00
thinkAfCod
12182b4afe fix: test case modify 2024-10-23 11:29:29 +08:00
thinkAfCod
c997bb0321 fix: log packet nonce 2024-10-23 11:29:29 +08:00
thinkAfCod
d28ff8ff6d fix: cache node 2024-10-23 11:29:29 +08:00
rafaelss
95c2637065
Merge pull request #203 from r4f4ss/metrics_ethstats
[WIP] Metrics implementation
2024-10-21 21:05:23 -04:00
rafaelss
49351666c5
Merge branch 'optimism-java:portal' into metrics_ethstats 2024-10-21 16:41:59 -04:00
Chen Kai
5d315f8d32
Merge branch 'ethereum:master' into portal 2024-10-21 22:11:24 +08:00
Péter Szilágyi
a5fe7353cf
common: drop BigMin and BigMax, they pollute our dep graph (#30645)
Way back we've added `common.math.BigMin` and `common.math.BigMax`.
These were kind of cute helpers, but unfortunate ones, because package
all over out codebase added dependencies to this package just to avoid
having to write out 3 lines of code.

Because of this, we've also started having package name clashes with the
stdlib `math`, which got solves even more badly by moving some helpers
over ***from*** the stdlib into our custom lib (e.g. MaxUint64). The
latter ones were nuked out in a previous PR and this PR nukes out BigMin
and BigMax, inlining them at all call sites.

As we're transitioning to uint256, if need be, we can add a min and max
to that.
2024-10-21 12:45:33 +03:00
Péter Szilágyi
31a6418d77
consensus/clique, miner: remove clique -> accounts dependency (#30642)
Clique currently depends on the `accounts` package. This was a bit of a
big cannon even in the past, just to pass a signer "account" to the
Clique block producer. Either way, nowadays Geth does not support clique
mining any more, so by removing that bit of functionality from our code,
we can also break this dependency.

Clique should ideally be further torn out, but this at least gets us one
step closer to cleanups.
2024-10-21 09:24:28 +03:00
Martin HS
e4dbd5f685
eth/tracers/js: avoid compiling js bigint when not needed (#30640)
While looking at some mem profiles from `evm` runs, I noticed that
`goja` compilation of the bigint library was present. The bigint library
compilation happens in a package `init`, whenever the package
`eth/tracers/js` is loaded. This PR changes it to load lazily when
needed.

It becomes slightly faster with this change, and slightly less alloc:y. 

Non-scientific benchmark with 100 executions: 
```
time for i in {1..100}; do ./evm --code 6040 run; done;
 ```

current `master`:

```
real    0m6.634s
user    0m5.213s
sys     0m2.277s
```
Without compiling bigint
```
real    0m5.802s
user    0m4.191s
sys     0m1.965s
```
2024-10-20 19:36:51 +03:00
Péter Szilágyi
dac54e31a7
build, internal, version: break ci.go/version->common dependency (#30638)
This PR tries to break the ci.go to common dependency by moving the
version number out of params.
2024-10-20 19:28:39 +03:00
Péter Szilágyi
5c3b792e61 common/math: sigh, keep deleting dead code 2024-10-20 15:43:39 +03:00
Péter Szilágyi
9015a05f31
common/math: delete some further dead code (#30639) 2024-10-20 15:38:31 +03:00
Péter Szilágyi
bb527b949a
build: get rid of ci.go -> common direct dependency (#30637) 2024-10-20 14:54:06 +03:00
Péter Szilágyi
48d05c43c9
all: get rid of custom MaxUint64 and MaxUint64 (#30636) 2024-10-20 14:41:51 +03:00
Péter Szilágyi
babd5d8026
core/state: fix runaway alloc caused by prefetcher heap escape (#30629)
Co-authored-by: lightclient <lightclient@protonmail.com>
2024-10-20 13:25:15 +03:00
fearlessfe
df4e0d2032 fix: test error 2024-10-19 20:00:03 +08:00
fearlessfe
4587ceb69d fix: rpc method error in state network 2024-10-19 20:00:03 +08:00
rjl493456442
b6c62d5887
core, trie, triedb: minor changes from snapshot integration (#30599)
This change ports some non-important changes from https://github.com/ethereum/go-ethereum/pull/30159, including interface renaming and some trivial refactorings.
2024-10-18 17:06:31 +02:00
Péter Szilágyi
3ff73d46b3
build: reenable building arm64 concurrently (#30626) 2024-10-18 14:49:27 +03:00
Péter Szilágyi
9891f02d48
gitignore: get rid of some relics (#30623)
Clean out some ancient stuff from git ignore.
2024-10-18 12:02:32 +03:00
Péter Szilágyi
f32f8686cd
swarm: nuke this leftover (#30622)
Swarm moved out more than 5 years ago, time to let it go.
2024-10-18 11:34:46 +03:00
Rafael Sampaio
9d046eab42 improves metric names 2024-10-18 02:11:13 -03:00
rafaelss
c9fe01e500
Merge branch 'optimism-java:portal' into metrics_ethstats 2024-10-18 00:42:42 -04:00
fearlseefe
86c1b7d12e feat: lint error 2024-10-18 12:38:45 +08:00
fearlessfe
8baf51752b feat: rpc api change 2024-10-18 12:38:45 +08:00
Rafael Sampaio
c9ddfbf290 content validation metrics 2024-10-18 00:19:22 -03:00
Chen Kai
2be69a1ace
Merge branch 'ethereum:master' into portal 2024-10-18 11:03:14 +08:00
Rafael Sampaio
e85b17cf37 utp protocol metrics 2024-10-17 23:21:04 -03:00
Rafael Sampaio
efa2e9002a refactor: portal protocol metrics 2024-10-17 21:46:22 -03:00
Rafael Sampaio
d1b5606b00 metric storage_capacity 2024-10-17 18:41:12 -03:00
Péter Szilágyi
afea3bd49c
beacon/engine, core/txpool, eth/catalyst: add engine_getBlobsV1 API (#30537) 2024-10-17 19:27:35 +03:00
Rafael Sampaio
c5d13e4b74 metric radius rate 2024-10-17 12:02:47 -03:00
Rafael Sampaio
9b9d666dc4 portal_protocol.go metrics 2024-10-17 10:45:44 -03:00
lightclient
e26468f6f6
beacon/engine,eth/catalyst: hex marshal requests in engine api (#30603)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-10-17 10:05:17 +02:00
lightclient
1da34a37ec
miner: send full request when resolving full payload (#30615)
Fixes an issue missed in #30576 where we send empty requests for a full
payload being resolved, causing hash mismatch later on when we get the
payload back via `NewPayload`.
2024-10-17 10:04:20 +02:00
Chen Kai
c5236fc9a9
Merge branch 'ethereum:master' into portal 2024-10-17 14:40:34 +08:00
Sina M
978ca5fc5e
eth/tracers: various fixes (#30540)
Breaking changes:

- The ChainConfig was exposed to tracers via VMContext passed in
`OnTxStart`. This is unnecessary specially looking through the lens of
live tracers as chain config remains the same throughout the lifetime of
the program. It was there so that native API-invoked tracers could
access it. So instead we moved it to the constructor of API tracers.

Non-breaking:

- Change the default config of the tracers to be `{}` instead of nil.
This way an extra nil check can be avoided.

Refactoring:

- Rename `supply` struct to `supplyTracer`.
- Un-export some hook definitions.
2024-10-17 06:51:47 +02:00
rafaelss
b8a8f39f2b
Merge pull request #198 from r4f4ss/log_format
Add flag to format logs
2024-10-16 14:58:26 -04:00
Marius van der Wijden
18a591811f
core: reduce peak memory usage during reorg (#30600)
~~Opening this as a draft to have a discussion.~~ Pressed the wrong
button
I had [a previous PR
](https://github.com/ethereum/go-ethereum/pull/24616)a long time ago
which reduced the peak memory used during reorgs by not accumulating all
transactions and logs.
This PR reduces the peak memory further by not storing the blocks in
memory.
However this means we need to pull the blocks back up from storage
multiple times during the reorg.
I collected the following numbers on peak memory usage: 

// Master: BenchmarkReorg-8 10000 899591 ns/op 820154 B/op 1440
allocs/op 1549443072 bytes of heap used
// WithoutOldChain: BenchmarkReorg-8 10000 1147281 ns/op 943163 B/op
1564 allocs/op 1163870208 bytes of heap used
// WithoutNewChain: BenchmarkReorg-8 10000 1018922 ns/op 943580 B/op
1564 allocs/op 1171890176 bytes of heap used

Each block contains a transaction with ~50k bytes and we're doing a 10k
block reorg, so the chain should be ~500MB in size

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2024-10-16 19:46:40 +03:00
fearlseefe
e5b5bede46 docs: update readme 2024-10-16 22:41:08 +08:00
Péter Szilágyi
368e16f39d
core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
Rafael Sampaio
33843613e0 code cleanup and improved variable names 2024-10-15 17:41:29 -03:00
Rafael Sampaio
eca301a9b1 move logformat flag to portal network namespace 2024-10-15 16:29:45 -03:00