Commit graph

689 commits

Author SHA1 Message Date
Chen Kai
3c5dbf1fd8 fix:fix hive test bug
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2024-02-25 17:59:39 +08:00
fearlessfe
3a5754f43a fix: Content and Enrs ssz error 2024-02-24 13:11:40 +08:00
Chen Kai
00fcda62fa feat: fix discovery test
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2024-02-24 11:04:21 +08:00
Chen Kai
a8ba15d62c fix:add justseen node
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2024-02-23 06:43:56 +08:00
Chen Kai
12169d3848 feat:add accept ssz test
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2024-02-22 16:31:34 +08:00
fearlessfe
bcb5d28724 feat: add gossip rpc and do some refactor
1. add gossip rpc method
2. use uint256.Ummarshal method to unmarshal uint256 bytes
2024-02-18 10:24:08 +08:00
fearlessfe
5e657f8423 fix: rpc routing table info 2024-02-18 10:24:08 +08:00
Chen Kai
9461701b0e Merge branch 'master' into portal1 2024-02-12 20:00:57 +08:00
zoereco
2ab365f6d8
all: fix docstring names (#28923)
* fix wrong comment

* reviewers input

* Update log/handler_glog.go

---------

Co-authored-by: Martin HS <martin@swende.se>
2024-02-07 21:10:49 +01:00
Chen Kai
507832ca5e
Merge branch 'ethereum:master' into portal 2024-02-06 20:01:09 +08:00
fearlessfe
8651f5b4af fix: protal protocol type error 2024-02-06 16:46:36 +08:00
fearlessfe
17d1601eec fix: remove unused file 2024-02-06 16:46:36 +08:00
fearlseefe
4cc6cde8c6 feat: add test for message 2024-02-06 16:46:36 +08:00
fearlseefe
8e2253ef6d fix: add log and add static ip 2024-02-06 16:46:36 +08:00
Dimitris Apostolou
8fd43c8013
all: fix typos in comments (#28881) 2024-02-05 22:16:32 +01:00
Chris Ziogas
19af9008f1
p2p: fix accidental termination of portMappingLoop (#28911) 2024-02-05 22:00:46 +01:00
fearlessfe
35b3ac43af feat: add docker file and do some optimize 2024-02-04 14:23:22 +08:00
fearlessfe
c5bf27aaec fix: some portal-hive test err
1. add history prifix for json rpc method
2. fix deleteEnr and recursiveFindContent in rpc-compact test
2024-01-29 18:46:51 +08:00
fearlessfe
3936f0bbee feat: add rpc methods 2024-01-28 15:29:42 +08:00
fearlessfe
c3b1fe2382 feat: add history prefix in portal api 2024-01-28 15:29:42 +08:00
Chen Kai
624e45dfb6 feat:add gossip content
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2024-01-22 22:35:34 +08:00
fearlessfe
577a61c863 feat: get body and receipts 2024-01-21 18:14:20 +08:00
fearlessfe
baf8e8aac7 feat: get header by block hash 2024-01-20 18:05:58 +08:00
Chen Kai
507576e905
Merge branch 'ethereum:master' into portal 2024-01-13 23:11:05 +08:00
ddl
1335ba5f28
p2p/dnsdisc: use strings.Cut over strings.IndexByte (#28787) 2024-01-12 19:57:47 +01:00
fearlseefe
30b71fd14b refactor: use lookupworker 2024-01-09 17:09:38 +08:00
fearlseefe
c972aeda11 feat: use Lookup method 2024-01-09 17:09:38 +08:00
fearlseefe
6fbbe06767 fix: port conflict in test 2024-01-09 17:09:38 +08:00
fearlessfe
800ecad368 feat: finish contentLookup 2024-01-09 17:09:38 +08:00
fearlessfe
c0ac288ee7 faet: add content lookup test 2024-01-09 17:09:38 +08:00
fearlseefe
7fb680502e refactor: content storage
move ContentStorage interface to storage
2024-01-02 21:40:09 +08:00
thinkAfCod
c0ca1e4829 fix: lint checks 2023-12-26 10:54:22 +08:00
thinkAfCod
b14abef0cb fix: update utp-go version and modify test case 2023-12-25 18:02:35 +08:00
Chen Kai
cd5a92e383 fix:fix portal test
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2023-12-25 12:46:16 +08:00
Chen Kai
d04b685d31 Merge branch 'master' into portal1 2023-12-20 20:48:32 +08:00
Felix Lange
5b22a472d6
p2p/discover: add liveness check in collectTableNodes (#28686)
* p2p/discover: add liveness check in collectTableNodes

* p2p/discover: fix test

* p2p/discover: rename to appendLiveNodes

* p2p/discover: add dedup logic back

* p2p/discover: simplify

* p2p/discover: fix issue found by test
2023-12-18 10:47:21 +01:00
alex
edc864f9ba
all: fix typos in comments (#28682)
chore(core,eth):fix a couple of typos
2023-12-18 09:35:12 +01:00
fearlseefe
6e2481873b faat: change the content_storage package 2023-12-13 19:26:41 +08:00
fearlessfe
4fc88f8dbe feat: content storage
impl #5
2023-12-13 19:26:41 +08:00
Chen Kai
2b0315e3ab feat:add more disc/portal api
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2023-12-12 09:42:49 +08:00
Chen Kai
555b58c26c feat:rpc part2
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2023-12-11 12:44:25 +08:00
Chen Kai
088af7da90 Merge branch 'master' into portal1 2023-12-10 17:27:12 +08:00
Martin Holst Swende
5416e3ac25 log: remove lazy, remove unused interfaces, unexport methods (#28622)
This change

- Removes interface `log.Format`,
- Removes method `log.FormatFunc`,
- unexports `TerminalHandler.TerminalFormat` formatting methods (renamed to `TerminalHandler.format`)
- removes the notion of `log.Lazy` values

The lazy handler was useful in the old log package, since it
could defer the evaluation of costly attributes until later in the
log pipeline: thus, if the logging was done at 'Trace', we could
skip evaluation if logging only was set to 'Info'.

With the move to slog, this way of deferring evaluation is no longer
needed, since slog introduced 'Enabled': the caller can thus do
the evaluate-or-not decision at the callsite, which is much more
straight-forward than dealing with lazy reflect-based evaluation.

Also, lazy evaluation would not work with 'native' slog, as in, these
two statements would be evaluated differently:

```golang
  log.Info("foo", "my lazy", lazyObj)
  slog.Info("foo", "my lazy", lazyObj)
```
2023-12-10 17:21:06 +08:00
Martin Holst Swende
b8d44ed98b
log: remove lazy, remove unused interfaces, unexport methods (#28622)
This change 

- Removes interface `log.Format`, 
- Removes method `log.FormatFunc`, 
- unexports `TerminalHandler.TerminalFormat` formatting methods (renamed to `TerminalHandler.format`)
- removes the notion of `log.Lazy` values


The lazy handler was useful in the old log package, since it
could defer the evaluation of costly attributes until later in the
log pipeline: thus, if the logging was done at 'Trace', we could
skip evaluation if logging only was set to 'Info'.

With the move to slog, this way of deferring evaluation is no longer
needed, since slog introduced 'Enabled': the caller can thus do
the evaluate-or-not decision at the callsite, which is much more
straight-forward than dealing with lazy reflect-based evaluation.

Also, lazy evaluation would not work with 'native' slog, as in, these
two statements would be evaluated differently:

```golang
  log.Info("foo", "my lazy", lazyObj)
  slog.Info("foo", "my lazy", lazyObj)
```
2023-12-05 11:54:44 +01:00
Chen Kai
a9643f4ba7 feat:rpc disc/history part1
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2023-12-05 10:08:40 +08:00
thinkAfCod
da7196970f fix: update utp-go version and modify test case 2023-12-03 11:39:28 +08:00
Chen Kai
b724ba2b79 Merge branch 'opmaster' into portal1
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2023-12-01 15:55:50 +08:00
jwasinger
28e7371701
all: replace log15 with slog (#28187)
This PR replaces Geth's logger package (a fork of [log15](https://github.com/inconshreveable/log15)) with an implementation using slog, a logging library included as part of the Go standard library as of Go1.21.

Main changes are as follows:
* removes any log handlers that were unused in the Geth codebase.
* Json, logfmt, and terminal formatters are now slog handlers.
* Verbosity level constants are changed to match slog constant values.  Internal translation is done to make this opaque to the user and backwards compatible with existing `--verbosity` and `--vmodule` options.
* `--log.backtraceat` and `--log.debug` are removed.

The external-facing API is largely the same as the existing Geth logger.  Logger method signatures remain unchanged.

A small semantic difference is that a `Handler` can only be set once per `Logger` and not changed dynamically.  This just means that a new logger must be instantiated every time the handler of the root logger is changed.

----
For users of the `go-ethereum/log` module. If you were using this module for your own project, you will need to change the initialization. If you previously did 
```golang
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
```
You now instead need to do 
```golang
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelInfo, true)))
```
See more about reasoning here: https://github.com/ethereum/go-ethereum/issues/28558#issuecomment-1820606613
2023-11-29 08:33:50 +01:00
Chen Kai
aeae3676c6 fix:fix pong nil bug
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2023-11-27 22:06:05 +08:00
Chen Kai
b28975bd17 feat:add offer/accept protocol
Signed-off-by: Chen Kai <281165273grape@gmail.com>
2023-11-26 20:16:06 +08:00