Skip to content

Create FailedPayables Table #631

Closed
Closed

Description

@utkarshg6

We need to store all transactions generated by us that failed for various reasons, so we can track them for future use.

Keeping these transactions in the SentPayables table is not ideal. Instead, we should create a separate table for them.

We also need to update the SentPayables table to ensure there is no state called Failed; it should be renamed to Retry.

For the FailedPayables table, we will use the following structure:

create table if not exists failed_payable (
                rowid integer primary key,
                tx_hash text not null,
                receiver_address text not null,
                amount_high_b integer not null,
                amount_low_b integer not null,
                timestamp integer not null,
                gas_price_wei integer not null,
                nonce integer not null,
                failure_code text not null
            )

This table should support all CRUD operations.

Please include this in the same migration as the SentPayables table (at the time of writing this card, the migration was from version 10 to version 11).

Before starting on this card, be sure to read the comments.

Activity

  1. moved this to 🆕 New in MASQ Node v2on May 9, 2025
  2. self-assigned this
    on May 9, 2025
  3. dnwiebe commented on May 11, 2025

    @dnwiebe
    Collaborator

    From what I hear, a gas price lower than one gwei is conceivable, as is a gas price high enough that it can't be expressed as wei in 64 bits. Therefore, we probably need a two-column 127-bit value for gas_price_wei.

    Unless! If we're never going to have to use thegas_price_wei (or, for that matter, the amount_xxx columns) in a WHERE clause, then they don't have to be represented as numeric data types at all. We can represent them somehow as strings (perhaps a string representation of a long decimal number, perhaps a sixteen-byte (128-bit) value encoded as a Base64 string, maybe in some other way) and store them as TEXT columns to avoid bringing the complicated two-column logic to bear.

  4. dnwiebe commented on May 11, 2025

    @dnwiebe
    Collaborator

    Should there be some kind of status information in the row as well? For example, whether the failure is in the process of being addressed, or perhaps a retries-remaining count, or an enum with Unaddressed/InProcess/Fixed/Unfixed/Unfixable values, or whatever.

  5. dnwiebe commented on May 11, 2025

    @dnwiebe
    Collaborator

    Think about what happens at end-of-life for a record here. Transaction information in the database is a security risk. At the very least, failures that have been resolved must be removed from this table. For more security, the sensitive parts of a transaction could be encrypted with the same logic used to encrypt some CONFIG-table entries.

    If it's decided that some of the columns should be encrypted, anything encrypted will need to be of TEXT type; the encryption logic doesn't produce integers, even from integers.

  6. moved this from 🆕 New to 🔖 Ready in MASQ Node v2on May 11, 2025
  7. utkarshg6 commented on May 15, 2025

    @utkarshg6
    CollaboratorAuthor

    Solutions for the above comments respectively:

    1. gas_price_wei should be stored into two columns by dividing the integer, similar to amount, and this change should also be made in SentPayables.
    2. Introduce a retried column in the FailedPayables table.
    3. Create a new card that encrypts the entire database.
  8. added 6 commits that reference this issue on May 20, 2025
  9. 26 remaining items

  10. added 12 commits that reference this issue on Jun 6, 2025
  11. moved this from 👀 Review + QA in Progress to ✅ Done in MASQ Node v2on Jun 24, 2025
  12. added a commit that references this issue on Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions