paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.79k stars 646 forks source link

Request an advice on BadProof => "Transaction has a bad signature". #1380

Closed johnnyji-dev closed 1 year ago

johnnyji-dev commented 1 year ago

Hi~, I'm on Testing claim-reward "Shibuya" testnet (cf. Astar mainnet).

[DEV-Environment] I got a below error message on testing claim-reward on NESTJS env. I made an unsigned Transaction and then offline-signed with "@substrate/txwrapper-polkadot"-lib. 2023-09-04 06:50:48 RPC-CORE: submitExtrinsic(extrinsic: Extrinsic): Hash:: 1010: Invalid Transaction: Transaction has a bad signature [project-name] Error 9/4/2023, 6:50:48 AM Response[9c22a544] POST "~api-url~" 503 Service Unavailable - { stack: [ null ] } +195ms

[Test Result] My transaction is composed of multi-transactions for claim-reward(accumulated ERAs).

` ... const txs: Extrinsic[] = []; for (let i = 0; i < availEra; i++) { txs.push(provider.tx.dappsStaking.claimStaker(getDappAddressEnum(dAppCa))); } ... provider.tx.utility.batch(txs).method.toHex(), ... ` ` ... const actualTxHash = await provider.rpc.author.submitExtrinsic(signedTx); ... ` Test01-success case) if "availEra" on for-loop is below 7(include 7), It succeed to broadcast Transaction. I can get the "actualTxHash" on "". Test02-fail case) if "availEra" on for-loop is over 7(more than 8), It failed to broadcast Transaction. I got the upper err-mesg("... Hash:: 1010: Invalid Transaction: Transaction has a bad signature ..."). After signing a unsigned transaction, I checked the validation of transaction with "signatureVerify-api" on "@polkadot/util-crypto"-lib. I can get the "true" result. ` await cryptoWaitReady(); const isValid = signatureVerify(${unsigned data}, ${hex-type signed data}, u8aToHex(decodeAddress(${walt_address}))); console.log(`isValid : ${isValid.isValid}`); ` Question) How can I debug this case with another way? Or Can I get some advice for resolving it?
ggwpez commented 1 year ago

The DappsStaking pallet is not maintained here, neither is https://github.com/paritytech/txwrapper-core.

johnnyji-dev commented 1 year ago

The DappsStaking pallet is not maintained here, neither is https://github.com/paritytech/txwrapper-core.

thx for ur guide~