-
Notifications
You must be signed in to change notification settings - Fork 2.7k
subkey sign-transaction = panicked Option::unwrap()
on a None
value'
#5180
Comments
the |
P.S.: The |
As your default answer would probably be "just checkout master", I have now done that already:
but ... the bug (or lack of manual PEBKAC user error) remains:
|
I'm experiencing the same issue, it seems there is an issue with the |
Thanks a lot. I have just tried
|
I would like to know an OLD commit when There must have been a day on which it had worked, right? Thank you |
Or, perhaps an old RUST version on which it compiled without that bug? When was |
Thanks a lot. I seem to always forget that; not a chat type of guy. Interesting, am I only the second person (on the googleplanet) who is actually trying to use Anyways, idea: why not include all subcommands of subkey into the |
YESSS. That "dirty hack" gave me code that was still working:
try this:
that results in:
now the question is whether that blob is still compatible with And why the exact same parameters result in a bug in P.S.: It's not that that very old version does not have the bug at all, but it just doesn't have the bug for this set of inputs. |
Now notified these chats: polkadot watercooler (as subkey is not only for substrate, right?) and substrate technical and in polkadot |
first, your --call value needs to be an encoded Call representation, see https://substrate.dev/rustdocs/master/node_runtime/enum.Call.html. If that's not the case, this section in subkey/src/main.rs, ll 477: let function: Call = hex::decode(&call)
.ok()
.and_then(|x| Decode::decode(&mut &x[..]).ok())
.unwrap(); fails. however, looking at your use case, it looks like you want to do a balance transfer and can use subkey transfer 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d 0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 100000 5 --genesis dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b from //Alice: 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d Using a genesis hash of dcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b
0x350284ff78b6dd81f9f55c08fdedb28e5e78e44a1ce6568164d4bd43fa4630a7a38859270184470d96319b269d5f3fc802c6b9a1cda029a52c6b94a170c0c8a65faf0a8f1b2255185f9e0609b608cea812169f1607d211acfe4ac4d86fbe1c50039def418f0014000600ff8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48821a0600 if you to trace the parametrized Call function, you'll get: Call::Balances(transfer(Address::Id(8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 (5FHneW46...)), 100000)) |
Thanks @boneyard93501 for locating the bug in the code, that will make it easier for you or them to fix it. In Python we have the concept of "catching an exception" so that end users do not end up with error messages like I guess this chapter is the equivalent in rust? An ideal error message should IMHO help me to find out what exactly to fix, or change, so that by varying my input, the command throws no exception anymore. IF (and not only if) it is decided to let
Not only, no.
Yes. I got one of the long story short:
(Not only MY --code input parameters but) THE ORIGINAL PARAMETER SET FROM MAY 2019 is now throwing the -exact same- error with a 2020 subkey binary:
Thanks a lot. |
Update about the Python side of things: (1) the payload is very likely correct
(2) transaction signing MUST happen outside of their library:
See polkascan/py-substrate-interface#9 (comment) The "may happen in the next few months" is too late for me. And paritytech will probably want to also support other programming languages - e.g. Python - anyways, right? So please consider to (a) fix the above bug (b) write a manual chapter for Pythonians, OR (c) suggest a 2nd way how in Python (or ANY other language but rust+JS) ... to sign transactions that were generated as such Thanks. |
Surprising outcome:"Today we learned from Parity Technologies that So, no fast rust. But JS comes to the rescue - a dockerized PolkadotJS wrapper, (performs ~0.6 TPS, but) See https://riot.im/app/#/room/#polkadot-watercooler:matrix.org/$1583872648119884vTGxz:matrix.parity.io Great! We have a workaround now, to sign transactions generated in Python, yeehah. P.S.: Added later. Done multithreading experiments (on an Intel-i5-7th-generation-CPU) --> 1.327 TPS(no that is not 1327 TPS - but about 80 transactions in 60 seconds) Only for signing. Not composing the extrinsic, mining it into the chain, etc. So ... I herewith recommend to repair |
Which is the official RPC endpoints documentation (that is valid for the current stable version of substrate / node-template), incl. the scale codec instructions for the parameters of that RPC endpoint? Anyone? Thanks. --> polkascan/py-substrate-interface#10 (comment) |
workaround, ctd.:Very useful information:
Thanks a lot to Joe! |
Short story:
First see the "Long story short" in this comment below: #5180 (comment)
Long story:
Signing a transaction fails:
The result is
I have tried many other things, e.g. chose a different block hash, deleted all
0x
everywhere, etc.And tried instead of
or
because the latter is the
payload
generated by the polkascan library compose_call() - see below.the backtrace is
The
subkey
command should really tell us its code commit (and not only v2.0.0), but I am almost sure it is from this commit:which is the official
pre-v2.0-3e65111
"Current Stable Version" at https://substrate.dev/en/versionsThe new and excellent polkascan substrate library does not YET allow to SIGN-AND-SEND-A-TRANSACTION (that is why I am so desperately fiddling with
subkey
at all) but it provides apayload =
SubstrateInterface.compose_call()which I hoped would create the right payload that is then inserted into the
--call payload
argument ofsubkey
- right?I was wondering whether this would be the right way:
?
(Once you fixed the above subkey panick) ... would that scheme be the right way to send transactions? Or what am I missing ?
I am also open to ANY other tutorials and suggestions how to send a signed transaction in Python.
(And PLEASE add such manual pages for us Pythonians, anyways. Thanks.)
Thanks a lot!
The text was updated successfully, but these errors were encountered: