Skip to content

Pairing hashes from block#11

Merged
theinterestedr1 merged 8 commits into
mainfrom
pairingHashesFromBlock
Apr 3, 2022
Merged

Pairing hashes from block#11
theinterestedr1 merged 8 commits into
mainfrom
pairingHashesFromBlock

Conversation

@theinterestedr1

Copy link
Copy Markdown
Contributor

Pairing based on block hashes, and optimised a bit for performance
added events on payments
relayer now tracks payment events, and logs errors
users unstaking now checks blocks to save to verify its not unstaking too soon (needed params overhaul)

@theinterestedr1 theinterestedr1 merged commit 522e6c6 into main Apr 3, 2022
@theinterestedr1 theinterestedr1 deleted the pairingHashesFromBlock branch April 6, 2022 08:54
shleikes pushed a commit that referenced this pull request Dec 1, 2024
fix: providers_types and name added
NadavLevi added a commit that referenced this pull request Mar 16, 2026
…ssue #11)

SetEndpointInfo and SetEndpointOverallHealth were called while m.lock (write
lock) was held. Neither method needs the lock — they only touch Prometheus
state. Calling them inside the lock is a re-entrancy hazard: if either method
ever acquires m.lock in the future it would deadlock.

Scope the lock to the map mutations only and call the setters after Unlock.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
NadavLevi added a commit that referenced this pull request Mar 16, 2026
Addresses all issues raised in code review (issues #1–9, #11–19):

Correctness:
- Add apiInterface label to endpointSelectionScore gauge and propagate it
  through SetProviderSelected interface and all call sites (#4)
- Align SetRelayNodeErrorMetric parameter order to (chainId, apiInterface,
  providerAddress, method) — was (providerAddress, chainId, apiInterface) (#7)
- Scope metric setters outside the lock in RegisterEndpoint to avoid
  re-entrant RWMutex deadlock (#11)
- Record cache latency histogram only on cache hits, not misses (#12)
- Remove dead field MeasureAfterProviderProcessingTime from RelayMetrics
  and its sole write site (#14)

Dead code:
- Remove dead stubs SetRelaySentToProviderMetric and SetRequestPerProvider
  from SmartRouterMetricsManager (#5)
- Delete empty consumer_metrics_manager_test.go (#18)

Simplification:
- Replace bespoke registerMetric closure with generic registerOrReuse
  helper throughout ConsumerMetricsManager (#6)
- Unify latency histogram buckets via shared LatencyBuckets variable in
  buckets.go — removes per-file duplicates (#8)
- Drop unnecessary goroutine spawns from RPCConsumerLogs metric forwarders;
  callers already run in goroutines where needed (#9)
- Replace RequestProperties struct with *RelayMetrics in RecordDirectRelayEnd,
  eliminating a duplicate of the same fields (#15)

Documentation:
- Document the request-group counting invariants in SetRelayMetrics (#13)
- Add comment explaining why UpdateHealthcheckStatusBreakdown is a no-op
  in SmartRouterMetricsManager (#16)
- Fix struct comment to list all four labels including apiInterface (#17)

Tests:
- Scope gomock.Controller to each subtest in TestIsArchiveRequest,
  TestIsDebugOrTraceRequest, and TestIsBatchRequest (#19)
- Add TestConsumerSetRelayMetrics_PartitionInvariant asserting
  batch+read+write==total and success+failed==total (#13)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant