graph TD
X[Accepted TX1] --> A
T[Accepted TX2] --> A
Z[Accepted TX3] --> A
B --> C{Contract State Manager}
A[Contract Address] -->|Unordered Transactions Set TX1, TX2, TX3| B(Accepted State Buffer)
C -->|State Selector Key 1 Ordering| D[Ordered TX1]
D --> M[Ordered TX2]
C -->|Key 2| E[Ordered TX3]
C -->|Key 3| J[Empty]
C -->|Key 4| F[Empty]
graph TD
A[Rust Warp API Endpoint] --> B
B[Transaction Received] --> C
C --> |Mempool backpressure overload| H
C[Channel for Mempool] --> D
D[Mempool]
D -->|Pull & Prioritize| E[Binary Heap]
E --> F[Channel w/ Backpressure]
D -->|Prevalidation| G[Check Accepted/Valid]
G -->|Error| H[Reject Transaction]
G -->|Success| E
F -->|Concurrent Processing| I[Async Task per Transaction]
I --> J[Validate Transaction]
J -->|Invalid| H
J -->|Valid but missing ancestors| K[Resolve Ancestors via Peer Queries]
J -->|Valid but needs output resolution| L[Resolve Transformer Contract Outputs]
K -->|Cannot Find Valid Parent References| H
L --> J
K --> J
J --> M[Register with Contention Key Conflict Manager]
M -->|Detect Conflicts| N[N Bucketed Threads]
N -->|Resolved Conflicts| O[Transaction Accepted]
O --> P[Update Data Store]
P --> Q[Contract State Update if Request/Deploy Type Outputs]
O --> R[Poll Peers for Observations]
R --> S[Submission Response to API]
H --> |Format ErrorInfo Response with task local info| S
Q --> S