Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
56d63bd
fix:refactor content lookup and trace
GrapeBaBa May 27, 2025
205086b
handle find content add limit for utp
thinkAfCod May 23, 2025
c296f77
update shisui1 version and utp version
thinkAfCod May 23, 2025
c36fc8b
fix lint
thinkAfCod May 23, 2025
1d6f0e7
fix permit limit
thinkAfCod May 23, 2025
bd67624
modify permit type
thinkAfCod May 24, 2025
ac81111
fix lint
thinkAfCod May 24, 2025
6584b38
fix release limit
thinkAfCod May 24, 2025
8112b3a
simply release limit
thinkAfCod May 25, 2025
1d608af
fix offer worker
thinkAfCod May 25, 2025
6e33b49
update shisui1 version
thinkAfCod May 25, 2025
7b8c025
fix shutdown lookup block
thinkAfCod May 27, 2025
59e1d32
no need to close result channel
thinkAfCod May 27, 2025
1f2a799
revert lookup
thinkAfCod May 27, 2025
e768cf0
update version of shisui1 and utp-go
thinkAfCod May 28, 2025
fa9e0be
refactor lookup
thinkAfCod May 28, 2025
f956c2a
do not close result channel
thinkAfCod May 28, 2025
85738d6
fit lint and move content lookup to lookup.go
thinkAfCod May 29, 2025
62c061c
config discv5 response timeout
thinkAfCod May 29, 2025
12b098f
fix look up content timeout
thinkAfCod May 29, 2025
2000973
use pool to handle lookup content
thinkAfCod May 30, 2025
564c987
add pool size for content lookup
thinkAfCod May 30, 2025
b01cf0b
fix talk request leak
thinkAfCod May 30, 2025
18624e2
fix talk request can not add ctx
thinkAfCod May 30, 2025
6bad5b7
update shisui1 version
thinkAfCod May 30, 2025
e024b4f
update shisui1 version
thinkAfCod May 30, 2025
8b9f05c
add logs for state starting a goroutine
thinkAfCod May 30, 2025
cc57e81
fix active queries count
thinkAfCod May 30, 2025
45e5ef8
fix test case and add logs
thinkAfCod May 30, 2025
39c7322
add log and adjust metrics point
thinkAfCod May 31, 2025
11150f8
remove find content parameter of ctx
thinkAfCod May 31, 2025
45f2bdc
add ctx for find content
thinkAfCod Jun 1, 2025
3987734
update utp-go version
thinkAfCod Jun 1, 2025
0d2c4fa
special log for contentLookup
thinkAfCod Jun 1, 2025
6b23ec5
add log and revert shisui1 version
thinkAfCod Jun 1, 2025
b2df074
fix find content method ref
thinkAfCod Jun 1, 2025
9482fda
lookup content concurrency limit set to 1
thinkAfCod Jun 1, 2025
54dcc8b
add log
thinkAfCod Jun 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/tetratelabs/wabin v0.0.0-20230304001439-f6f874872834
github.com/urfave/cli/v2 v2.27.6
github.com/zen-eth/utp-go v0.0.0-20250517113239-5d962dd66394
github.com/zen-eth/utp-go v0.0.0-20250601092006-0508310c08c3
go.uber.org/automaxprocs v1.6.0
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0
golang.org/x/sync v0.14.0
Expand Down Expand Up @@ -117,4 +117,4 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/optimism-java/shisui v1.14.6-0.20250516133529-e5d979e5825f
replace github.com/ethereum/go-ethereum => github.com/optimism-java/shisui v1.14.6-0.20250526144834-7569b8f3f6b5
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/optimism-java/shisui v1.14.6-0.20250516133529-e5d979e5825f h1:/qGqNuNi9Q+/WZAikhZEHvwhm8TIwVxgamxk9G8mkfg=
github.com/optimism-java/shisui v1.14.6-0.20250516133529-e5d979e5825f/go.mod h1:Cak0mDbSoH9geLA691ioescz1vXoXchz7rxF1DcNizE=
github.com/optimism-java/shisui v1.14.6-0.20250526144834-7569b8f3f6b5 h1:pu6xWJifKseNAUB37VC4mn0xceUwQu2ogECgXCHtwEg=
github.com/optimism-java/shisui v1.14.6-0.20250526144834-7569b8f3f6b5/go.mod h1:Cak0mDbSoH9geLA691ioescz1vXoXchz7rxF1DcNizE=
github.com/optimism-java/zrnt v0.32.4-0.20250528142456-bc543d07ddb2 h1:F40qRmm51C04XA8zZWSd1dZDu57OOPKTyiKpUFuLw68=
github.com/optimism-java/zrnt v0.32.4-0.20250528142456-bc543d07ddb2/go.mod h1:A0fezkp9Tt3GBLATSPIbuY4ywYESyAuc/FFmPKg8Lqs=
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
Expand Down Expand Up @@ -300,8 +300,8 @@ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBi
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zen-eth/utp-go v0.0.0-20250517113239-5d962dd66394 h1:iBectudmNrjGXexs3R/GEYbJHZ5RNdpUOoBc0GYFRGU=
github.com/zen-eth/utp-go v0.0.0-20250517113239-5d962dd66394/go.mod h1:j1tRbjVA455+fpF7B9yh+qkld0OQCXwMzb9dyuRWFGs=
github.com/zen-eth/utp-go v0.0.0-20250601092006-0508310c08c3 h1:VT3Obx3YsaqB9sKHFDflbIsmFp2+zPvDSH+LvxIYA88=
github.com/zen-eth/utp-go v0.0.0-20250601092006-0508310c08c3/go.mod h1:j1tRbjVA455+fpF7B9yh+qkld0OQCXwMzb9dyuRWFGs=
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
Expand Down
9 changes: 5 additions & 4 deletions portal/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,11 @@ func (n *Node) initUDP() error {
// initDiscV5 initializes the discV5 protocol and local node
func (n *Node) initDiscV5() error {
discCfg := discover.Config{
PrivateKey: n.config.PrivateKey,
NetRestrict: n.config.PortalProtocolConfig.NetRestrict,
Bootnodes: n.config.PortalProtocolConfig.BootstrapNodes,
Log: log.New("protocol", "discV5"),
PrivateKey: n.config.PrivateKey,
NetRestrict: n.config.PortalProtocolConfig.NetRestrict,
Bootnodes: n.config.PortalProtocolConfig.BootstrapNodes,
V5RespTimeout: n.config.PortalProtocolConfig.Discv5RespTimeout,
Log: log.New("protocol", "discV5"),
}

nodeDB, err := enode.OpenDB(n.config.PortalProtocolConfig.NodeDBPath)
Expand Down
10 changes: 5 additions & 5 deletions portalwire/api.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package portalwire

import (
"context"
"errors"

"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -410,7 +411,7 @@ func (p *PortalProtocolAPI) FindContent(enr string, contentKey string) (interfac
return nil, err
}

flag, findContent, err := p.portalProtocol.findContent(n, contentKeyBytes)
flag, findContent, err := p.portalProtocol.findContent(context.Background(), n, contentKeyBytes)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -474,7 +475,7 @@ func (p *PortalProtocolAPI) Offer(enr string, contentItems [][2]string) (string,
Kind: TransientOfferRequestKind,
Request: transientOfferRequest,
}
accept, err := p.portalProtocol.offer(n, offerReq, &NoPermit{})
accept, err := p.portalProtocol.offer(n, offerReq, PermitNotLimit)
if err != nil {
return "", err
}
Expand Down Expand Up @@ -519,7 +520,7 @@ func (p *PortalProtocolAPI) TraceOffer(enr string, key string, value string) (in
Request: transientOfferRequestWithResult,
}

_, err = p.portalProtocol.offer(n, offerReq, &NoPermit{})
_, err = p.portalProtocol.offer(n, offerReq, PermitNotLimit)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -554,7 +555,6 @@ func (p *PortalProtocolAPI) RecursiveFindContent(contentKeyHex string) (*Content
UtpTransfer: false,
}, nil
}
p.portalProtocol.Log.Warn("find content err", "contextKey", hexutil.Encode(contentKey), "err", err)

content, utpTransfer, err := p.portalProtocol.ContentLookup(contentKey, contentId)

Expand Down Expand Up @@ -683,7 +683,7 @@ func (p *PortalProtocolAPI) PutContent(contentKeyHex, contentHex string) (*PutCo
continue
}

_, offerErr := p.portalProtocol.offer(nodeToOffer, offerReq, &NoPermit{})
_, offerErr := p.portalProtocol.offer(nodeToOffer, offerReq, PermitNotLimit)
if offerErr != nil {
p.portalProtocol.Log.Warn("Failed to offer content to lookup node", "node", nodeToOffer.ID(), "err", offerErr)
continue
Expand Down
Loading