Backport !3984
Context
Changes from !3984 (merged) are critical for Protocol I. Cherry-picked all commits from it using the following commands.
$ git checkout -b shrmtv@proto-i-backport-3984
$ git cherry-pick e9482258^..08f8fcbb
Resolved conflict in src/proto_alpha/lib_client/mockup.ml
.
Manually testing the MR
Check CI.