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
Describe the bug
Sometimes a "Transaction verify failured" error occurs when a transaction is requested
debug shows that the signature does not correspond to the public key.
To Reproduce
varrpcClient=ClientFactory.GetClient("http://localhost:8899");varalice=newAccount([],newPublicKey("EypZqXgKUMP5RAMQCUpcwmJx8jknxPLJcD8PzwRPXBUE").KeyBytes);varaliceXTokenAccount=newPublicKey("74Ldi1XCcS4JuYnYmKxFo5ZPkX6ZWF3M1YV4RMEnyBAm");varaliceYTokenAccount=newPublicKey("CegyVoHotKcqGAeU5krSUjqKX2Nd7aKoJ1WKjTpVLdRQ");varescrowProgramId=newPublicKey("9qtJTdFfmKcuxNDD99qn87yS9Y7Axq4QaAFEFTT3z6in");vartempTokenAccount=newAccount();Console.WriteLine($"Alice temp token account: {tempTokenAccount.PublicKey.Key}");varescrowAccount=newAccount();Console.WriteLine($"Alice Escrow account: {escrowAccount.PublicKey.Key}");varxMintAccount=awaitrpcClient.GetTokenAccountInfoAsync(aliceXTokenAccount);Console.WriteLine($"Alice X mint account: {xMintAccount.Result.Value.Data.Parsed.Info.Mint}");varyMintAccount=awaitrpcClient.GetTokenAccountInfoAsync(aliceYTokenAccount);Console.WriteLine($"Alice Y mint account: {yMintAccount.Result.Value.Data.Parsed.Info.Mint}");varminBalanceForExemptionAcc=awaitrpcClient.GetMinimumBalanceForRentExemptionAsync(TokenProgram.TokenAccountDataSize);varminBalanceForExemptionEscrow=awaitrpcClient.GetMinimumBalanceForRentExemptionAsync(105);varcreateTempTokenAccountIx=SystemProgram.CreateAccount(alice.PublicKey,tempTokenAccount.PublicKey,minBalanceForExemptionAcc.Result,TokenProgram.TokenAccountDataSize,TokenProgram.ProgramIdKey);varinitTempAccountIx=TokenProgram.InitializeAccount(tempTokenAccount.PublicKey,newPublicKey(xMintAccount.Result.Value.Data.Parsed.Info.Mint),alice.PublicKey);varcreateTransferIx=TokenProgram.Transfer(aliceXTokenAccount,tempTokenAccount.PublicKey,10,alice.PublicKey);varcreateEscrowIx=SystemProgram.CreateAccount(alice.PublicKey,escrowAccount.PublicKey,minBalanceForExemptionEscrow.Result,105,escrowProgramId);varinitEscrowIx=TransactionInstructionFactory.Create(escrowProgramId,newList<AccountMeta>(){AccountMeta.ReadOnly(alice.PublicKey,true),AccountMeta.Writable(tempTokenAccount.PublicKey,false),AccountMeta.ReadOnly(aliceYTokenAccount,false),AccountMeta.Writable(escrowAccount.PublicKey,false),AccountMeta.ReadOnly(SysVars.RentKey,false),AccountMeta.ReadOnly(TokenProgram.ProgramIdKey,false),},[0,10,0,0,0,0,0,0,0]);varblock=awaitrpcClient.GetLatestBlockHashAsync();varmessage=newTransactionBuilder().SetRecentBlockHash(block.Result.Value.Blockhash).SetFeePayer(alice).AddInstruction(createTempTokenAccountIx).AddInstruction(initTempAccountIx).AddInstruction(createTransferIx).AddInstruction(createEscrowIx).AddInstruction(initEscrowIx);varmsg=message.CompileMessage();vartransaction=message.Build(newList<Account>(){alice,tempTokenAccount,escrowAccount});// .Build(new List<Account> { alice, tempTokenAccount, escrowAccount });// verify signaturevartx=Transaction.Deserialize(transaction);Console.WriteLine($"key1:{tx.Signatures[0].PublicKey} signature1:{tx.Signatures[0].PublicKey.Verify(msg,tx.Signatures[0].Signature)}\n"+$"key2:{tx.Signatures[1].PublicKey} signature2:{tx.Signatures[1].PublicKey.Verify(msg,tx.Signatures[1].Signature)} signature3:{tx.Signatures[1].PublicKey.Verify(msg,tx.Signatures[2].Signature)}\n"+$"key3:{tx.Signatures[2].PublicKey} signature3:{tx.Signatures[2].PublicKey.Verify(msg,tx.Signatures[2].Signature)} signature2:{tx.Signatures[2].PublicKey.Verify(msg,tx.Signatures[1].Signature)}");// var sig = await rpcClient.SendTransactionAsync(transaction);// Console.WriteLine($"sig result:{sig.Result}, raw:{sig.RawRpcResponse}");
Expected behavior
"transaction verify failured" never happens
Screenshots
Alice temp token account: DF5rPH7wD8957bUco1Hdk7LakZwnrg8E1PZFuhxUhWuK
Alice Escrow account: BBGurECrghixLFw8LgA9xKragzb2SBQ2bXuuwjv4CdNL
Alice X mint account: C4xqgBWFMyX7D8atVKYrezWBQjCxr5iD4EcxoENFKDJ4
Alice Y mint account: 5QX23zQRgfow7SDPLrDmh41oK8ucwYFiq94k7ViWgYaK
key1:EypZqXgKUMP5RAMQCUpcwmJx8jknxPLJcD8PzwRPXBUE signature1:True
key2:BBGurECrghixLFw8LgA9xKragzb2SBQ2bXuuwjv4CdNL signature2:False signature3:True
key3:DF5rPH7wD8957bUco1Hdk7LakZwnrg8E1PZFuhxUhWuK signature3:False signature2:True
The text was updated successfully, but these errors were encountered:
Describe the bug
Sometimes a "Transaction verify failured" error occurs when a transaction is requested
debug shows that the signature does not correspond to the public key.
To Reproduce
Expected behavior
"transaction verify failured" never happens
Screenshots
The text was updated successfully, but these errors were encountered: