Skip to content

Validate custom hook archive prior to accepting a transaction

Sami Hiltunen requested to merge smh-validate-hooks into master

TransactionManager is currently not validating the custom hook archive in any way prior to accepting and logging the transaction. This could lead to invalid hook archive being logged which would prevent applying the log entry of the transaction leading to transaction processing halting. This commit verifies the archive by extracting it on the disk to the staging directory prior to logging. These extracted files can then later be also used for computing a vote to Praefect from the hook files. For now, no other validation is performed than just ensuring the hooks can be extracted on the disk. This matches the behavior in SetCustomHooks which also doesn't verify anything. This is something we should improve later. However, if the hooks extract successfully, the log processing won't fail because of them. If the hooks fail to execute, it will fail the hook execution but that's outside of the scope of the TransactionManager. The hooks can still be fixed by committing new ones.

Closes #5126 (closed)

Merge request reports