Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session.setKeys 1010: Invalid Transaction: BadProof #15

Closed
Xib1uvXi opened this issue May 7, 2020 · 9 comments
Closed

session.setKeys 1010: Invalid Transaction: BadProof #15

Xib1uvXi opened this issue May 7, 2020 · 9 comments

Comments

@Xib1uvXi
Copy link

Xib1uvXi commented May 7, 2020

When i send session setKeys extrinsics, get error(session.setKeys 1010: Invalid Transaction: BadProof)

  1. call RPC: author.insertKey(aura & account & granpa )
  2. call RPC: author.rotateKeys, get session public key
  3. send extrinsics: session.setKeys(session public key, 0x00 )

get error: session.setKeys 1010: Invalid Transaction: BadProof)

how can i set session key for validator

@Xib1uvXi
Copy link
Author

Xib1uvXi commented May 7, 2020

When i send session setKeys extrinsics, get error(session.setKeys 1010: Invalid Transaction: BadProof)

  1. call RPC: author.insertKey(aura & account & granpa )
  2. call RPC: author.rotateKeys, get session public key
  3. send extrinsics: session.setKeys(session public key, 0x00 )

get error: session.setKeys 1010: Invalid Transaction: BadProof)

@Xib1uvXi Xib1uvXi closed this as completed May 7, 2020
@Xib1uvXi Xib1uvXi reopened this May 7, 2020
@bkchr bkchr transferred this issue from paritytech/substrate May 7, 2020
@JoshOrndorff
Copy link

Can you tell us a little more information about your configuration?

What node did you build? Maybe it was the node template? Or the default Substrate node?

How are you submitting the extrinsic? Maybe using https://polkadot.js.org/apps/ ?

@Xib1uvXi
Copy link
Author

Xib1uvXi commented May 8, 2020

Can you tell us a little more information about your configuration?

What node did you build? Maybe it was the node template? Or the default Substrate node?

How are you submitting the extrinsic? Maybe using https://polkadot.js.org/apps/ ?

hello, it was the node template, i implemented a POA Validator Set:

my runtime lib.rs:

// session key
pub mod opaque {
    // -------------------------------snip
    impl_opaque_keys! {
		pub struct SessionKeys {
			pub aura: Aura,
			pub grandpa: Grandpa,
		}
	}
}

// -------------------------------snip
// my poa pallet
impl xmc_poa::Trait for Runtime {
    type VsChecker = xmc_poa::DefaultValidatorSetSizeChecker;
    type Event = Event;
}

// -------------------------------snip
// session pallet
impl session::Trait for Runtime {
    type Event = Event;
    type ValidatorId = <Self as system::Trait>::AccountId;

    type ValidatorIdOf = xmc_poa::ValidatorOf<Self>;

    type ShouldEndSession = Poa;

    type NextSessionRotation = Poa;

    type SessionManager = Poa;

    type SessionHandler = <opaque::SessionKeys as OpaqueKeys>::KeyTypeIdProviders;

    type Keys = opaque::SessionKeys;
    type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
}

i used https://polkadot.js.org/apps/ submitting the extrinsic ------> session.setKeys()

i found the error which is tx pool error: 1010: Invalid Transaction: BadProof

@Xib1uvXi
Copy link
Author

Xib1uvXi commented May 8, 2020

node log about error: Failed to submit extrinsic: Transaction pool error: Invalid transaction validity: InvalidTransaction::BadProof

@JoshOrndorff
Copy link

Did you get this error with the same version of the node template before you made your modifications?

@Xib1uvXi
Copy link
Author

Xib1uvXi commented May 8, 2020

The v2.0.0-alpha.6 node template default is to not use the session at runtime, i'm no get this error.
I feel strange that only performing setKeys will report the error, others is normal

@JoshOrndorff
Copy link

JoshOrndorff commented May 8, 2020

only performing setKeys will report the error, others is normal

Aha, That' was the tidbit I needed. You will need to add this custom type on the Settings -> Development tab of the Apps UI.

{
  "Keys": "SessionKeys2"
}

This assumes that you do indeed have two session keys (one for Aura and one for Grandpa).

The Apps UI assumes that there are 5 session keys by default because this is what the full Substrate node and Polkadot use. When you add the session pallet to your node that has only two session keys, you need to tell the UI about it so it can encode the transaction properly.

@JoshOrndorff
Copy link

There's a video recording of us experiencing this same issue and solving it at Substrate seminar here (link starts at the right time) https://www.youtube.com/watch?v=89qLUZeB4WU&list=PLp0_ueXY_enXRfoaW7sTudeQH10yDvFOS%3Ft%3D4250

@Xib1uvXi
Copy link
Author

Xib1uvXi commented May 9, 2020

only performing setKeys will report the error, others is normal

Aha, That' was the tidbit I needed. You will need to add this custom type on the Settings -> Development tab of the Apps UI.

{
  "Keys": "SessionKeys2"
}

This assumes that you do indeed have two session keys (one for Aura and one for Grandpa).

The Apps UI assumes that there are 5 session keys by default because this is what the full Substrate node and Polkadot use. When you add the session pallet to your node that has only two session keys, you need to tell the UI about it so it can encode the transaction properly.

thx!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants