Open rabi-siddique opened 3 days ago
I followed the stack trace and made updates in node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js
.
Mainly replaced:
function decodeAttribute(attribute) {
return {
key: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(attribute.key)),
value: (0, encoding_1.fromBase64)((0, encodings_1.assertString)(attribute.value ?? "")),
};
}
With:
function decodeAttribute(attribute) {
let key = attribute.key;
let value = attribute.value;
return {
key,
value,
};
}
After making this change, the error message changed to:
/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/rpcclients/httpclient.js:24
throw new Error(JSON.stringify(response.error));
^
Error: {"code":-32603,"message":"Internal error","data":"transaction indexing is disabled"}
at HttpClient.execute (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/rpcclients/httpclient.js:24:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Tendermint34Client.doCall (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js:310:24)
at async Tendermint34Client.txSearchAll (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js:258:26)
at async SigningStargateClient.txsQuery (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/stargate/build/stargateclient.js:283:25)
at async SigningStargateClient.getTx (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/stargate/build/stargateclient.js:213:25)
at async pollForTx (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/stargate/build/stargateclient.js:254:28)
Node.js v18.20.4
Weird that I see an increment in the aUSDC
balance on the Metamask wallet. Even though we encountered an error.
Hey, to confirm you said in your first questions tokens are being decremented and now you're seeing the aUSDC
balance incremented on your metamask wallet on avalanche? Is there a tx hash you can share for these txs?
Hey, to confirm you said in your first questions tokens are being decremented and now you're seeing the aUSDC balance incremented on your metamask wallet on avalanche?
Initially, aUSDC
tokens were deducted from my Keplr wallet, but no aUSDC
appeared in my Metamask account. But, after implementing the change I mentioned in my earlier comment, I observed an increase in the aUSDC
balance on Metamask.
Is there a tx hash you can share for these txs?
Let me check and share.
@benjamin852 I don’t recall the exact transaction details, as this was done some time ago. However, here’s a link to my transactions on the block explorer:
Transaction history.
I believe the issue occurred during transfers from Osmosis to Avalanche, and these transactions might be relevant:
I observed a similar issue in transactions from Osmosis to Sepolia. In the final transaction, I noticed that aUSDC appeared in my MetaMask wallet. Here are the relevant transactions for your inspection:
Hello @rabi-siddique, Thank you for sharing all the transaction details. We really appreciate your patience in debugging this.
Regarding the error you encountered, it looks like this is mainly a client-side issue rather than an on-chain one. That’s likely why the transaction went through even though you ran into the error. Since the implementation in JavaScript/TypeScript is asynchronous, it doesn't block the actual on-chain activity, and the indexing error appears to be happening afterward when the transaction details are being fetched.
Specifically, the error "transaction indexing is disabled" suggests that the Osmosis RPC endpoint you used doesn’t have transaction indexing enabled. This means that while the transaction itself was successfully processed, the node couldn't search for or return the transaction details because they weren't indexed yet.
I retried this process on my end using a node with transaction indexing enabled, and it worked smoothly. To move forward, I recommend either:
Trying a Different RPC Endpoint: Look for an Osmosis testnet RPC that has transaction indexing enabled. This should help avoid the indexing error you're seeing.
Adjusting the Client Behavior: You could also adjust the client to handle scenarios where the transaction indexing might take longer, perhaps by adding retry logic or handling the error more gracefully when fetching transaction information. Let me know if this helps or if you need further assistance!
@Olanetsoft Thanks for the detailed response. Very helpful.
About the error I encountered first:
/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/base64-js/index.js:26
throw new Error('Invalid string. Length must be a multiple of 4')
^
Error: Invalid string. Length must be a multiple of 4
at getLens (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/base64-js/index.js:26:11)
at Object.toByteArray (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/base64-js/index.js:55:14)
at fromBase64 (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@cosmjs/encoding/build/base64.js:36:21)
at decodeAttribute (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:43:40)
at Array.map (<anonymous>)
at decodeAttributes (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:48:53)
at decodeEvent (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:53:40)
at Array.map (<anonymous>)
at decodeEvents (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:58:49)
at decodeTxData (/Users/rabisiddique/Desktop/Work/cosmos-to-evm/node_modules/@axelar-network/axelarjs-sdk/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:66:31)
Node.js v18.20.4
This is resolved via the explanation in this comment. How to overcome this error without slightly changing implementation of @cosmjs/tendermint-rpc
I have a Node.js script designed to transfer
aUSDC
from the Osmosis testnet to the Avalanche testnet. However, while executing the script, I encountered the following error:I didn’t receive funds in my MetaMask wallet, but the
aUSDC
tokens were deducted from my wallet. Why did this happen? Will the tokens be returned to me, or are they permanently lost?Here is my script: