Processing Pipeline
Introduction
Pipeline Overview
┌─────────────────────────────────────────────────────────────────────┐
│ TRANSACTION ARRIVES │
└─────────────────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ PHASE 1: PREFLIGHT │
│ ───────────────── │
│ • Stateless validation (no ledger access) │
│ • Format and field validation │
│ • Signature structure check (not verification) │
│ • Returns: NotTEC (cannot return tec codes) │
└─────────────────────────────────┬───────────────────────────────────┘
│
┌────────┴────────┐
│ │
▼ ▼
✓ Pass ✗ Fail
│ │
│ └──→ Reject (tem*, tef*, ter*)
▼
┌─────────────────────────────────────────────────────────────────────┐
│ PHASE 2: PRECLAIM │
│ ──────────────── │
│ • Read-only ledger access │
│ • Account existence, balance, sequence checks │
│ • Fee validation │
│ • Signature verification │
│ • Transaction-specific state checks │
│ • Returns: TER (can return tec codes) │
└─────────────────────────────────┬───────────────────────────────────┘
│
┌────────┴────────┐
│ │
▼ ▼
✓ Pass ✗ Fail
│ │
│ └──→ Reject or Queue
▼
┌─────────────────────────────────────────────────────────────────────┐
│ PHASE 3: DOAPPLY │
│ ─────────────── │
│ • Full read/write ledger access │
│ • Actual state modifications │
│ • Creates, updates, or deletes ledger entries │
│ • Returns: TER │
└─────────────────────────────────┬───────────────────────────────────┘
│
┌────────┴────────┐
│ │
▼ ▼
tesSUCCESS tec* Fail
│ │
│ └──→ Fee charged, changes reverted
▼
┌─────────────────────────────────────────────────────────────────────┐
│ PHASE 4: FINALIZATION │
│ ─────────────────── │
│ • Commit changes to ledger │
│ • Record transaction metadata │
│ • Consume sequence number │
└─────────────────────────────────────────────────────────────────────┘Phase 1: Preflight
Characteristics
What Preflight Checks
Implementation Pattern
Why Preflight Matters
Phase 2: Preclaim
Characteristics
What Preclaim Checks
Implementation Pattern
Key Utility Functions for Preclaim
Function
Purpose
Phase 3: doApply
Characteristics
Implementation Pattern
Key Operations in doApply
Operation
Method
Description
Phase 4: Finalization
Error Propagation
Phase
Can Return
Fee Charged?
Notes
Practical Example: Tracing a CheckCreate
Best Practices for Implementing Transactors
Codebase References
File
Description
Last updated

