Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

sc_cli key insert gives wrong name to _gran_ key file created in local keystorage (BREAKS blocks finalization) #9888

@agryaznov

Description

@agryaznov

(found while passing this Tutorial)

Summary

key insert gives a wrong name to file containing gran (ed25519) key, which effectively leads to broken GRANDPA finalization in node

Details

Performing the key insert command operation with pre-generated Alice' key

# insert Alice's sr25519 aura key into storage
$ ./target/release/node-template key insert --base-path /tmp/node01 --chain local --key-type aura --suri "clip organ olive upper oak void inject side suit toilet stick narrow"

# insert Alice's ed25519 gran key into storage
$ ./target/release/node-template key insert --base-path /tmp/node01 --chain local --key-type gran --suri "clip organ olive upper oak void inject side suit toilet stick narrow"

leads to creating these two files :

$ find /tmp/node01/chains/local_testnet/keystore -type f -printf "%f\n"
617572619effc1668ca381c242885516ec9fa2b19c67b6684c02a8a3237b6862e5c8cd7e
6772616e9effc1668ca381c242885516ec9fa2b19c67b6684c02a8a3237b6862e5c8cd7e

one of which is possibly wrong-named, as in their names:

  • 61757261 encodes aura key type
  • 6772616e encodes gran key type

and the other 9effc1668ca381c242885516ec9fa2b19c67b6684c02a8a3237b6862e5c8cd7e part derives from public key, which should be different for aura (sr25519) and gran (ed25519), but it turns out to be just the same for both

how it (supposedly) should work

if we just insert the same keys using JSON RPC (e.g. with this script), we get the gran key file named properly (and nodes finalizing blocks successfully)

$ find /tmp/node01/chains/local_testnet/keystore -type f -printf "%f\n"
617572619effc1668ca381c242885516ec9fa2b19c67b6684c02a8a3237b6862e5c8cd7e
6772616eb48004c6e1625282313b07d1c9950935e86894a2e4f21fb1ffee9854d180c781

Metadata

Metadata

Assignees

No one assigned

    Labels

    J2-unconfirmedIssue might be valid, but it’s not yet known.Z7-questionIssue is a question. Closer should answer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions