polkadot-js / apps

Basic Polkadot/Substrate UI for interacting with a Polkadot and Substrate node. This is the main user-facing application, allowing access to all features available on Substrate chains.
https://dotapps.io
Apache License 2.0
1.75k stars 1.54k forks source link

Invalid Transaction: Transaction has a bad signature #3504

Closed yz89 closed 4 years ago

yz89 commented 4 years ago

After forcing a refresh of polkadot-js/apps, I meet this error when I send funds using apps.

balances.transfer
1010: Invalid Transaction: Transaction has a bad signature

It's ok to send funds before I refresh it.

My chain developed base on v2.0.0-rc4.

jacogr commented 4 years ago

Without understanding your chains and the types involved and how adjustments are made to cater for those, cannot quite comment with the limited info above.

Is it node-template based? Substrate-full based? Have you added any type overrides? If so, which?

yz89 commented 4 years ago

The chain is node-template based with version v2.0.0-rc4. It's Substrate-full based. I have added some types look like below and it worked fine before.

{
  "Address": "AccountId",
  "FooPubKey": "[u8; 32]",
  "Url": "Bytes",
  "Cid": "Bytes",
  "RefNum": "H256",
  "Result": "Bytes",
  "Node": {
    "fooId": "FooPubKey",
    "ephemeralId": "FooPubKey",
    "profileCid": "Bytes",
    "urls": "Vec<Url>",
    "peerId": "Bytes"
  },
  "Model": {
    "account": "AccountId",
    "payment": "u32",
    "cid": "Bytes"
  },
  "Task": {
    "refNum": "RefNum",
    "delegateFooId": "FooPubKey",
    "modelCid": "Bytes",
    "bodyCid": "Bytes",
    "payment": "Balance"
  },
  "Deposit": {
    "delegatorFooId": "FooPubKey",
    "depositPubkey": "FooPubKey",
    "delegatorSignature": "Bytes",
    "amount": "Balance",
    "expiredTime": "u64"
  },
  "Bill": {
    "employer": "AccountId",
    "delegatorFooId": "FooPubKey",
    "errandUuid": "Bytes",
    "payment": "Balance",
    "executorEphemeralId": "FooPubKey",
  },
  "Service": {
    "delegatorFooId": "FooPubKey",
    "deploymentId": "Cid",
    "cid": "Cid",
    "capChecker": "Cid"
  }
}

I roll back my chain code to last release version and meet new errors when sent funds:

polkadot.02.b9fcc847.js:1 2020-08-26 09:39:56        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1002: Verification Error: Execution: Could not convert parameter `tx` between node and runtime: No such variant in enum MultiSignature: RuntimeApi("Execution: Could not convert parameter `tx` between node and runtime: No such variant in

polkadot.02.b9fcc847.js:1 2020-08-26 09:39:56             DRR: Error: 1002: Verification Error: Execution: Could not convert parameter `tx` between node and runtime: No such variant in enum MultiSignature: RuntimeApi("Execution: Could not convert parameter `tx` between node and runtime: No such variant in

main.76575b0d.js:352 signAndSend: error: Error: 1002: Verification Error: Execution: Could not convert parameter `tx` between node and runtime: No such variant in enum MultiSignature: RuntimeApi("Execution: Could not convert parameter `tx` between node and runtime: No such variant in

polkadot.02.b9fcc847.js:1 2020-08-26 09:39:57        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1002: Verification Error: Execution: Could not convert parameter `tx` between node and runtime: No such variant in enum MultiSignature: RuntimeApi("Execution: Could not convert parameter `tx` between node and runtime: No such variant in

What can be done now?

yz89 commented 4 years ago

I added some other accounts into the endowed_accounts vector.

pub fn local_testnet_config() -> ChainSpec {
    ChainSpec::from_genesis(
        "Local Testnet",
        "local_testnet",
        ChainType::Local,
        || testnet_genesis(
            vec![
                authority_keys_from_seed("Alice"),
                authority_keys_from_seed("Bob"),
            ],
            get_account_id_from_seed::<sr25519::Public>("Alice"),
            vec![
                get_account_id_from_seed::<sr25519::Public>("Alice"),
                get_account_id_from_seed::<sr25519::Public>("Bob"),
                get_account_id_from_seed::<sr25519::Public>("Charlie"),
                get_account_id_from_seed::<sr25519::Public>("Dave"),
                get_account_id_from_seed::<sr25519::Public>("Eve"),
                get_account_id_from_seed::<sr25519::Public>("Ferdie"),
                get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
                get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
                get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
                get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
                get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
                get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
            ],
                        ...

I don't know if it makes a difference.

jacogr commented 4 years ago

When adding "Address": "AccountId", you need to add "LookupSource": "AccountId" as well (The API has a FAQ entry with aditional links that explains why - https://polkadot.js.org/api/start/FAQ.html#i-cannot-send-transactions-from-my-node-template-based-chain)

yz89 commented 4 years ago

You solved my problem, thank you very much.

Close this issue.

polkadot-js-bot commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.