(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