Skip to content

[Consensus] Re-evaluate utility context management #283

@Olshansk

Description

@Olshansk

Objective

Figure out how the utility context within consensus should be managed, refreshed and updated to avoid panics and race conditions.

Origin Document

This thread In #250:

Screen Shot 2022-10-04 at 4 46 43 PM

Goals

  • Avoid panics that can be a result of access to a nil utilityContext
  • Avoid race conditions in the consensus lifecycle that can lead to issues in the use of utilityContext
  • Update diagrams/documentation so it is abundantly clear how the consensus module should manage its instance of the utilityContext

Deliverable

  • A PR updating how the utilityContext in the consensus module is managed
  • Updated unit tests validating these changes
  • Add/update the relevant sequence diagram if necessary mermaid
  • Update documentation in the relevant READMes so this is clear
  • Consider adding the following function per Gohkan's comment here: func (u *UtilityContext) GetPersistanceReadContext() { return u.Context.PersistenceRWContext.PersistanceReadContext }

Non-goals / Non-deliverables

  • Change any interfaces in the ConsensusModule or UtilityModule

General issue deliverables

  • Update the appropriate CHANGELOG
  • Update any relevant READMEs (local and/or global)
  • Update any relevant global documentation & references

Testing Methodology

  • All tests: make develop_test
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md

Creator: @Olshansk
Co-Owners: @andrewnguyen22

Metadata

Metadata

Labels

code healthNice to have code improvementconsensusConsensus specific changesutilityUtility specific changes

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions