[[https://github.com/bitcoin/bitcoin/pull/14926/files | PR14926]] backport.
Pull request description:
There is no check that checks that final transactions are valid, i.e. the consensus rules could be changed (accidentally) with none of the tests failing.