From 915c04d7bc24eddb7ade28745ae517b15f10a179 Mon Sep 17 00:00:00 2001 From: Layne Haber Date: Tue, 9 Jul 2024 17:21:59 -0700 Subject: [PATCH 1/8] fix: update sdk --- packages/deployments/contracts/package.json | 2 +- yarn.lock | 195 ++++++++++++++++++-- 2 files changed, 185 insertions(+), 12 deletions(-) diff --git a/packages/deployments/contracts/package.json b/packages/deployments/contracts/package.json index 70b9e0a1bf..45a5e25710 100644 --- a/packages/deployments/contracts/package.json +++ b/packages/deployments/contracts/package.json @@ -57,7 +57,7 @@ "@arbitrum/sdk": "3.1.11", "@certusone/wormhole-sdk": "0.9.21", "@connext/nxtp-utils": "workspace:*", - "@consensys/linea-sdk": "0.1.6", + "@consensys/linea-sdk": "0.3.0", "@gelatonetwork/relay-context": "2.1.0", "@mantleio/sdk": "1.0.0", "@matterlabs/hardhat-zksync-deploy": "0.6.3", diff --git a/yarn.lock b/yarn.lock index 7a339908c7..d51f65bc84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,6 +23,13 @@ __metadata: languageName: node linkType: hard +"@adraffy/ens-normalize@npm:1.10.1": + version: 1.10.1 + resolution: "@adraffy/ens-normalize@npm:1.10.1" + checksum: 0836f394ea256972ec19a0b5e78cb7f5bcdfd48d8a32c7478afc94dd53ae44c04d1aa2303d7f3077b4f3ac2323b1f557ab9188e8059978748fdcd83e04a80dcc + languageName: node + linkType: hard + "@ampproject/remapping@npm:^2.2.0": version: 2.3.0 resolution: "@ampproject/remapping@npm:2.3.0" @@ -2790,7 +2797,7 @@ __metadata: version: 0.0.0-use.local resolution: "@connext/nxtp-utils@workspace:packages/utils" dependencies: - "@maticnetwork/maticjs": 3.6.6 + "@maticnetwork/maticjs": 3.8.2 "@maticnetwork/maticjs-web3": 1.0.4 "@sinclair/typebox": 0.25.21 "@types/chai": 4.3.4 @@ -2949,7 +2956,7 @@ __metadata: "@arbitrum/sdk": 3.1.11 "@certusone/wormhole-sdk": 0.9.21 "@connext/nxtp-utils": "workspace:*" - "@consensys/linea-sdk": 0.1.6 + "@consensys/linea-sdk": 0.3.0 "@eth-optimism/sdk": 3.3.2 "@gelatonetwork/relay-context": 2.1.0 "@mantleio/sdk": 1.0.0 @@ -3018,6 +3025,23 @@ __metadata: languageName: node linkType: hard +"@consensys/linea-sdk@npm:0.3.0": + version: 0.3.0 + resolution: "@consensys/linea-sdk@npm:0.3.0" + dependencies: + better-sqlite3: ^9.4.3 + class-validator: ^0.14.1 + dotenv: ^16.4.5 + ethers: ^6.11.1 + lru-cache: ^10.2.0 + pg: ^8.11.3 + typeorm: ^0.3.20 + typeorm-naming-strategies: ^4.1.0 + winston: ^3.12.0 + checksum: 69aa2fb2d01c2acddb99f7c44d069ebf4d2ed7cf4415ab28bde3c7ffbdbbf9b290efdf8620175a8f6156feaed0d2eabb37b0cc7b2f543086e342b27baaf3b49d + languageName: node + linkType: hard + "@coral-xyz/borsh@npm:0.2.6": version: 0.2.6 resolution: "@coral-xyz/borsh@npm:0.2.6" @@ -6355,15 +6379,15 @@ __metadata: languageName: node linkType: hard -"@maticnetwork/maticjs@npm:3.6.6": - version: 3.6.6 - resolution: "@maticnetwork/maticjs@npm:3.6.6" +"@maticnetwork/maticjs@npm:3.8.2": + version: 3.8.2 + resolution: "@maticnetwork/maticjs@npm:3.8.2" dependencies: "@ethereumjs/block": ^3.6.2 ethereumjs-util: ^7.1.4 merkle-patricia-tree: ^4.2.4 node-fetch: ^2.6.1 - checksum: 8f672ba26f0f69e4270f470b072b87b56e2a41d1e9c9d3c295bdba02afbcc9a271b4874362dc5b0f4e9b441bbb0c6e2756b30c6567494fbc590341cdccd91263 + checksum: 67962bb37ae8939838d634d7dc5e362c615e21e8b46b72fa27008497d097746adf7a796a4338add11fb80852214632bda23edcf3ff7de00e41fd694703c3385d languageName: node linkType: hard @@ -6568,7 +6592,16 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:1.3.0, @noble/curves@npm:~1.3.0": +"@noble/curves@npm:1.2.0": + version: 1.2.0 + resolution: "@noble/curves@npm:1.2.0" + dependencies: + "@noble/hashes": 1.3.2 + checksum: bb798d7a66d8e43789e93bc3c2ddff91a1e19fdb79a99b86cd98f1e5eff0ee2024a2672902c2576ef3577b6f282f3b5c778bebd55761ddbb30e36bf275e83dd0 + languageName: node + linkType: hard + +"@noble/curves@npm:1.3.0, @noble/curves@npm:^1.0.0, @noble/curves@npm:^1.2.0, @noble/curves@npm:~1.3.0": version: 1.3.0 resolution: "@noble/curves@npm:1.3.0" dependencies: @@ -6600,7 +6633,14 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.3, @noble/hashes@npm:~1.3.2": +"@noble/hashes@npm:1.3.2": + version: 1.3.2 + resolution: "@noble/hashes@npm:1.3.2" + checksum: fe23536b436539d13f90e4b9be843cc63b1b17666a07634a2b1259dded6f490be3d050249e6af98076ea8f2ea0d56f578773c2197f2aa0eeaa5fba5bc18ba474 + languageName: node + linkType: hard + +"@noble/hashes@npm:1.3.3, @noble/hashes@npm:^1, @noble/hashes@npm:^1.0.0, @noble/hashes@npm:^1.2.0, @noble/hashes@npm:^1.3.0, @noble/hashes@npm:^1.3.3, @noble/hashes@npm:~1.3.2": version: 1.3.3 resolution: "@noble/hashes@npm:1.3.3" checksum: 8a6496d1c0c64797339bc694ad06cdfaa0f9e56cd0c3f68ae3666cfb153a791a55deb0af9c653c7ed2db64d537aa3e3054629740d2f2338bb1dcb7ab60cd205b @@ -8572,6 +8612,13 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:18.15.13": + version: 18.15.13 + resolution: "@types/node@npm:18.15.13" + checksum: 79cc5a2b5f98e8973061a4260a781425efd39161a0e117a69cd089603964816c1a14025e1387b4590c8e82d05133b7b4154fa53a7dffb3877890a66145e76515 + languageName: node + linkType: hard + "@types/node@npm:20.5.1": version: 20.5.1 resolution: "@types/node@npm:20.5.1" @@ -9976,6 +10023,13 @@ __metadata: languageName: node linkType: hard +"aes-js@npm:4.0.0-beta.5": + version: 4.0.0-beta.5 + resolution: "aes-js@npm:4.0.0-beta.5" + checksum: cc2ea969d77df939c32057f7e361b6530aa6cb93cb10617a17a45cd164e6d761002f031ff6330af3e67e58b1f0a3a8fd0b63a720afd591a653b02f649470e15b + languageName: node + linkType: hard + "aes-js@npm:^3.1.1, aes-js@npm:^3.1.2": version: 3.1.2 resolution: "aes-js@npm:3.1.2" @@ -11786,6 +11840,17 @@ __metadata: languageName: node linkType: hard +"better-sqlite3@npm:^9.4.3": + version: 9.6.0 + resolution: "better-sqlite3@npm:9.6.0" + dependencies: + bindings: ^1.5.0 + node-gyp: latest + prebuild-install: ^7.1.1 + checksum: be3a1d2a3f6f9b5141be6607a38c0a51fa5849495b071955e507bc0c2a2fb08430852c1bf03796eec1a53344b25645807db48dcb51c71b0662b74c5a70420bb0 + languageName: node + linkType: hard + "big-integer@npm:1.6.36": version: 1.6.36 resolution: "big-integer@npm:1.6.36" @@ -13192,7 +13257,7 @@ __metadata: languageName: node linkType: hard -"class-validator@npm:^0.14.0": +"class-validator@npm:^0.14.0, class-validator@npm:^0.14.1": version: 0.14.1 resolution: "class-validator@npm:0.14.1" dependencies: @@ -15142,7 +15207,7 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^16.0.0, dotenv@npm:^16.0.3, dotenv@npm:^16.1.4": +"dotenv@npm:^16.0.0, dotenv@npm:^16.0.3, dotenv@npm:^16.1.4, dotenv@npm:^16.4.5": version: 16.4.5 resolution: "dotenv@npm:16.4.5" checksum: 301a12c3d44fd49888b74eb9ccf9f07a1f5df43f489e7fcb89647a2edcd84c42d6bc349dc8df099cd18f07c35c7b04685c1a4f3e6a6a9e6b30f8d48c15b7f49c @@ -16798,6 +16863,21 @@ __metadata: languageName: node linkType: hard +"ethers@npm:^6.11.1": + version: 6.13.1 + resolution: "ethers@npm:6.13.1" + dependencies: + "@adraffy/ens-normalize": 1.10.1 + "@noble/curves": 1.2.0 + "@noble/hashes": 1.3.2 + "@types/node": 18.15.13 + aes-js: 4.0.0-beta.5 + tslib: 2.4.0 + ws: 8.17.1 + checksum: beef4b6d117f64c369f44be631e0f666b966374eac0cc0446fa7abe114b11d6b3019060022eec65c031f150711f4913d249de507ff3da3204e654635db80a07e + languageName: node + linkType: hard + "ethjs-unit@npm:0.1.6": version: 0.1.6 resolution: "ethjs-unit@npm:0.1.6" @@ -22749,6 +22829,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^10.2.0": + version: 10.4.3 + resolution: "lru-cache@npm:10.4.3" + checksum: 6476138d2125387a6d20f100608c2583d415a4f64a0fecf30c9e2dda976614f09cad4baa0842447bd37dd459a7bd27f57d9d8f8ce558805abd487c583f3d774a + languageName: node + linkType: hard + "lru-cache@npm:^3.2.0": version: 3.2.0 resolution: "lru-cache@npm:3.2.0" @@ -25598,6 +25685,13 @@ __metadata: languageName: node linkType: hard +"pg-connection-string@npm:^2.6.4": + version: 2.6.4 + resolution: "pg-connection-string@npm:2.6.4" + checksum: 2c1d2ac1add1f93076f1594d217a0980f79add05dc48de6363e1c550827c78a6ee3e3b5420da9c54858f6b678cdb348aed49732ee68158b6cdb70f1d1c748cf9 + languageName: node + linkType: hard + "pg-int8@npm:1.0.1": version: 1.0.1 resolution: "pg-int8@npm:1.0.1" @@ -25614,6 +25708,15 @@ __metadata: languageName: node linkType: hard +"pg-pool@npm:^3.6.2": + version: 3.6.2 + resolution: "pg-pool@npm:3.6.2" + peerDependencies: + pg: ">=8.0" + checksum: 5ceee4320a35fce08777d085d50a30a1253574257e1e7c5c56c915056d387d340f797115580c8d90a46691f83c39a9b4da1fd810d9ad168cc455c79c289116f4 + languageName: node + linkType: hard + "pg-protocol@npm:*, pg-protocol@npm:^1.6.0": version: 1.6.0 resolution: "pg-protocol@npm:1.6.0" @@ -25621,6 +25724,13 @@ __metadata: languageName: node linkType: hard +"pg-protocol@npm:^1.6.1": + version: 1.6.1 + resolution: "pg-protocol@npm:1.6.1" + checksum: cce3f72cc4bdc04db9ce3fa38b2c45b745f0a95a925847b349087f52c02c4d51b7c74d8867e40639699d0c7609accfaffb6b1d221b3268d2bdc4bb8d6a2995a3 + languageName: node + linkType: hard + "pg-types@npm:^2.1.0, pg-types@npm:^2.2.0": version: 2.2.0 resolution: "pg-types@npm:2.2.0" @@ -25678,6 +25788,28 @@ __metadata: languageName: node linkType: hard +"pg@npm:^8.11.3": + version: 8.12.0 + resolution: "pg@npm:8.12.0" + dependencies: + pg-cloudflare: ^1.1.1 + pg-connection-string: ^2.6.4 + pg-pool: ^3.6.2 + pg-protocol: ^1.6.1 + pg-types: ^2.1.0 + pgpass: 1.x + peerDependencies: + pg-native: ">=3.0.1" + dependenciesMeta: + pg-cloudflare: + optional: true + peerDependenciesMeta: + pg-native: + optional: true + checksum: 8450b61c787f360e22182aa853548f834f13622714868d0789a60f63743d66ae28930cdca0ef0251bfc89b04679e9074c1398f172c2937bf59b5a360337f4149 + languageName: node + linkType: hard + "pgpass@npm:1.x": version: 1.0.5 resolution: "pgpass@npm:1.0.5" @@ -30625,6 +30757,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:2.4.0": + version: 2.4.0 + resolution: "tslib@npm:2.4.0" + checksum: 8c4aa6a3c5a754bf76aefc38026134180c053b7bd2f81338cb5e5ebf96fefa0f417bff221592bf801077f5bf990562f6264fecbc42cd3309b33872cb6fc3b113 + languageName: node + linkType: hard + "tslib@npm:2.5.0": version: 2.5.0 resolution: "tslib@npm:2.5.0" @@ -30968,7 +31107,7 @@ __metadata: languageName: node linkType: hard -"typeorm@npm:^0.3.16": +"typeorm@npm:^0.3.16, typeorm@npm:^0.3.20": version: 0.3.20 resolution: "typeorm@npm:0.3.20" dependencies: @@ -33231,6 +33370,25 @@ __metadata: languageName: node linkType: hard +"winston@npm:^3.12.0": + version: 3.13.0 + resolution: "winston@npm:3.13.0" + dependencies: + "@colors/colors": ^1.6.0 + "@dabh/diagnostics": ^2.0.2 + async: ^3.2.3 + is-stream: ^2.0.0 + logform: ^2.4.0 + one-time: ^1.0.0 + readable-stream: ^3.4.0 + safe-stable-stringify: ^2.3.1 + stack-trace: 0.0.x + triple-beam: ^1.3.0 + winston-transport: ^4.7.0 + checksum: 66f9fbbadb58e1632701e9c89391f217310c9455462148e163e060dcd25aed21351b0413bdbbf90e5c5fe9bc945fc5de6f53875ac7c7ef3061133a354fc678c0 + languageName: node + linkType: hard + "winston@npm:^3.9.0": version: 3.12.0 resolution: "winston@npm:3.12.0" @@ -33408,6 +33566,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:8.17.1": + version: 8.17.1 + resolution: "ws@npm:8.17.1" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 442badcce1f1178ec87a0b5372ae2e9771e07c4929a3180321901f226127f252441e8689d765aa5cfba5f50ac60dd830954afc5aeae81609aefa11d3ddf5cecf + languageName: node + linkType: hard + "ws@npm:^3.0.0": version: 3.3.3 resolution: "ws@npm:3.3.3" From 5452e856f52e72250cf63bf405530c4a4a3cdfb2 Mon Sep 17 00:00:00 2001 From: Layne Haber Date: Tue, 9 Jul 2024 17:22:09 -0700 Subject: [PATCH 2/8] feat: better error context --- .../agents/lighthouse/src/tasks/processFromRoot/helpers/linea.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/agents/lighthouse/src/tasks/processFromRoot/helpers/linea.ts b/packages/agents/lighthouse/src/tasks/processFromRoot/helpers/linea.ts index 1a14fc52bd..5d1028225a 100644 --- a/packages/agents/lighthouse/src/tasks/processFromRoot/helpers/linea.ts +++ b/packages/agents/lighthouse/src/tasks/processFromRoot/helpers/linea.ts @@ -54,6 +54,7 @@ export const getProcessFromLineaRootArgs = async ({ } else { throw new NoRootAvailable(spokeChainId, hubChainId, requestContext, methodContext, { error: `Linea Unknown message status`, + hash: sendHash, }); } }; From 8e1316a39ccef6471902c59e9882cc6c3e5027a2 Mon Sep 17 00:00:00 2001 From: Layne Haber Date: Tue, 9 Jul 2024 17:22:28 -0700 Subject: [PATCH 3/8] fix: local claim working --- .../contracts/tasks/connector/claimLinea.ts | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/packages/deployments/contracts/tasks/connector/claimLinea.ts b/packages/deployments/contracts/tasks/connector/claimLinea.ts index a4c0d1f486..44168c8f09 100644 --- a/packages/deployments/contracts/tasks/connector/claimLinea.ts +++ b/packages/deployments/contracts/tasks/connector/claimLinea.ts @@ -20,7 +20,7 @@ export default task("claim-linea", "Claim messages on both of L1 and L2") const deployer = Wallet.fromMnemonic(process.env.MAINNET_MNEMONIC ?? process.env.MNEMONIC!); const env = mustGetEnv(_env); - const networkType = _networkType ?? ProtocolNetwork.TESTNET; + const networkType = _networkType ?? ProtocolNetwork.MAINNET; console.log("networkType: ", networkType); console.log("env:", env); console.log("transaction hash", hash); @@ -47,17 +47,18 @@ export default task("claim-linea", "Claim messages on both of L1 and L2") }); // get L1/L2 contract - const originContract = chainId == hub.chain ? sdk.getL1Contract() : sdk.getL2Contract(); + const originContract = chainId == hub.chain ? sdk.getL2Contract() : sdk.getL1Contract(); // get Message Status const messages = await originContract.getMessagesByTransactionHash(hash); + console.log("messages: ", messages); if (!messages?.length) { throw new Error(`${hash} has no message sent`); } console.log("message: ", messages[0]); - const destContract = chainId == hub.chain ? sdk.getL2Contract() : sdk.getL1Contract(); + const destContract = chainId == hub.chain ? sdk.getL1Contract() : sdk.getL2Contract(); // returns on-chain message status by message hash const messageStatus = await destContract.getMessageStatus(messages[0].messageHash); @@ -67,17 +68,14 @@ export default task("claim-linea", "Claim messages on both of L1 and L2") console.log("message already claimed!! skipping..."); } else if (messageStatus === "CLAIMABLE") { console.log("Claimable message status. "); - let claimMessage = await destContract.claim( - { - // claims message by message - ...messages[0], - feeRecipient: deployer.address, // address that will receive fees. by default it is the message sender - }, - { - gasPrice: utils.parseUnits("3", "gwei"), - }, - ); - console.log(claimMessage); + let claimMessage = await destContract.claim({ + // claims message by message + ...messages[0], + feeRecipient: deployer.address, // address that will receive fees. by default it is the message sender + }); + console.log("claim:", claimMessage.hash); + const ret = await claimMessage.wait(); + console.log("claim receipt:", ret); } else { console.log("unknown message status. skipping..."); } From edd664796ae3307e1577a7952a1e1a46f7345416 Mon Sep 17 00:00:00 2001 From: Layne Haber Date: Tue, 9 Jul 2024 17:25:29 -0700 Subject: [PATCH 4/8] fix: fresh install --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index d51f65bc84..fd91848efa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6601,7 +6601,7 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:1.3.0, @noble/curves@npm:^1.0.0, @noble/curves@npm:^1.2.0, @noble/curves@npm:~1.3.0": +"@noble/curves@npm:1.3.0, @noble/curves@npm:~1.3.0": version: 1.3.0 resolution: "@noble/curves@npm:1.3.0" dependencies: @@ -6640,7 +6640,7 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.3, @noble/hashes@npm:^1, @noble/hashes@npm:^1.0.0, @noble/hashes@npm:^1.2.0, @noble/hashes@npm:^1.3.0, @noble/hashes@npm:^1.3.3, @noble/hashes@npm:~1.3.2": +"@noble/hashes@npm:1.3.3, @noble/hashes@npm:~1.3.2": version: 1.3.3 resolution: "@noble/hashes@npm:1.3.3" checksum: 8a6496d1c0c64797339bc694ad06cdfaa0f9e56cd0c3f68ae3666cfb153a791a55deb0af9c653c7ed2db64d537aa3e3054629740d2f2338bb1dcb7ab60cd205b From 6fa95bfeab18e8176d354f41372cc6c3dacf79a5 Mon Sep 17 00:00:00 2001 From: Liu <57480598+liu-zhipeng@users.noreply.github.com> Date: Wed, 10 Jul 2024 08:39:45 +0800 Subject: [PATCH 5/8] chore: yarn.lock --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index fd91848efa..244c656a69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2797,7 +2797,7 @@ __metadata: version: 0.0.0-use.local resolution: "@connext/nxtp-utils@workspace:packages/utils" dependencies: - "@maticnetwork/maticjs": 3.8.2 + "@maticnetwork/maticjs": 3.6.6 "@maticnetwork/maticjs-web3": 1.0.4 "@sinclair/typebox": 0.25.21 "@types/chai": 4.3.4 @@ -6379,15 +6379,15 @@ __metadata: languageName: node linkType: hard -"@maticnetwork/maticjs@npm:3.8.2": - version: 3.8.2 - resolution: "@maticnetwork/maticjs@npm:3.8.2" +"@maticnetwork/maticjs@npm:3.6.6": + version: 3.6.6 + resolution: "@maticnetwork/maticjs@npm:3.6.6" dependencies: "@ethereumjs/block": ^3.6.2 ethereumjs-util: ^7.1.4 merkle-patricia-tree: ^4.2.4 node-fetch: ^2.6.1 - checksum: 67962bb37ae8939838d634d7dc5e362c615e21e8b46b72fa27008497d097746adf7a796a4338add11fb80852214632bda23edcf3ff7de00e41fd694703c3385d + checksum: 8f672ba26f0f69e4270f470b072b87b56e2a41d1e9c9d3c295bdba02afbcc9a271b4874362dc5b0f4e9b441bbb0c6e2756b30c6567494fbc590341cdccd91263 languageName: node linkType: hard From e8ac76c85bbff5d29a045c1a460981c7af2272f7 Mon Sep 17 00:00:00 2001 From: preethamr Date: Tue, 9 Jul 2024 17:44:43 -0700 Subject: [PATCH 6/8] fix: errors --- packages/agents/lighthouse/package.json | 2 +- .../tasks/processFromRoot/helpers/linea.ts | 2 +- .../src/tasks/propagate/helpers/linea.ts | 2 +- packages/utils/package.json | 2 +- yarn.lock | 103 +----------------- 5 files changed, 10 insertions(+), 101 deletions(-) diff --git a/packages/agents/lighthouse/package.json b/packages/agents/lighthouse/package.json index d6b498f047..3789e12304 100644 --- a/packages/agents/lighthouse/package.json +++ b/packages/agents/lighthouse/package.json @@ -34,7 +34,7 @@ "@connext/nxtp-txservice": "workspace:*", "@connext/nxtp-utils": "workspace:*", "@connext/smart-contracts": "workspace:*", - "@consensys/linea-sdk": "0.1.6", + "@consensys/linea-sdk": "0.3.0", "@eth-optimism/sdk": "3.3.2", "@mantleio/sdk": "1.0.0", "@sinclair/typebox": "0.25.21", diff --git a/packages/agents/lighthouse/src/tasks/processFromRoot/helpers/linea.ts b/packages/agents/lighthouse/src/tasks/processFromRoot/helpers/linea.ts index 5d1028225a..e1a9a89079 100644 --- a/packages/agents/lighthouse/src/tasks/processFromRoot/helpers/linea.ts +++ b/packages/agents/lighthouse/src/tasks/processFromRoot/helpers/linea.ts @@ -50,7 +50,7 @@ export const getProcessFromLineaRootArgs = async ({ messageStatus, }); } else if (messageStatus === "CLAIMABLE") { - return [messages[0].calldata, messages[0].messageNonce]; + return [messages[0].calldata, BigNumber.from(messages[0].messageNonce)]; } else { throw new NoRootAvailable(spokeChainId, hubChainId, requestContext, methodContext, { error: `Linea Unknown message status`, diff --git a/packages/agents/lighthouse/src/tasks/propagate/helpers/linea.ts b/packages/agents/lighthouse/src/tasks/propagate/helpers/linea.ts index 56960ea547..768314b2db 100644 --- a/packages/agents/lighthouse/src/tasks/propagate/helpers/linea.ts +++ b/packages/agents/lighthouse/src/tasks/propagate/helpers/linea.ts @@ -45,7 +45,7 @@ export const getPropagateParams = async ( const gasLimit = BigNumber.from("120000"); const margin = BigNumber.from(1); - const _fee = gasPrice.mul(gasLimit).mul(margin).toString(); + const _fee = BigNumber.from(gasPrice).mul(gasLimit).mul(margin).toString(); logger.info("Got propagate params for Linea", requestContext, methodContext, { gasPrice: gasPrice.toString(), diff --git a/packages/utils/package.json b/packages/utils/package.json index 3a817bf4c9..67542b86ce 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -22,7 +22,7 @@ "src/**/*" ], "dependencies": { - "@maticnetwork/maticjs": "3.6.6", + "@maticnetwork/maticjs": "3.8.2", "@maticnetwork/maticjs-web3": "1.0.4", "@sinclair/typebox": "0.25.21", "ajv": "8.12.0", diff --git a/yarn.lock b/yarn.lock index 244c656a69..640de27ca7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2442,7 +2442,7 @@ __metadata: "@connext/nxtp-txservice": "workspace:*" "@connext/nxtp-utils": "workspace:*" "@connext/smart-contracts": "workspace:*" - "@consensys/linea-sdk": 0.1.6 + "@consensys/linea-sdk": 0.3.0 "@eth-optimism/sdk": 3.3.2 "@graphql-codegen/cli": 3.0.0 "@mantleio/sdk": 1.0.0 @@ -3004,27 +3004,6 @@ __metadata: languageName: unknown linkType: soft -"@consensys/linea-sdk@npm:0.1.6": - version: 0.1.6 - resolution: "@consensys/linea-sdk@npm:0.1.6" - dependencies: - "@enzoferey/ethers-error-parser": ^0.2.3 - "@ethersproject/address": ^5.7.0 - "@ethersproject/contracts": ^5.7.0 - "@ethersproject/providers": ^5.7.2 - better-sqlite3: ^8.4.0 - class-validator: ^0.14.0 - dotenv: ^16.1.4 - ethers: ^5.7.2 - pg: ^8.11.0 - reflect-metadata: ^0.1.13 - typeorm: ^0.3.16 - typeorm-naming-strategies: ^4.1.0 - winston: ^3.9.0 - checksum: 545bbe2cd2fff6aeb06c04fd6210fdd09da7d1f4c7e7bf11cdaea2b437473c157fe25922239c31a3efc54803a858f88eea390833184ab094d10c01b0b92725a5 - languageName: node - linkType: hard - "@consensys/linea-sdk@npm:0.3.0": version: 0.3.0 resolution: "@consensys/linea-sdk@npm:0.3.0" @@ -3421,15 +3400,6 @@ __metadata: languageName: node linkType: hard -"@enzoferey/ethers-error-parser@npm:^0.2.3": - version: 0.2.3 - resolution: "@enzoferey/ethers-error-parser@npm:0.2.3" - peerDependencies: - ethers: ^5.7.0 - checksum: cae3e284da043b61ce78a3a7a30bc76d6b2096e1e0dd13b793b821d6c4e82e1ce29b368ec679bb7adb55e3d4aaa65309ebd0a9671784ee83b0d1b2c1e7af3fd7 - languageName: node - linkType: hard - "@eslint-community/eslint-utils@npm:^4.2.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" @@ -11829,17 +11799,6 @@ __metadata: languageName: node linkType: hard -"better-sqlite3@npm:^8.4.0": - version: 8.7.0 - resolution: "better-sqlite3@npm:8.7.0" - dependencies: - bindings: ^1.5.0 - node-gyp: latest - prebuild-install: ^7.1.1 - checksum: f1fa38a9a0e4fcd59ececb67c60371b9638d29c19ce9af034421e8a56c9a77e799bb1411b1c3cb08bb9678e15dfb8985553a9ef4098cf5558e7207a3e019f211 - languageName: node - linkType: hard - "better-sqlite3@npm:^9.4.3": version: 9.6.0 resolution: "better-sqlite3@npm:9.6.0" @@ -13257,7 +13216,7 @@ __metadata: languageName: node linkType: hard -"class-validator@npm:^0.14.0, class-validator@npm:^0.14.1": +"class-validator@npm:^0.14.1": version: 0.14.1 resolution: "class-validator@npm:0.14.1" dependencies: @@ -15207,7 +15166,7 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^16.0.0, dotenv@npm:^16.0.3, dotenv@npm:^16.1.4, dotenv@npm:^16.4.5": +"dotenv@npm:^16.0.0, dotenv@npm:^16.0.3, dotenv@npm:^16.4.5": version: 16.4.5 resolution: "dotenv@npm:16.4.5" checksum: 301a12c3d44fd49888b74eb9ccf9f07a1f5df43f489e7fcb89647a2edcd84c42d6bc349dc8df099cd18f07c35c7b04685c1a4f3e6a6a9e6b30f8d48c15b7f49c @@ -25678,7 +25637,7 @@ __metadata: languageName: node linkType: hard -"pg-connection-string@npm:^2.5.0, pg-connection-string@npm:^2.6.2": +"pg-connection-string@npm:^2.5.0": version: 2.6.2 resolution: "pg-connection-string@npm:2.6.2" checksum: 22265882c3b6f2320785378d0760b051294a684989163d5a1cde4009e64e84448d7bf67d9a7b9e7f69440c3ee9e2212f9aa10dd17ad6773f6143c6020cebbcb5 @@ -25699,7 +25658,7 @@ __metadata: languageName: node linkType: hard -"pg-pool@npm:^3.5.2, pg-pool@npm:^3.6.1": +"pg-pool@npm:^3.5.2": version: 3.6.1 resolution: "pg-pool@npm:3.6.1" peerDependencies: @@ -25764,30 +25723,6 @@ __metadata: languageName: node linkType: hard -"pg@npm:^8.11.0": - version: 8.11.3 - resolution: "pg@npm:8.11.3" - dependencies: - buffer-writer: 2.0.0 - packet-reader: 1.0.0 - pg-cloudflare: ^1.1.1 - pg-connection-string: ^2.6.2 - pg-pool: ^3.6.1 - pg-protocol: ^1.6.0 - pg-types: ^2.1.0 - pgpass: 1.x - peerDependencies: - pg-native: ">=3.0.1" - dependenciesMeta: - pg-cloudflare: - optional: true - peerDependenciesMeta: - pg-native: - optional: true - checksum: 8af9468b8969fa0d73a6b349216c8cbc953d938fcae5594f2d24043060e9226a072c8085fc4230172b5576fcab4c39c8563c655f271dc2a9209b6ad5370cafe5 - languageName: node - linkType: hard - "pg@npm:^8.11.3": version: 8.12.0 resolution: "pg@npm:8.12.0" @@ -27271,13 +27206,6 @@ __metadata: languageName: node linkType: hard -"reflect-metadata@npm:^0.1.13": - version: 0.1.14 - resolution: "reflect-metadata@npm:0.1.14" - checksum: 155ad339319cec3c2d9d84719f730f8b6a6cd2a074733ec29dbae6c89d48a2914c7d07a2350212594f3aae160fa4da4f903e6512f27ceaf968443a7c692bcad0 - languageName: node - linkType: hard - "reflect-metadata@npm:^0.2.1": version: 0.2.1 resolution: "reflect-metadata@npm:0.2.1" @@ -31107,7 +31035,7 @@ __metadata: languageName: node linkType: hard -"typeorm@npm:^0.3.16, typeorm@npm:^0.3.20": +"typeorm@npm:^0.3.20": version: 0.3.20 resolution: "typeorm@npm:0.3.20" dependencies: @@ -33389,25 +33317,6 @@ __metadata: languageName: node linkType: hard -"winston@npm:^3.9.0": - version: 3.12.0 - resolution: "winston@npm:3.12.0" - dependencies: - "@colors/colors": ^1.6.0 - "@dabh/diagnostics": ^2.0.2 - async: ^3.2.3 - is-stream: ^2.0.0 - logform: ^2.4.0 - one-time: ^1.0.0 - readable-stream: ^3.4.0 - safe-stable-stringify: ^2.3.1 - stack-trace: 0.0.x - triple-beam: ^1.3.0 - winston-transport: ^4.7.0 - checksum: 7549e90d471312f3678c86fc51c86da05717be0390ecc0dc1a312a57f4ab3eb22e4fae1829291a05334376db8caa5f118d1de019d8c67e5f031ed70678363703 - languageName: node - linkType: hard - "word-wrap@npm:~1.2.3": version: 1.2.5 resolution: "word-wrap@npm:1.2.5" From 9caf6251f756248f1695739485bd90deb01ffbc4 Mon Sep 17 00:00:00 2001 From: preethamr Date: Tue, 9 Jul 2024 17:51:43 -0700 Subject: [PATCH 7/8] fix: yarn lock --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 640de27ca7..61ef0908cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2797,7 +2797,7 @@ __metadata: version: 0.0.0-use.local resolution: "@connext/nxtp-utils@workspace:packages/utils" dependencies: - "@maticnetwork/maticjs": 3.6.6 + "@maticnetwork/maticjs": 3.8.2 "@maticnetwork/maticjs-web3": 1.0.4 "@sinclair/typebox": 0.25.21 "@types/chai": 4.3.4 @@ -6349,15 +6349,15 @@ __metadata: languageName: node linkType: hard -"@maticnetwork/maticjs@npm:3.6.6": - version: 3.6.6 - resolution: "@maticnetwork/maticjs@npm:3.6.6" +"@maticnetwork/maticjs@npm:3.8.2": + version: 3.8.2 + resolution: "@maticnetwork/maticjs@npm:3.8.2" dependencies: "@ethereumjs/block": ^3.6.2 ethereumjs-util: ^7.1.4 merkle-patricia-tree: ^4.2.4 node-fetch: ^2.6.1 - checksum: 8f672ba26f0f69e4270f470b072b87b56e2a41d1e9c9d3c295bdba02afbcc9a271b4874362dc5b0f4e9b441bbb0c6e2756b30c6567494fbc590341cdccd91263 + checksum: 67962bb37ae8939838d634d7dc5e362c615e21e8b46b72fa27008497d097746adf7a796a4338add11fb80852214632bda23edcf3ff7de00e41fd694703c3385d languageName: node linkType: hard From d482937db7b2448e24ce42f9f56b3fffe147a21f Mon Sep 17 00:00:00 2001 From: wanglonghong Date: Wed, 10 Jul 2024 09:34:58 +0800 Subject: [PATCH 8/8] fix: initCoreSDK isn't a mockable fn --- .../chain-abstraction/test/libs/shared/quote.spec.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/agents/chain-abstraction/test/libs/shared/quote.spec.ts b/packages/agents/chain-abstraction/test/libs/shared/quote.spec.ts index 0baaf5a64b..57a1e146cd 100644 --- a/packages/agents/chain-abstraction/test/libs/shared/quote.spec.ts +++ b/packages/agents/chain-abstraction/test/libs/shared/quote.spec.ts @@ -167,8 +167,14 @@ describe("Libs:quote", () => { }); axiosGetStub.resolves({ data: { toAmount: "990000000000000" } }); let initCoreSDKStub: SinonStub; - initCoreSDKStub = stub(MockableFns, "initCoreSDK"); - initCoreSDKStub.resolves({ sdkBase: { calculateAmountReceived: { amountReceived: "100" } } }); + initCoreSDKStub = stub(HelperFns, "initCoreSDK"); + initCoreSDKStub.resolves({ + sdkBase: { + calculateAmountReceived: () => { + return { amountReceived: "100" }; + }, + }, + }); stub(HelperFns, "DestinationSwapperPerDomain").value({ "1886350457": { type: Swapper.UniV3,