PR description:
> This will be used primarily by the addr time refactor ([[https://github.com/bitcoin/bitcoin/pull/24697 | core#24697]]) to make addr relay time type safe. However, it can also be used in other places, and can be reviewed independently.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/25101 | core#25101]]
Depends on D14911