2

I am currently developing a parachain, and I'd like to add some custom events after block validation and log block authors who produce invalid blocks.

I found that the trait cumulus_pallet_parachain_system::CheckInherents could be used in cumulus_pallet_parachain_system::register_validate_block! to check the validity of each block proposed, but could not find a good way to add callback function of it.

Is there any way to add a callback after block validation? Thanks for your help.

1 Answer 1

3

The validation function of a Parachain is executed on the relay chain. So, this would bring you that much to "log" any block author. If a block is invalid, it also means that the execution panics and your callback wouldn't be executed at all.

There is also no way currently for being informed about invalid blocks.

You could implement your own BlockImport. This would mainly forward everything to the underlying block imports, but if there is a failure you could handle it. Then you would be able to observe any failed block.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.