Skip to content

[Bug]: Ensure stacks principals are always correctly stored in the database #1231

@djordon

Description

@djordon

Bug - Ensure stacks principals are always correctly stored in the database

1. Description

When we write the Stacks recipient of a deposit request the database, we should make sure that we write it correctly.

1.1 Context & Purpose

Writing it as a string, while valid under normal circumstances, has a drawback where it can "silently" fail under some circumstances. Writing it as a bytea via the consensus encode function will always work as expected.

The issue is that the code that transforms the PrincipalData into a string can essential error and return a string that is not the stacks principal. Instead it returns something like

2. Technical Details:

There are two solutions, one is to change the column type, while another is to ensure that these "invalid" principals are treated as invalid and rejected. It's just not clear that they are indeed invalid.

2.1 Acceptance Criteria:

  • We either do not write "incorrect" principals to the database or always write them successfully

3. Related Issues and Pull Requests (optional):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Needs Triage

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions