ethereum-optimism / ethereum-optimism/optimism

op-node/p2p/gossip - ConfigureGossip overwrites sane defaults with zero values

Open
#17,308 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.5k
Forks
4k
Avg merge
2d 15h
Merged PRs (30d)
145

Description

**Bug Description**

https://github.com/ethereum-optimism/optimism/blob/develop/op-node/p2p/gossip.go#L146
```
params := BuildGlobalGossipParams(rollupCfg)

// override with CLI changes
params.D = p.MeshD
params.Dlo = p.MeshDLo
params.Dhi = p.MeshDHi
params.Dlazy = p.MeshDLazy
```
This sets the params values directly to those passed in. However, if the passed in struct does not have a value explicitly set (eg `MeshDHi`) then the zero value (0 in this case) is used, which replaced the sane default set earlier with `BuildGlobalGossipParams` (12 btw).

**Steps to Reproduce**
n/a - I've given you the exact code that is wrong.

**Expected behavior**
Should only overwrite these values when non-zero

**Environment Information:**
n/a

**Configurations:**
n/a

**Logs:**
n/a

**Additional context**
n/a

---

⚠️ **Notice:** Issues that do not include the following sections will be subject to closure:
- Bug Description
- Steps to Reproduce
- Environment Information

Please ensure all required sections are filled out accurately to expedite the debugging process and improve issue resolution efficiency.

Contributor guide

Open the contributing guide

Research direction

Start at op-node/p2p/gossip.go around ConfigureGossip and BuildGlobalGossipParams. Check the CLI parameter overrides and verify that zero-valued fields preserve the defaults while explicitly provided nonzero values still override them; done means the sane defaults are no longer replaced by zeros.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.