Backport !4002
Context
Changes from !4002 (merged) are critical for Protocol I. Cherry-picked all commits from it using the following commands.
$ git checkout -b shrmtv@proto-i-backport-4002
$ git cherry-pick 86c0f645^..7d3aae37
Manually testing the MR
Check CI.