Make all of net_processing (and some of net) use std::chrono types#21015
Make all of net_processing (and some of net) use std::chrono types#21015fanquake merged 4 commits intobitcoin:masterfrom
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
I am still working on figuring out why |
|
Concept ACK. This refactoring should only be changing the types at compile-time, not any values at run time. |
6f286b4 to
c9a8cbc
Compare
maflcko
left a comment
There was a problem hiding this comment.
left some style-nits. Feel free to ignore.
review ACK c9a8cbc64eddd98d2183380148a3d9c79c1bd7d2 🐉
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
review ACK c9a8cbc64eddd98d2183380148a3d9c79c1bd7d2 🐉
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUjXQAwAmlnqHxcZHCTykusiZ3462hXgmsVzJZFoEXtZWK0hJqI4Dic/WgQ6gd+n
+AJlwBfJ56FmyVHXPa61h1njES+9cZfUvq4Ty5DbgVHAF3M7e0xz0WrUq2KUzRxf
xpKgVuWN1/aeHXGn6qRzvGAvjAA/6ozQ8H5HC0jnru5EWZX7FBDDgef1ApkIOd4I
YRx7D2iqHvcVPS/Di82+2UHjvBN789NMwB3MQDsB6lbEYzNaE2FVYrcdtXiepYk7
kqXhqWavBlubcPfRyXLRXbbVv/A0z0ZUhv2laaJuOMv/ssk/LXiOCE37aytLCnvV
AiLIlA64AFp8BDrykUtqaFqCTRbSQSELsHldAmIIe+gV9rF+6cVp8ClWMl/QRWjS
nZnChOANGW08/+t4KeiDKxRUHlwko29Y4NX4p3pVR99beMmTagqiN0Rflbrv6okA
aoKZdDLz0jUnARvfbib7vqbiNxvZWA6WBlfrnWSXpaTRohPWW3wWTaQc09yF2Qgw
Q8SDUsfg
=09jz
-----END PGP SIGNATURE-----
Timestamp of file with hash 21b8f1b48c83567a179a56af130b796e2cfb94ca44d7acdf169927f865176af6 -
|
Thanks for the review, @MarcoFalke. Comments addressed. Ready for further review. |
|
Pushed to fix doxygen comment. |
maflcko
left a comment
There was a problem hiding this comment.
re-ACK f4450e105781441020964af1e488a033ec1c4be4 only change is rebase and replacing round with cast 🥈
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
re-ACK f4450e105781441020964af1e488a033ec1c4be4 only change is rebase and replacing round with cast 🥈
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUhWmwwAxL1AxtKfLrkQG1JwbvU1nqjLFPPh21d1VbMPv6AcBa3dNgDgvVN+zhXt
SzZg6Xq97fpxKg+dElnrYMfJjtoUGFWMlMGg5EXvBcCNAF4m+Nse7wRUYdWU/aKD
hTltetKiRDhrD5hfNzy8eWA/ATjvdj7e/P5L4zA9TMvHT2HEYpO3Cxhat4KJ3oky
nR0nkb0E8nGH5Wsj+/iiBwE2GPq7gUCUvxyNgmmwDk85Ue908I9ZkG6XTxK6SHIJ
aKq5CwgNciiBvzm7FDEXWNed4yfQPOezrhofrtIDyX4RhY0iKYF+5Qjgc8Figq0C
Y89vsIyTHVFviExvvD16c5CKznvwSHJOXtT+zAMibwPJnbhs4zUsFk0/JAf86c1P
1rLaeUaJDiQHXDwK9X+VdA/ut3aDZsUDo9qj9ti//7s3RkLaiIsICC0XZswgnWUK
uUjk1A+HhL6Enel4Gn6ROMZrAD3UaEHsfTER/7g32G+0c7FMgc4087Kkn0QVk3uZ
GNTjHYt0
=31oD
-----END PGP SIGNATURE-----
Timestamp of file with hash e074c33ed68514a9ea03925c2afa9f30b80c656ab5d0cf97a31ed6c37918737f -
|
@ajtowns if there are specifics that you want to see addressed, it might help to post a patch which compiles and that can be taken in the next rebase. Otherwise I think this is ready for merge (mod the nits, which can be fixed in the next rebase as well). |
|
Rebased. Comments addressed:
Ready for further review. |
|
utACK 0eaea66 |
|
ACK 0eaea66 |
maflcko
left a comment
There was a problem hiding this comment.
re-ACK 0eaea66, only changes: minor rename, using C++11 member initializer, using 2min chrono literal, rebase 🤚
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
re-ACK 0eaea66e8bfdfb23ff86c0f0924c2d75f5aca75f, only changes: minor rename, using C++11 member initializer, using 2min chrono literal, rebase 🤚
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUgJigwAlGgnegNU2yOZwT9wE9VjciuGc8zXxc4Su130pNLHYd3yirTDUUKwbk4l
pzjUIP6GGSFNHWKjMkGTXgIqzlKQ3YUWfBqCBZKt60G+bwAPfm+tri4lBxBsVXk6
D2e16A8c/mdFfyRPeFl59qtfBE3Wdu7AtHL47u77jLywCUnAPopm9PaHz/xp+w70
O0w5FEr2cazU8tp0u2CY6rMufqjyCZZ/qR4fqNwmOFSR+luBma1ZW7Y0VbmTkjVy
JDrlsITpSyQy9yTosRD0RZ+86BfuGuCR5M3wWsKoepuVpX886pHl/jZEyi9C+eG1
b6ijElFEcU79COu+zocyThQqAkemegbPUBQYttpPtI9d6FZuBUVMK7P/siBVUUPi
75xu76QgF2wuUkCFXDtBobLOGTUlUiKair0lcy/vBWjy/oT12LCh1YZTeYuPwYle
a51LXkhN+dyNUsfYOrN0NkR58VPcKPRk26sbEEzXS750uZx4SIdJ+qSsy5w5LNZw
518vxGAE
=d/DI
-----END PGP SIGNATURE-----
Timestamp of file with hash ba138de68b952c6d098d60b477ecdf0b15cc363ee617f9836e4dafe46273e159 -
| QString formatPingTime(std::chrono::microseconds ping_time) | ||
| { | ||
| return (ping_usec == std::numeric_limits<int64_t>::max() || ping_usec == 0) ? QObject::tr("N/A") : QString(QObject::tr("%1 ms")).arg(QString::number((int)(ping_usec / 1000), 10)); | ||
| return (ping_time == std::chrono::microseconds::max() || ping_time == 0us) ? |
There was a problem hiding this comment.
Having this be ping_time == ping_time.max() would ensure you don't accidently get the wrong type (eg if ping_time was changed to milliseconds, and set to max it would no longer compare equal to microseconds max). There's a few places where the code might be improved by that change.
… std::c… …hrono types
Summary: Partial backport of [[bitcoin/bitcoin#21015 | core#21015]]: bitcoin/bitcoin@4d98b40 Depends on D10902. Ref T1696. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Maniphest Tasks: T1696 Differential Revision: https://reviews.bitcoinabc.org/D10903
Summary: Partial backport of [[bitcoin/bitcoin#21015 | core#21015]]: bitcoin/bitcoin@c733ac4 Depends on D10903. Ref T1696. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Maniphest Tasks: T1696 Differential Revision: https://reviews.bitcoinabc.org/D10906
Summary: Partial backport of [[bitcoin/bitcoin#21015 | core#21015]]: bitcoin/bitcoin@55e8288 Depends on D10911. The OUTBOUND_INVENTORY_BROADCAST_INTERVAL constant has been skipped to keep the changes from rABC3252c21e2856bce86e6222d246073fbde8ad9916, but the INBOUND_INVENTORY_BROADCAST_INTERVAL renaming kept to closer match the source material. Ref T1696. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Maniphest Tasks: T1696 Differential Revision: https://reviews.bitcoinabc.org/D10913
Summary: Completes backport of [[bitcoin/bitcoin#21015 | core#21015]]: bitcoin/bitcoin@0eaea66 Depends on D10913. Ref T1696. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Maniphest Tasks: T1696 Differential Revision: https://reviews.bitcoinabc.org/D10914
(Picking up #20044. Rebased against master.)
This changes various uses of integers to represent timestamps and durations to
std::chronoduration types with type-safe conversions, getting rid of various.count(), constructors, and conversion factors.