fix: Improve Evm and Solana transaction request flow#655
fix: Improve Evm and Solana transaction request flow#655
Conversation
WalkthroughBoth EVM and Solana relayers now prioritize status-check queuing before transaction request queuing. If status-check queuing fails, transactions are marked Failed with "Queue unavailable" reason and an error is returned, preventing orphaned transactions from entering the system. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Relayer
participant StatusQueue
participant TransactionQueue
participant Database as State/Database
Client->>Relayer: process_transaction_request()
Relayer->>StatusQueue: enqueue_status_check()
alt Status Check Queue Success
StatusQueue-->>Relayer: Ok()
Relayer->>TransactionQueue: enqueue_transaction_request()
TransactionQueue-->>Relayer: Ok()
Relayer-->>Client: Ok()
else Status Check Queue Failure
StatusQueue-->>Relayer: Err()
Relayer->>Database: partial_update(Failed, "Queue unavailable")
alt Partial Update Success
Database-->>Relayer: Ok()
Relayer-->>Client: Err()
else Partial Update Failure
Database-->>Relayer: Err()
Note over Relayer: Log warning
Relayer-->>Client: Err()
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.16.0)src/domain/relayer/evm/evm_relayer.rs┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m src/domain/relayer/solana/solana_relayer.rs┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m Comment |
There was a problem hiding this comment.
Pull request overview
Propagates the Stellar “status-check-first” queuing safety pattern to Solana and EVM relayers to avoid leaving unmonitored/orphaned pending transactions when the queue is degraded.
Changes:
- Enqueue
TransactionStatusCheckbeforeTransactionRequestfor EVM and Solana. - If status-check enqueue fails, immediately mark the newly-created transaction as
Failedwith reason"Queue unavailable"and abort. - Add unit tests covering the failure path and verifying the
Failedupdate.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/domain/relayer/solana/solana_relayer.rs | Reorders job enqueueing (status-check first), marks tx failed on queue failure, adds unit tests. |
| src/domain/relayer/evm/evm_relayer.rs | Reorders job enqueueing (status-check first), marks tx failed on queue failure, adds unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## main #655 +/- ##
==========================================
+ Coverage 91.71% 91.74% +0.03%
==========================================
Files 278 278
Lines 114344 114583 +239
==========================================
+ Hits 104866 105129 +263
+ Misses 9478 9454 -24
🚀 New features to boost your workflow:
|
Summary
This PR propagates a recent change made to Stellar to Solana and EVM.
It ensures that when the Queue service is degraded, we do not create orphaned pending transactions in the DB, but instead mark them as Failed..
Testing Process
Checklist
Note
If you are using Relayer in your stack, consider adding your team or organization to our list of Relayer Users in the Wild!
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests