Following a relay runtime upgrade for westend 103000 (which contained a broken migration of the beefy keys), our chain stopped finalizing blocks (all validators, except 1, had the wrong keys on-chain).
While preparing the solution, we left the relay pass 500+ blocks of finality lag, which "forces" the validator to finalize the blocks that are 500+ behind. This helped to recover the network.
However, the other nodes (RPC nodes) are now refusing the finality:
2024-03-01 09:32:25.357 ERROR tokio-runtime-worker grandpa: GRANDPA voter error: safety invariant has been violated: Invalid operation in the pending changes tree: Finalized descendent of Tree node without finalizing its ancestor(s) first
2024-03-01 09:26:29.306 ERROR tokio-runtime-worker sc_service::task_manager: Essential task `grandpa-voter` failed. Shutting down service.
(Also) On another network, with same conditions, we fixed it by using the only valid validator and note_stalled. The RPC nodes are also refusing finality:
2024-03-01 07:51:21.022 DEBUG tokio-runtime-worker sync::import-queue: Justification import failed for hash = 0xf27b397021806e4bccfe6e0ab3f19e768f3f0495b71187ba8aab3d63bd7dcf28 with number = 12977265 coming from node = PeerId("12D3KooWQRVQqakRuPxwLoaRHTpEaTDQSX9MqAatJ2Jgqd5aucvf") with error: Import failed: bad justification for header: invalid signature for precommit in grandpa justification
2024-03-01 07:51:21.022 INFO tokio-runtime-worker sync: 💔 Invalid justification provided by 12D3KooWQRVQqakRuPxwLoaRHTpEaTDQSX9MqAatJ2Jgqd5aucvf for #0xf27b…cf28
How can we force nodes to accept the justification or to simply consider those blocks as final ?