Implement Gas Relay endpoint#129
Merged
PeterOche merged 3 commits intodegenspot:mainfrom Mar 25, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have implemented the Gas Relay endpoint as requested. The implementation ensures that the backend co-signs and sponsors transactions (covering gas fees) only for the specific CallRegistry contract.
Key Changes:
Refined
RelayService
:
Robust Validation: Added a strict check in
validateTransaction
to ensure that all operations in the transaction are invokeHostFunction calls specifically targeting the CallRegistry contract (retrieved via
ConfigService
).
Fee-Bump Implementation: Correctly implements Stellar Fee-Bump transactions. It wraps the user's transaction in a fee-bump envelope where the relayer's hot wallet is the fee source.
Security Checks:
Ensures the inner transaction has at least one signature (user's signature).
Verifies transaction expiration (timeBounds) to prevent the relayer from paying for stale transactions.
Added a small fee margin (500 stroops) to Ensure the fee-bump is accepted by the network even during slight fee fluctuations.
Proper Submission: Uses SorobanRpc.Server.sendTransaction and handles the response correctly, including logging the errorResultXdr if submission fails.
Controller Verification:
Confirmed the POST /relay/tx endpoint in
RelayController
correctly handles the XDR input and communicates with the
RelayService
.
Environment Integration:
The relayer uses RELAY_HOT_WALLET_SECRET for signing, which follows the project's established structure.
closes #118