-
-
Notifications
You must be signed in to change notification settings - Fork 260
Fix/restart race condition #567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fengtality
wants to merge
25
commits into
development
Choose a base branch
from
fix/restart-race-condition
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
Remove detached process spawning from /restart endpoint. Instead: - Add PID file tracking (gateway.pid) for process management - Kill any existing gateway process on startup using PID file - On restart, simply exit - let process managers handle restart - Clean up PID file on graceful shutdown This matches the simpler approach used in gateway v2.2.0 and prevents orphan processes that were being created by the old spawn mechanism. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add a shell script wrapper that manages the Gateway server lifecycle: - `./gateway.sh start [--dev]` - Start Gateway with auto-restart on config changes - `./gateway.sh stop` - Stop Gateway and wrapper - `./gateway.sh restart` - Request restart via API - `./gateway.sh status` - Show running status The wrapper process monitors exit codes: - Exit code 0: Restart requested (wrapper restarts Gateway) - Exit code 1: Shutdown requested (wrapper stops) This enables seamless restarts when clients update config values, as the wrapper automatically restarts Gateway after it exits. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Change start script from direct node invocation to gateway.sh - Add --passphrase argument support to gateway.sh - Users can now use: pnpm start --passphrase=<pass> [--dev] - Wrapper provides auto-restart on config changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add /status endpoint with version, uptime, mode, pid - Add /stop endpoint to shut down without restart - Move server routes to src/server/server.routes.ts for Swagger visibility - Update gateway.sh to run in foreground (logs visible in terminal) - Add pnpm stop and pnpm status commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…into fix/restart-race-condition
…teway into fix/restart-race-condition
Remove helius and infura namespace references from root.yml since the rpc-provider-schema.json and rpc/ directory were previously removed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add AlphaRouterService for smart order routing across V2/V3 pools - Update quoteSwap to use AlphaRouter instead of UniversalRouterQuote - Pass slippagePct parameter through to AlphaRouter - Upgrade @uniswap/smart-order-router to v4.22.38 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add maximumSplits config option to pancakeswap.yml - Pass maxHops and maxSplits from config to SmartRouter.getBestTrade() - Update Uniswap quoteSwap test to use AlphaRouterQuoteResult mock format 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…Router For EXACT_OUTPUT trades, the AlphaRouter's route() method expects the quoteCurrency to be the input token (what we pay), not the output token. The previous code always passed tokenOut, which caused "Invariant failed: ADDRESSES" errors when getting BUY quotes because the V4 pool provider tried to compare a token with itself. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…tions - handleTransactionExecution now returns null for pending transactions instead of a fake receipt with status:0 (which means reverted in ethers) - handleExecuteQuoteTransactionConfirmation now accepts txHash parameter to return the transaction hash for pending transactions - Fixed status code mapping to match Hummingbot's TransactionStatus: - CONFIRMED = 1 - PENDING = 0 - FAILED = -1 - Track txHash immediately after sending transaction in executeQuote Previously, pending transactions were incorrectly marked as failed because the fake receipt had status:0, which in Ethereum means the transaction reverted on-chain. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Move detailed AlphaRouter and quoteSwap logs from info to debug level, keeping only essential messages at info for cleaner production logs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Commit 8b8b3e9
Start with ./gateway.sh start
Run ./gateway.sh stop
Verify /restart endpoint works
Run ./gateway.sh status
Pending tests:
|
rapcmia
previously approved these changes
Dec 17, 2025
Dev team will need time to review and redesign the fix
- Add intermediate token lists for each network (BSC, mainnet, arbitrum, base) - Refactor pool discovery to search for pools through intermediate tokens - Enable multi-hop routes like LINK -> WBNB -> DAI - maximumHops and maximumSplits config options now work correctly - Fixes "No routes found" error for token pairs without direct pools 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix extractRoutePath to use route.path array which contains all tokens including intermediates (e.g., LINK -> WBNB -> DAI) - Add percentage display for split routes (e.g., "50% via LINK -> WBNB -> DAI") - Change route join separator from ' -> ' to ', ' for multiple split routes - Add tests to verify routePath format includes percentage and token path Before: "LINK -> DAI -> LINK -> DAI -> LINK -> DAI" (wrong) After: "100% via LINK -> WBNB -> DAI" (correct) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat: add split routing in Uniswap and Pancakeswap quote-swap
…split-routing fix / revert commit 751cfcb
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.










Summary
/restartendpointgateway.shwrapper script for managing Gateway lifecyclegateway.pid) to prevent duplicate instances/statusand/stopendpoints for server lifecycle managementChanges
/statusand/stopendpointsstart,stop,restart,statuscommandsgateway.pidto ignored filesTest plan
./gateway.sh start/restartendpoint works without race condition/statusreturns server info./gateway.sh stopgracefully stops serverFixes #414