Skip to content

Comments

fix: Improve Evm and Solana transaction request flow#655

Open
zeljkoX wants to merge 1 commit intomainfrom
improve-evm-solana-tx-req-flow
Open

fix: Improve Evm and Solana transaction request flow#655
zeljkoX wants to merge 1 commit intomainfrom
improve-evm-solana-tx-req-flow

Conversation

@zeljkoX
Copy link
Collaborator

@zeljkoX zeljkoX commented Feb 13, 2026

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

  • Add a reference to related issues in the PR description.
  • Add unit tests if applicable.

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

    • Enhanced transaction status management: transactions are now properly marked as failed with descriptive reasons when status-check operations fail in relayers, ensuring no unmonitored transactions remain.
  • Tests

    • Added comprehensive test coverage for transaction queue failure scenarios.

@zeljkoX zeljkoX requested a review from a team as a code owner February 13, 2026 08:36
@zeljkoX zeljkoX requested a review from Copilot February 13, 2026 08:36
@zeljkoX zeljkoX self-assigned this Feb 13, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Walkthrough

Both 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

Cohort / File(s) Summary
EVM & Solana Relayer Refactoring
src/domain/relayer/evm/evm_relayer.rs, src/domain/relayer/solana/solana_relayer.rs
Reordered transaction enqueue flow to prioritize status-check job queuing. On status-check queue failure, transaction is marked Failed and error is returned before transaction request queuing. Added error handling via partial_update with fallback warning logging. Introduced TransactionUpdateRequest usage and new test cases validating failure scenarios.

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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

cla: allowlist

Suggested reviewers

  • tirumerla
  • dylankilkenny
  • LuisUrrutia

Poem

🐰 The queues now bow to status first,
Before the txns burst,
If checks should fail with grace, we mark—
No orphans in the dark! ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: improving the transaction request flow for EVM and Solana relayers to handle queue service degradation.
Description check ✅ Passed The description includes a summary explaining the change and its rationale, acknowledges unit tests were added, but the Testing Process section is empty and the issue reference checkbox remains unchecked.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch improve-evm-solana-tx-req-flow

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

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m

src/domain/relayer/solana/solana_relayer.rs

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TransactionStatusCheck before TransactionRequest for EVM and Solana.
  • If status-check enqueue fails, immediately mark the newly-created transaction as Failed with reason "Queue unavailable" and abort.
  • Add unit tests covering the failure path and verifying the Failed update.

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
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.74%. Comparing base (9a23b17) to head (276ebee).

Additional details and impacted files
Flag Coverage Δ
ai 0.27% <0.00%> (-0.01%) ⬇️
dev 91.73% <100.00%> (-0.01%) ⬇️
properties 0.02% <ø> (ø)

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     
Files with missing lines Coverage Δ
src/domain/relayer/evm/evm_relayer.rs 99.27% <100.00%> (+0.04%) ⬆️
src/domain/relayer/solana/solana_relayer.rs 94.89% <100.00%> (+0.33%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant