paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

InvalidTransaction on latest master (after first tx success, latest master) #2022

Closed jacogr closed 5 years ago

jacogr commented 5 years ago

After building current substrate master, there seems to be issues with the transaction handling.

  1. Node is started
  2. Transfer is created and submitted
  3. It succeeds, balances change, nonce increases
  4. Another transfer is send (either the same account or a different one)
  5. Transfer fails with 1010 InvalidTransaction

To recover -

  1. Stop the node
  2. Restart the node
  3. Submit hex value (for previous failed tx) exactly as-is again
  4. Transaction succeeds, balances change, nonce increases
  5. At this point any subsequent transfers gets it to point 5 again, with the same resurrection
gavofyork commented 5 years ago

@tomusdrw any ideas? given a restart helps, could this be transaction queue?

tomusdrw commented 5 years ago

Could be, I'll look into this, I think I've experienced this locally on Friday as well.

tomusdrw commented 5 years ago

Seems that the are two separate issues that manifest in the same way (they differ in the data part of the error message of InvalidTransaction - one is 0 (BadSignature) and second is 3 (CantPay):

  1. The Authority account can't transfer funds after transferring (1 unit) them for 2-3 times. validate_transaction returns CantPay and wen debugging the runtime the free balance of the account is 0
  2. The newly created sr25519 can't send any transactions and gets BadSignature from the runtime.

I'm currently tackling (2).

jacogr commented 5 years ago

Tested against https://github.com/paritytech/substrate/pull/2028 - it seems to solve both the signature and fees issues (@tomusdrw would just appreciate another check from you)