Skip to content

[Utility] Foundational bugs, tests, code cleanup and improvements (2/3) #504

@jessicadaugherty

Description

@jessicadaugherty

Objective

Partial refactor, cleanup, and code improvement of the utility module to set a foundation for M3.

Origin Document

Follow-up work to #475. Address the items not refactored in #475 as noted on PR #503.

When work on #443 started, while also looking at #325, it became evident that the logic in the utility module is hard to follow and understand while also being filled with minor hard-to-find bugs.

Goals

  • Unblock development: Create a foundation on which we design utility protocols and implement new features
  • Reduce cognitive overhead: Improve code readability and navigation for both internal and external contributors
  • Enable onboarding other engineers: Clarify both source code and tests through comment and source code improvements

Deliverable

  • A PR that updates the portions of the utility module noted above
  • Documentation & explanation of the changes that were made and next steps
  • Reviewing and updating the following files where appropriate:
    • ├── application.go
    • ├── application_test.go
    • ├── block.go
    • ├── block_test.go
    • ├── context.go
    • ├── doc
    • │   ├── CHANGELOG.md
    • │   ├── PROTOCOL_RELAY.md
    • │   ├── PROTOCOL_SESSION.md
    • │   └── README.md
    • ├── gov.go
    • ├── gov_test.go
    • ├── message_handler.go
    • ├── message_test.go
    • ├── module.go
    • ├── module_test.go
    • ├── service
    • │   └── service.go
    • ├── session.go
    • ├── transaction.go
    • ├── transaction_test.go
    • ├── types
    • │   ├── proto
    • │   │   ├── message.proto
    • │   │   ├── stake_status.proto
    • │   │   ├── transaction.proto
    • │   │   ├── tx_result.proto
    • │   │   └── utility_messages.proto
    • │   ├── transaction.go
    • │   ├── transaction_test.go
    • │   ├── tx_result.go
    • └── validator.go

Non-goals / Non-deliverables

  • Updating the entire module in a single PR (PR would be too large)
  • Adding new features to the utility module
  • Increasing/improving the test coverage to the po

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

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

Creator: @jessicadaugherty
Co-owner: @Olshansk

Metadata

Metadata

Assignees

Labels

bugSomething isn't working - expected behaviour is incorrectcode healthNice to have code improvementdocumentationImprovements or additions to documentation

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions