matic.js
matic.js copied to clipboard
`abi` is inconsistently undefined when calling `zkEvmClient.isDepositClaimable()`
Describe the bug
Calling zkEvmClient.isDepositClaimable() appears to randomly error out with Cannot read properties of undefined (reading 'abi'). It works most of the time, but when it fails it appears to do so for hours at a time.
I believe the error is being thrown here in abi_manager.ts.
This call fails in the same process where it has worked many times before, so I do not believe it is a client init error. However, restarting the process seems to work 🤔
Versions
@maticnetwork/[email protected]@maticnetwork/[email protected]
Trace
module.exports../src/utils/abi_manager.ts.ABIManager.getABI (/prod/app/node_modules/.pnpm/@[email protected]/node_modules/@maticnetwork/maticjs/dist/matic.node.js:2915:13)
module.exports../src/utils/web3_side_chain_client.ts.Web3SideChainClient.getABI (/prod/app/node_modules/.pnpm/@[email protected]/node_modules/@maticnetwork/maticjs/dist/matic.node.js:4333:32)
module.exports../src/zkevm/bridge_util.ts.BridgeUtil.decodedBridgeData_ (/prod/app/node_modules/.pnpm/@[email protected]/node_modules/@maticnetwork/maticjs/dist/matic.node.js:4476:29)
Client init code
Full code here.
const zkEvmClient = new ZkEvmClient()
await zkEvmClient.init({
network: 'mainnet',
version: 'cherry',
parent: {
provider: this.l1Wallet,
defaultConfig: {
from: '<wallet_address>'
}
},
child: {
provider: this.l2Wallet,
defaultConfig: {
from: '<wallet_address>'
}
}
})
Example Claim
The following message was exhibiting this behavior until it was manually claimed:
- https://zkevm.polygonscan.com/tx/0x8a6c62c3444498d0c17d581965288556ab2fb40bf3258a7fefaf60210eb85dba