Skip to content

Commit 83d3e46

Browse files
committed
fix: rename requests cache variables
1 parent 33dd60e commit 83d3e46

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cmd/p2p/sensor/sensor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type (
7070
Database string
7171
NoDiscovery bool
7272
MaxRequests int
73-
RequestCacheTTL time.Duration
73+
RequestsCacheTTL time.Duration
7474

7575
bootnodes []*enode.Node
7676
staticNodes []*enode.Node
@@ -207,7 +207,7 @@ var SensorCmd = &cobra.Command{
207207
ForkID: forkid.ID{Hash: [4]byte(inputSensorParams.ForkID)},
208208
MsgCounter: msgCounter,
209209
MaxRequests: inputSensorParams.MaxRequests,
210-
RequestCacheTTL: inputSensorParams.RequestCacheTTL,
210+
RequestCacheTTL: inputSensorParams.RequestsCacheTTL,
211211
}
212212

213213
config := ethp2p.Config{
@@ -481,5 +481,5 @@ will result in less chance of missing data but can significantly increase memory
481481
- none (no persistence)`)
482482
f.BoolVar(&inputSensorParams.NoDiscovery, "no-discovery", false, "disable P2P peer discovery")
483483
f.IntVar(&inputSensorParams.MaxRequests, "max-requests", 2048, "maximum request IDs to track per peer (0 for no limit)")
484-
f.DurationVar(&inputSensorParams.RequestCacheTTL, "requests-cache-ttl", 5*time.Minute, "time to live for requests cache entries (0 for no expiration)")
484+
f.DurationVar(&inputSensorParams.RequestsCacheTTL, "requests-cache-ttl", 5*time.Minute, "time to live for requests cache entries (0 for no expiration)")
485485
}

p2p/protocol.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ type EthProtocolOptions struct {
6767
HeadMutex *sync.RWMutex
6868

6969
// Request cache configuration
70-
MaxRequests int
71-
RequestCacheTTL time.Duration
70+
MaxRequests int
71+
RequestsCacheTTL time.Duration
7272
}
7373

7474
// HeadBlock contains the necessary head block data for the status message.
@@ -101,7 +101,7 @@ func NewEthProtocol(version uint, opts EthProtocolOptions) ethp2p.Protocol {
101101
logger: log.With().Str("peer", p.Node().URLv4()).Logger(),
102102
rw: rw,
103103
db: opts.Database,
104-
requests: NewCache[uint64, common.Hash](opts.MaxRequests, opts.RequestCacheTTL),
104+
requests: NewCache[uint64, common.Hash](opts.MaxRequests, opts.RequestsCacheTTL),
105105
requestNum: 0,
106106
head: opts.Head,
107107
headMutex: opts.HeadMutex,

0 commit comments

Comments
 (0)