Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
7a80cf65
Unverified
Commit
7a80cf65
authored
Mar 16, 2022
by
rjl493456442
Committed by
GitHub
Mar 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
les, tests: fix vflux fuzzer by removing unnecessary panic (#24537)
parent
8d99fede
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
clientpool.go
les/vflux/server/clientpool.go
+2
-2
clientpool-fuzzer.go
tests/fuzzers/vflux/clientpool-fuzzer.go
+1
-3
No files found.
les/vflux/server/clientpool.go
View file @
7a80cf65
...
@@ -34,7 +34,7 @@ import (
...
@@ -34,7 +34,7 @@ import (
var
(
var
(
ErrNotConnected
=
errors
.
New
(
"client not connected"
)
ErrNotConnected
=
errors
.
New
(
"client not connected"
)
ErrNoPriority
=
errors
.
New
(
"priority too low to raise capacity"
)
ErrNoPriority
=
errors
.
New
(
"priority too low to raise capacity"
)
ErrCantFindMaximum
=
errors
.
New
(
"
U
nable to find maximum allowed capacity"
)
ErrCantFindMaximum
=
errors
.
New
(
"
u
nable to find maximum allowed capacity"
)
)
)
// ClientPool implements a client database that assigns a priority to each client
// ClientPool implements a client database that assigns a priority to each client
...
@@ -177,7 +177,7 @@ func (cp *ClientPool) Unregister(peer clientPeer) {
...
@@ -177,7 +177,7 @@ func (cp *ClientPool) Unregister(peer clientPeer) {
cp
.
ns
.
SetField
(
peer
.
Node
(),
cp
.
setup
.
clientField
,
nil
)
cp
.
ns
.
SetField
(
peer
.
Node
(),
cp
.
setup
.
clientField
,
nil
)
}
}
//
s
etConnectedBias sets the connection bias, which is applied to already connected clients
//
S
etConnectedBias sets the connection bias, which is applied to already connected clients
// So that already connected client won't be kicked out very soon and we can ensure all
// So that already connected client won't be kicked out very soon and we can ensure all
// connected clients can have enough time to request or sync some data.
// connected clients can have enough time to request or sync some data.
func
(
cp
*
ClientPool
)
SetConnectedBias
(
bias
time
.
Duration
)
{
func
(
cp
*
ClientPool
)
SetConnectedBias
(
bias
time
.
Duration
)
{
...
...
tests/fuzzers/vflux/clientpool-fuzzer.go
View file @
7a80cf65
...
@@ -267,9 +267,7 @@ func FuzzClientPool(input []byte) int {
...
@@ -267,9 +267,7 @@ func FuzzClientPool(input []byte) int {
bias
=
f
.
randomDelay
()
bias
=
f
.
randomDelay
()
requested
=
f
.
randomBool
()
requested
=
f
.
randomBool
()
)
)
if
_
,
err
:=
pool
.
SetCapacity
(
f
.
peers
[
index
]
.
node
,
reqCap
,
bias
,
requested
);
err
==
vfs
.
ErrCantFindMaximum
{
pool
.
SetCapacity
(
f
.
peers
[
index
]
.
node
,
reqCap
,
bias
,
requested
)
panic
(
nil
)
}
doLog
(
"Set capacity"
,
"id"
,
f
.
peers
[
index
]
.
node
.
ID
(),
"reqcap"
,
reqCap
,
"bias"
,
bias
,
"requested"
,
requested
)
doLog
(
"Set capacity"
,
"id"
,
f
.
peers
[
index
]
.
node
.
ID
(),
"reqcap"
,
reqCap
,
"bias"
,
bias
,
"requested"
,
requested
)
case
7
:
case
7
:
index
:=
f
.
randomByte
()
index
:=
f
.
randomByte
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment