diff --git a/apollo/.env.test b/apollo/.env.test index d46129f2..5ba538cc 100644 --- a/apollo/.env.test +++ b/apollo/.env.test @@ -15,7 +15,9 @@ GOERLI_A2E_LN_ENDPOINT=http://localhost:8000/subgraphs/name/arbi2ethln/ethereum ARBITRUM_A2E_LN_ENDPOINT=http://localhost:8000/subgraphs/name/arbi2ethln/arbitrum LN_ETHEREUM_DEFAULT_ENDPOINT = https://api.studio.thegraph.com/query/61328/ln-default-sepolia/version/latest +LN_ETHEREUM_OPPOSITE_ENDPOINT = https://api.studio.thegraph.com/query/61328/ln-opposite-sepolia/version/latest LN_ARBITRUM_DEFAULT_ENDPOINT = https://api.studio.thegraph.com/query/61328/ln-default-arbisepolia/version/latest +LN_ARBITRUM_OPPOSITE_ENDPOINT = https://api.studio.thegraph.com/query/61328/ln-opposite-arbisepolia/version/latest LN_ZKSYNC_DEFAULT_ENDPOINT = https://api.studio.thegraph.com/query/61328/ln-default-zksepolia/version/latest ETHEREUM_LNV3_ENDPOINT=https://api.studio.thegraph.com/query/61328/lnv3-sepolia/version/latest diff --git a/apollo/src/aggregation/aggregation.history.graphql b/apollo/src/aggregation/aggregation.history.graphql index d4c353e9..c6201bc3 100644 --- a/apollo/src/aggregation/aggregation.history.graphql +++ b/apollo/src/aggregation/aggregation.history.graphql @@ -91,8 +91,8 @@ type Query { checkLnBridgeExist(fromChainId: Int, toChainId: Int, fromToken: String, toToken: String): Boolean queryGuardNeedSignature(fromChain: String, toChain: String, bridge: String, guardAddress: String, row: Int): HistoryRecords queryRelayRecords(fromChain: String, toChain: String, bridge: String, relayer: String, row: Int): HistoryRecords - queryLnBridgeRelayInfos(fromChain: String, toChain: String, bridge: String, relayer: String, row: Int, page: Int): LnBridgeRelayInfos - sortedLnBridgeRelayInfos(fromChain: String, toChain: String, bridge: String, token: String, row: Int, amount: String, decimals: Int): SortedLnBridgeRelayInfos + queryLnBridgeRelayInfos(fromChain: String, toChain: String, version: String, bridge: String, relayer: String, row: Int, page: Int): LnBridgeRelayInfos + sortedLnBridgeRelayInfos(fromChain: String, toChain: String, version: String, bridge: String, token: String, row: Int, amount: String, decimals: Int): SortedLnBridgeRelayInfos } type Mutation { diff --git a/apollo/src/aggregation/aggregation.resolver.ts b/apollo/src/aggregation/aggregation.resolver.ts index 5ebaf73d..10b65631 100644 --- a/apollo/src/aggregation/aggregation.resolver.ts +++ b/apollo/src/aggregation/aggregation.resolver.ts @@ -251,6 +251,7 @@ export class AggregationResolver { async queryLnBridgeRelayInfos( @Args('fromChain') fromChain: string, @Args('toChain') toChain: string, + @Args('version') version: string, @Args('bridge') bridge: string, @Args('relayer') relayer: string, @Args('row') row: number, @@ -258,7 +259,7 @@ export class AggregationResolver { ) { const skip = row * page || 0; const take = row || 10; - const baseFilters = { fromChain, toChain, bridge, relayer }; + const baseFilters = { fromChain, toChain, bridge, relayer, version }; const where = { ...baseFilters, @@ -276,6 +277,7 @@ export class AggregationResolver { async sortedLnBridgeRelayInfos( @Args('fromChain') fromChain: string, @Args('toChain') toChain: string, + @Args('version') version: string, @Args('bridge') bridge: string, @Args('token') token: string, @Args('row') row: number, @@ -284,7 +286,7 @@ export class AggregationResolver { ) { const take = row || 128; const sendToken = token?.toLowerCase(); - const baseFilters = { fromChain, toChain, sendToken, bridge }; + const baseFilters = { fromChain, toChain, sendToken, bridge, version }; const where = { ...baseFilters, diff --git a/apollo/src/graphql.ts b/apollo/src/graphql.ts index c520b158..07d496c2 100644 --- a/apollo/src/graphql.ts +++ b/apollo/src/graphql.ts @@ -31,9 +31,9 @@ export abstract class IQuery { abstract queryRelayRecords(fromChain?: Nullable, toChain?: Nullable, bridge?: Nullable, relayer?: Nullable, row?: Nullable): Nullable | Promise>; - abstract queryLnBridgeRelayInfos(fromChain?: Nullable, toChain?: Nullable, bridge?: Nullable, relayer?: Nullable, row?: Nullable, page?: Nullable): Nullable | Promise>; + abstract queryLnBridgeRelayInfos(fromChain?: Nullable, toChain?: Nullable, version?: Nullable, bridge?: Nullable, relayer?: Nullable, row?: Nullable, page?: Nullable): Nullable | Promise>; - abstract sortedLnBridgeRelayInfos(fromChain?: Nullable, toChain?: Nullable, bridge?: Nullable, token?: Nullable, row?: Nullable, amount?: Nullable, decimals?: Nullable): Nullable | Promise>; + abstract sortedLnBridgeRelayInfos(fromChain?: Nullable, toChain?: Nullable, version?: Nullable, bridge?: Nullable, token?: Nullable, row?: Nullable, amount?: Nullable, decimals?: Nullable): Nullable | Promise>; } export class HistoryRecord { diff --git a/apollo/src/lnbridgev20/lnbridgev20.service.ts b/apollo/src/lnbridgev20/lnbridgev20.service.ts index f2495f1e..bd88f097 100644 --- a/apollo/src/lnbridgev20/lnbridgev20.service.ts +++ b/apollo/src/lnbridgev20/lnbridgev20.service.ts @@ -539,7 +539,7 @@ export class Lnbridgev20Service implements OnModuleInit { ); const sourcePartner = this.findPartnerByChainId(record.remoteChainId); if (sourcePartner === null) { - this.logger.warn(`can't find partner chain id ${record.remoteChainId}`); + this.logger.warn(`can't find partner chain source:${transfer.chainId} remote:${record.remoteChainId}`); latestNonce += 1; this.fetchCache[index].latestRelayerInfoTargetNonce = latestNonce; return; diff --git a/apollo/src/lnbridgev20/transfer.service.ts b/apollo/src/lnbridgev20/transfer.service.ts index b678a9b6..67bf565f 100644 --- a/apollo/src/lnbridgev20/transfer.service.ts +++ b/apollo/src/lnbridgev20/transfer.service.ts @@ -610,7 +610,7 @@ export class TransferService extends BaseTransferServiceT3 { chainId: 11155111, chainName: 'sepolia', defaultEndpoint: this.lnEthereumDefaultEndpoint, - oppositeEndpoint: null, + oppositeEndpoint: this.lnEthereumOppositeEndpoint, tokens: [ { fromSymbol: 'USDC', @@ -623,7 +623,7 @@ export class TransferService extends BaseTransferServiceT3 { toAddress: '0x8A87497488073307E1a17e8A12475a94Afcb413f', protocolFee: 100000000, decimals: 18, - bridgeType: 'default', + bridgeType: 'opposite', channel: 'layerzero', }, { @@ -648,7 +648,7 @@ export class TransferService extends BaseTransferServiceT3 { toAddress: '0x3b8Bb7348D4F581e67E2498574F73e4B9Fc51855', protocolFee: 100000000, decimals: 18, - bridgeType: 'default', + bridgeType: 'opposite', channel: 'layerzero', }, { @@ -673,7 +673,7 @@ export class TransferService extends BaseTransferServiceT3 { toAddress: '0x0000000000000000000000000000000000000000', protocolFee: 1000000000000000, decimals: 18, - bridgeType: 'default', + bridgeType: 'opposite', channel: 'layerzero', }, { @@ -693,7 +693,7 @@ export class TransferService extends BaseTransferServiceT3 { chainId: 421614, chainName: 'arbitrum-sepolia', defaultEndpoint: this.lnArbitrumDefaultEndpoint, - oppositeEndpoint: null, + oppositeEndpoint: this.lnArbitrumOppositeEndpoint, tokens: [ { fromSymbol: 'USDC', @@ -706,7 +706,7 @@ export class TransferService extends BaseTransferServiceT3 { toAddress: '0x0ac58Df0cc3542beC4cDa71B16D06C3cCc39f405', protocolFee: 100000000000000000000, decimals: 18, - bridgeType: 'default', + bridgeType: 'opposite', channel: 'layerzero', }, { @@ -717,7 +717,7 @@ export class TransferService extends BaseTransferServiceT3 { decimals: 6, bridgeType: 'default', channel: 'layerzero', - }, + } ], }, { @@ -731,7 +731,7 @@ export class TransferService extends BaseTransferServiceT3 { toAddress: '0x876A4f6eCF13EEb101F9E75FCeF58f19Ff383eEB', protocolFee: 100000000000000000000, decimals: 18, - bridgeType: 'default', + bridgeType: 'opposite', channel: 'layerzero', }, { @@ -756,7 +756,7 @@ export class TransferService extends BaseTransferServiceT3 { toAddress: '0x0000000000000000000000000000000000000000', protocolFee: 1000000000000000, decimals: 18, - bridgeType: 'default', + bridgeType: 'opposite', channel: 'layerzero', }, { @@ -854,7 +854,7 @@ export class TransferService extends BaseTransferServiceT3 { ], }, ], - }, + } ]; readonly isTest = this.configService.get('CHAIN_TYPE') === 'test'; diff --git a/subgraph/ln-default-bridge/package.json b/subgraph/ln-default-bridge/package.json index eb98dfae..c33a282d 100644 --- a/subgraph/ln-default-bridge/package.json +++ b/subgraph/ln-default-bridge/package.json @@ -4,9 +4,9 @@ "scripts": { "codegen": "graph codegen", "build": "graph build", - "build-sepolia": "sh generate.sh sepolia 0x7e101911E5FB461d78FBde3992f76F3Bf8BbA829 4607131 && graph codegen && graph build", - "build-arbisepolia": "sh generate.sh arbitrum-sepolia 0x7e101911E5FB461d78FBde3992f76F3Bf8BbA829 639445 && graph codegen && graph build", - "build-zksepolia": "sh generate.sh zksync-era-sepolia 0xbd8434d7d330329364590822ca2D2Fae630C1424 77153 && graph codegen && graph build", + "build-sepolia": "sh generate.sh sepolia 0x8429D7Dfd91D6F970ba89fFC005e67D15f1E4739 5088292 && graph codegen && graph build", + "build-arbisepolia": "sh generate.sh arbitrum-sepolia 0x8429D7Dfd91D6F970ba89fFC005e67D15f1E4739 7187613 && graph codegen && graph build", + "build-zksepolia": "sh generate.sh zksync-era-sepolia 0xBe23e871318E49C747CB909AC65aCCFAEAac3a37 97433 && graph codegen && graph build", "build-ethereum": "sh generate.sh mainnet 0x94C614DAeFDbf151E1BB53d6A201ae5fF56A9337 18411160 && graph codegen && graph build", "build-arbitrum": "sh generate.sh arbitrum-one 0x94C614DAeFDbf151E1BB53d6A201ae5fF56A9337 143123443 && graph codegen && graph build", "build-mantle": "sh generate.sh mantle 0x94C614DAeFDbf151E1BB53d6A201ae5fF56A9337 17119189 && graph codegen && graph build", diff --git a/subgraph/ln-opposite-bridge/package.json b/subgraph/ln-opposite-bridge/package.json index accfb43c..e3a44379 100644 --- a/subgraph/ln-opposite-bridge/package.json +++ b/subgraph/ln-opposite-bridge/package.json @@ -4,10 +4,8 @@ "scripts": { "codegen": "graph codegen", "build": "graph build", - "build-goerli": "sh generate.sh goerli 0x4C538EfA6e3f9Dfb939AA4F0B224577DA665923a 9844813 && graph codegen && graph build", - "build-arbigoerli": "sh generate.sh arbitrum-goerli 0x4C538EfA6e3f9Dfb939AA4F0B224577DA665923a 46913317 && graph codegen && graph build", - "build-lineagoerli": "sh generate.sh lineagoerli 0x4C538EfA6e3f9Dfb939AA4F0B224577DA665923a 1698144 && graph codegen && graph build", - "build-mantlegoerli": "sh generate.sh mantlegoerli 0x4C538EfA6e3f9Dfb939AA4F0B224577DA665923a 23363565 && graph codegen && graph build", + "build-sepolia": "sh generate.sh sepolia 0xbA96d83E2A04c4E50F2D6D7eCA03D70bA2426e5f 5088301 && graph codegen && graph build", + "build-arbisepolia": "sh generate.sh arbitrum-sepolia 0xbA96d83E2A04c4E50F2D6D7eCA03D70bA2426e5f 7188705 && graph codegen && graph build", "build-ethereum": "sh generate.sh mainnet 0x48d769d5C7ff75703cDd1543A1a2ed9bC9044A23 18381361 && graph codegen && graph build", "build-arbitrum": "sh generate.sh arbitrum-one 0x48d769d5C7ff75703cDd1543A1a2ed9bC9044A23 141864870 && graph codegen && graph build", "create-remote-dev": "graph create --access-token $KEY --node https://thegraph-g2.darwinia.network/helix/deploy/ lnopposite/$NETWORK", @@ -16,7 +14,7 @@ "deploy-remote-pro": "graph deploy --access-token $KEY --node https://thegraph.darwinia.network/helix/deploy/ --ipfs https://ipfs.network.thegraph.com lnopposite/$NETWORK" }, "dependencies": { - "@graphprotocol/graph-cli": "0.31.1", + "@graphprotocol/graph-cli": "0.64.1", "@graphprotocol/graph-ts": "0.30.0" } } diff --git a/subgraph/ln-opposite-bridge/yarn.lock b/subgraph/ln-opposite-bridge/yarn.lock index 6157eaa0..135c2640 100644 --- a/subgraph/ln-opposite-bridge/yarn.lock +++ b/subgraph/ln-opposite-bridge/yarn.lock @@ -217,10 +217,10 @@ graphql-import-node "^0.0.5" js-yaml "^4.1.0" -"@graphprotocol/graph-cli@0.31.1": - version "0.58.0" - resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.58.0.tgz#60af39fbf96296353dab862ea9f55026639f9851" - integrity sha512-EbdL5LZFmIMAuItQXv7LXgd7cqYQ3BdIJR2jxNr+LRL0juBAxmEz6zVvYnIUmgXoa5SB5rxE9ZT6pfe+fhbD6Q== +"@graphprotocol/graph-cli@0.64.1": + version "0.64.1" + resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.64.1.tgz#c644d7b387b8959e637b94896721251d45008e16" + integrity sha512-BUjWLiEvZUPxuJ/PpARXMBeVLBGjJ/AKP+Orqzlb09b/6HAyQwYpDsaz5R9rW05LYPRqMikuCmktY727rbIFuA== dependencies: "@float-capital/float-subgraph-uncrashable" "^0.0.0-alpha.4" "@oclif/core" "2.8.6" @@ -242,7 +242,7 @@ ipfs-http-client "55.0.0" jayson "4.0.0" js-yaml "3.14.1" - prettier "1.19.1" + prettier "3.0.3" request "2.88.2" semver "7.4.0" sync-request "6.1.0" @@ -2861,10 +2861,10 @@ pluralize@^8.0.0: resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== -prettier@1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== process-nextick-args@~2.0.0: version "2.0.1"