فهرست منبع

decrease wait

Shawn Lu 1 سال پیش
والد
کامیت
3023a006a2
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/bridge/StargateClient.ts

+ 2 - 2
src/bridge/StargateClient.ts

@@ -47,7 +47,7 @@ export class StargateClient {
   async bridge(toChainId: number) {
   async bridge(toChainId: number) {
     if(toChainId === ChainId.ZKSYNC) throw new Error('Unsupported.')
     if(toChainId === ChainId.ZKSYNC) throw new Error('Unsupported.')
     return await polly()
     return await polly()
-      .waitAndRetry([1000 * 60, 1000 * 60 * 2, 1000 * 60 * 3])
+      .waitAndRetry([1000 * 10, 1000 * 20, 1000 * 30, 1000 * 40])
       .executeForPromise(async info => {
       .executeForPromise(async info => {
         try {
         try {
           const routerEth = RouterETH__factory.connect(chainInfoMap[this.chainId].ethRouterAddress, this.wallet)
           const routerEth = RouterETH__factory.connect(chainInfoMap[this.chainId].ethRouterAddress, this.wallet)
@@ -61,7 +61,7 @@ export class StargateClient {
           if (info.count > 0) {
           if (info.count > 0) {
             StargateClient.logger.info(`${this.wallet.address}: Retry ${info.count} times`)
             StargateClient.logger.info(`${this.wallet.address}: Retry ${info.count} times`)
           }
           }
-          const rate = BigInt(info.count) * 30n + 100n
+          const rate = BigInt(info.count) * 50n + 100n
           // add 20% gas cost for each retry
           // add 20% gas cost for each retry
           cost = (cost * rate) / 100n
           cost = (cost * rate) / 100n
           limit = (limit * rate) / 100n
           limit = (limit * rate) / 100n