Skip to content

[Persistence] avoid downcasting to int64 from uint64 in Persistence package  #813

@dylanlott

Description

@dylanlott

Objective

image

There are several comments like the above in the Persistence package that deal with how external components use int64 but Persistence package tends to use uint64 which has a higher limit but will eventually result in downcasting. We should address these issues throughout the code base to avoid any downcasting and thus undefined behavior or loss of resolution.

Origin Document

#756 added comments for several of these, but others exist throughout the Persistence package.

Goals

  • Avoid unnecessary and inconsistent uint64/int64 type casting in the Persistence pacakge

Deliverable

  • Align on which variable should and shouldn't use untyped integers
  • Modify all the interfaces in the persistence package to use the same types

Non-goals / Non-deliverables

  • Changes of any existing business logic

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
  • k8s LocalNet: verify a k8s LocalNet is still functioning correctly by following the instructions here

Creator: @dylanlott

Metadata

Metadata

Assignees

Labels

code healthNice to have code improvementcoreCore infrastructure - protocol relatedpersistencePersistence specific changes

Type

No type

Projects

Status

Up Next

Relationships

None yet

Development

No branches or pull requests

Issue actions