Skip to content

[P2P] Add contexts to method signatures #595

@bryanchriswhite

Description

@bryanchriswhite

Objective

Add context.Context arguments to all method signatures requiring downstream context and push context creation up the call stack as high as possible to align with Go conventions and best practices, and support future distributed tracing efforts.

Origin Document

... (lost)

Goals

  • Align context.Context usage with go conventions / best practices
  • Support future distributed tracing efforts ([Telemetry] Distributed Tracing in a V1 Node #143)
    • We will likely need fairly ubiquitous access to context objects everywhere we want to measure

Deliverable

  • Add context.Context arguments to all method signatures which require a context downstream (at least).
  • Push context creation up the call stack as high as possible / reasonable (i.e. context.Background()).

Non-goals / Non-deliverables

  • Refactoring, simplifying or otherwise changing method signatures outside the scope of passing context.Contexts.

General issue deliverables

  • Update the appropriate CHANGELOG(s)
  • Update any relevant local/global README(s)
  • Update relevant source code tree explanations
  • Add or update any relevant or supporting mermaid diagrams

Testing Methodology

  • Task specific tests or benchmarks: make ...
  • New tests or benchmarks: make ...
  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md

Creator: @bryanchriswhite

Metadata

Metadata

Labels

code healthNice to have code improvementp2pP2P specific changes

Type

No type

Projects

Status

Rescope

Relationships

None yet

Development

No branches or pull requests

Issue actions