You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Random "signature verification failed" errors on WithdrawPosition txs
Description:
When executing transactions to withdraw a position, I occasionally encounter a failure in the transaction simulation and broadcasting process. The error returned is "Failed to simulate and broadcast after 3 attempts: Error: Broadcasting transaction failed with code 4 (codespace: sdk). Log: signature verification failed; please verify account number (12345), sequence (123) and chain-id (osmosis-1): unauthorized." This issue arises sporadically and does not consistently reproduce with the same conditions.
Environment Details:
OsmoJS Version: v16.9.0
Node.js Version: v20.11.0
Implementation
// all imports for the signing clientasyncinit(){this.signer=awaitSecp256k1HdWallet.fromMnemonic(this.accountMnemonic,{prefix: "osmo",hdPaths: [makeCosmoshubPath(this.accountIndex)]});this.address=(awaitthis.signer.getAccounts())[0].addressconstprotoRegistry: ReadonlyArray<[string,GeneratedType]>=[
...cosmosProtoRegistry,
...cosmwasmProtoRegistry,
...ibcProtoRegistry,
...osmosisProtoRegistry];constaminoConverters={
...cosmosAminoConverters,
...cosmwasmAminoConverters,
...ibcAminoConverters,
...osmosisAminoConverters};constregistry=newRegistry(protoRegistry);constaminoTypes=newAminoTypes(aminoConverters);this.client=awaitSigningStargateClient.connectWithSigner(this.rpcEndpoint,this.signer,{
registry,
aminoTypes
});}import{MsgWithdrawPosition}from"osmojs/dist/codegen/osmosis/concentratedliquidity/v1beta1/tx";import{Position}from"osmojs/dist/codegen/osmosis/concentratedliquidity/v1beta1/position";
async withdrawPosition(position: Position): Promise<DeliverTxResponse>{letvalue: MsgWithdrawPosition={positionId: position.positionId,sender: this.address,liquidityAmount: position.liquidity,}returnawaitthis.submitTx([{typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition",
value
}])}asyncsubmitTx(){constgasWanted: number=awaitthis.client.simulate(this.address,[messages[i]])constfee=awaitthis.calculateFee(gasWanted);constresponse=awaitthis.client.signAndBroadcast(this.address,[messages[i]],fee);}privateasynccalculateFee(gasWanted: number): Promise<StdFee>{
const gas=Math.ceil(gasWanted*1.3);constamount=String(Math.ceil((0.0025*1)*gas));// TODO Implement EIP1559return{amount: [{denom: "uosmo", amount}],gas: gas.toString(),}}
Actual Behavior:
The transaction intermittently fails with a signature verification error, despite extensive testing across 5 different public RPCs and accounts on the mainnet. These tests, conducted simultaneously to rule out time-related factors, yielded inconsistent results—successes mixed with failures—without any discernible pattern. The issue's sporadic nature, occurring in about half of the attempts, and the straightforward code complicate pinpointing the cause, as failures seem random and without a clear failure pattern.
Error Messages:
Failed to simulate and broadcast after 3 attempts: Error: Broadcasting transaction failed with code 4 (codespace: sdk). Log: signature verification failed; please verify account number (12345), sequence (123) and chain-id (osmosis-1): unauthorized.
Additional Context:
The issue occurs randomly and is not tied to a specific Position object or transaction payload.
I suspect this could be related to how transaction simulation and sequence numbers are handled or possibly an issue with the chain-id validation process. Any insights or suggestions on how to troubleshoot or resolve this issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Title:
Random "signature verification failed" errors on WithdrawPosition txs
Description:
When executing transactions to withdraw a position, I occasionally encounter a failure in the transaction simulation and broadcasting process. The error returned is "Failed to simulate and broadcast after 3 attempts: Error: Broadcasting transaction failed with code 4 (codespace: sdk). Log: signature verification failed; please verify account number (12345), sequence (123) and chain-id (osmosis-1): unauthorized." This issue arises sporadically and does not consistently reproduce with the same conditions.
Environment Details:
Implementation
Actual Behavior:
The transaction intermittently fails with a signature verification error, despite extensive testing across 5 different public RPCs and accounts on the mainnet. These tests, conducted simultaneously to rule out time-related factors, yielded inconsistent results—successes mixed with failures—without any discernible pattern. The issue's sporadic nature, occurring in about half of the attempts, and the straightforward code complicate pinpointing the cause, as failures seem random and without a clear failure pattern.
Error Messages:
Additional Context:
Position
object or transaction payload.I suspect this could be related to how transaction simulation and sequence numbers are handled or possibly an issue with the chain-id validation process. Any insights or suggestions on how to troubleshoot or resolve this issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered: