Skip to content

[Utility][Persistence][Savepoints/Rollbacks] Refactor UtilityContext into UtilityUnitOfWork #563

@deblasis

Description

@deblasis

Objective

Create the logical abstraction that would represent the "Unit Of Work" (inspired by Martin Fowler's work in his "Patterns of Enterprise Application Architecture")

These abstraction should have specific implementations for Leader and for Replica nodes in order to allow a clean separation of concerns while keeping a degree of composability/reusability of the code. (Lower level requirement discovered while working on #508)

Origin Document

This is part of a rescoping of the tickets related to SavePoints, Rollbacks and it originates essentially from the following tickets:

Goals

  • Refactor UtilityContext to be a polymorphic UtilityOfWork
  • Introduce LeaderUtilityUnitOfWork and ReplicaUtilityUnitOfWork that expose the methods that are going be to used depending on the "role" of the node in the consensus process applying the SOLID principles.

Deliverable

  • Refactored UtilityOfWork
  • LeaderUtilityUnitOfWork and ReplicaUtilityUnitOfWork implementations
  • Logical switch/factory method to use the correct UOW (Unit Of Work) depending on the node's role

Non-goals / Non-deliverables

  • Changes in logic (at this point, the code should be functionally equivalent to the previous implementation)

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: @deblasis
Co-Owners: @Olshansk

Metadata

Metadata

Assignees

Labels

persistencePersistence specific changesutilityUtility specific changes

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions