Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
exchain
nebula
Commits
9be79339
Unverified
Commit
9be79339
authored
Jan 26, 2023
by
mergify[bot]
Committed by
GitHub
Jan 26, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4790 from ethereum-optimism/jg/fix_disable_p2p
op-node: Fix disable p2p
parents
f3f9960c
f75aae34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
main.go
op-node/cmd/main.go
+1
-1
config.go
op-node/p2p/config.go
+5
-0
prepared.go
op-node/p2p/prepared.go
+4
-0
No files found.
op-node/cmd/main.go
View file @
9be79339
...
...
@@ -123,7 +123,7 @@ func RollupNodeMain(ctx *cli.Context) error {
if
cfg
.
Heartbeat
.
Enabled
{
var
peerID
string
if
cfg
.
P2P
==
nil
{
if
cfg
.
P2P
.
Disabled
()
{
peerID
=
"disabled"
}
else
{
peerID
=
n
.
P2P
()
.
Host
()
.
ID
()
.
String
()
...
...
op-node/p2p/config.go
View file @
9be79339
...
...
@@ -33,6 +33,7 @@ var DefaultBootnodes = []*enode.Node{
// SetupP2P provides a host and discovery service for usage in the rollup node.
type
SetupP2P
interface
{
Check
()
error
Disabled
()
bool
// Host creates a libp2p host service. Returns nil, nil if p2p is disabled.
Host
(
log
log
.
Logger
,
reporter
metrics
.
Reporter
)
(
host
.
Host
,
error
)
// Discovery creates a disc-v5 service. Returns nil, nil, nil if discovery is disabled.
...
...
@@ -134,6 +135,10 @@ func (conf *Config) TargetPeers() uint {
return
conf
.
PeersLo
}
func
(
conf
*
Config
)
Disabled
()
bool
{
return
conf
.
DisableP2P
}
const
maxMeshParam
=
1000
func
(
conf
*
Config
)
Check
()
error
{
...
...
op-node/p2p/prepared.go
View file @
9be79339
...
...
@@ -63,3 +63,7 @@ func (p *Prepared) Discovery(log log.Logger, rollupCfg *rollup.Config, tcpPort u
func
(
p
*
Prepared
)
ConfigureGossip
(
params
*
pubsub
.
GossipSubParams
)
[]
pubsub
.
Option
{
return
nil
}
func
(
p
*
Prepared
)
Disabled
()
bool
{
return
false
}
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