Skip to content

Audit: Verify assignedTxs is populated for all transaction types #643

@tcsenpai

Description

@tcsenpai

Context

The assignedTxs field on GCRMain accounts was defined but never populated. A fix was added to HandleGCR.apply() to track transactions for the sender account.

What was done

  • Modified HandleGCR.apply() to add tx.hash to sender.assignedTxs after successful GCR edit operations
  • Added addAssignedTx() helper method to handle the update with duplicate prevention

What needs to be audited

  1. Verify all transaction types populate assignedTxs:
    • balance ✓ (goes through HandleGCR.apply)
    • nonce ✓ (goes through HandleGCR.apply)
    • identity ✓ (goes through HandleGCR.apply)
    • storageProgram ✓ (goes through HandleGCR.apply)
    • tlsnotary ✓ (goes through HandleGCR.apply)
    • assign - TODO implementation
    • subnetsTx - TODO implementation
    • smartContract - TODO implementation
    • escrow - TODO implementation
  2. Check if recipients should also have assignedTxs updated:
    • For transfers, should the receiver also have the tx in their assignedTxs?
    • For storage programs, should the storage address have a reference?
  3. Verify historical transactions:
    • Existing accounts may have empty assignedTxs
    • Consider migration script to backfill from chain data

Technical Details

  • File: src/libs/blockchain/gcr/handleGCR.ts
  • Method: HandleGCR.apply() and HandleGCR.addAssignedTx()
  • Entity: GCRMain.assignedTxs: string[]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions