Skip to content

Implement Eventual Consistency for Synthetic EVM Transaction Recording #173

@dhyaniarun1993

Description

@dhyaniarun1993

Problem

Currently, the SendRawTransaction flow in the EthRPC service performs two critical operations in sequence:

  • Executes a token transfer on the Canton ledger via erc20.TransferFrom.
  • Records the corresponding synthetic EVM transaction and log in the database via recordSyntheticTransfer.

These operations are not atomic. If the ledger transfer succeeds but the synthetic transaction recording fails (e.g., due to a database or network error), the system becomes inconsistent: the ledger reflects the transfer, but the EVM transaction/log is missing. This can lead to data loss, user confusion, and reconciliation issues.

Proposed Solution:

Implement an eventual consistency mechanism to ensure that all successful ledger transfers are eventually reflected in the synthetic EVM transaction log, even if the initial recording fails. Possible approaches include:

  • Recording a durable “intent” or “pending synthetic transfer” before or after the ledger operation.
  • Implementing a background worker or reconciliation process that scans for uncommitted synthetic transfers and retries recording them until successful.
  • Marking synthetic transfers as “committed” once the DB write succeeds, to avoid duplicate processing.

Acceptance Criteria:

  • No successful ledger transfer should be lost from the synthetic EVM transaction log, even in the event of transient failures.
  • The system should be able to recover and reconcile any missed synthetic transactions automatically.
  • Failures in synthetic transaction recording should be logged.

Metadata

Metadata

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