XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.48k stars 1.44k forks source link

Add Antithesis intrumentation #5042

Open Bronek opened 2 weeks ago

Bronek commented 2 weeks ago

High Level Overview of Change

Add Antithesis instrumentation.

Context of Change

This change brings in Antithesis SDK files into external/antithesis-sdk and replaces assert macro with an equivalent XRPL_ASSERT and assert(false) with an equivalent XRPL_UNREACHABLE. It is also a prerequisite for the addition of all other Antithesis instrumentation (which are related to test coverage, hence do not have an equivalent in C).

The Antithesis SDK is under MIT license, and has been copied from https://github.com/antithesishq/antithesis-sdk-cpp/ commit 157fa68

Type of Change

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 74.15600% with 222 lines in your changes missing coverage. Please review.

Project coverage is 71.3%. Comparing base (9fec615) to head (cf9d889).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/XRPLF/rippled/pull/5042/graphs/tree.svg?width=650&height=150&src=pr&token=i2RPGI5xGF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF)](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF) ```diff @@ Coverage Diff @@ ## develop #5042 +/- ## ========================================= + Coverage 71.3% 71.3% +0.1% ========================================= Files 796 796 Lines 66989 66989 Branches 10890 10865 -25 ========================================= + Hits 47757 47792 +35 + Misses 19232 19197 -35 ``` | [Files](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF) | Coverage Δ | | |---|---|---| | [include/xrpl/basics/Buffer.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbasics%2FBuffer.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2Jhc2ljcy9CdWZmZXIuaA==) | `100.0% <100.0%> (ø)` | | | [include/xrpl/basics/SlabAllocator.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbasics%2FSlabAllocator.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2Jhc2ljcy9TbGFiQWxsb2NhdG9yLmg=) | `94.0% <100.0%> (ø)` | | | [include/xrpl/basics/Slice.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbasics%2FSlice.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2Jhc2ljcy9TbGljZS5o) | `96.4% <100.0%> (ø)` | | | [include/xrpl/basics/partitioned\_unordered\_map.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbasics%2Fpartitioned_unordered_map.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2Jhc2ljcy9wYXJ0aXRpb25lZF91bm9yZGVyZWRfbWFwLmg=) | `99.1% <100.0%> (ø)` | | | [include/xrpl/basics/random.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbasics%2Frandom.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2Jhc2ljcy9yYW5kb20uaA==) | `100.0% <100.0%> (ø)` | | | [include/xrpl/basics/spinlock.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbasics%2Fspinlock.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2Jhc2ljcy9zcGlubG9jay5o) | `91.7% <100.0%> (ø)` | | | [include/xrpl/beast/asio/io\_latency\_probe.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbeast%2Fasio%2Fio_latency_probe.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2JlYXN0L2FzaW8vaW9fbGF0ZW5jeV9wcm9iZS5o) | `96.2% <100.0%> (ø)` | | | [include/xrpl/beast/clock/manual\_clock.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbeast%2Fclock%2Fmanual_clock.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2JlYXN0L2Nsb2NrL21hbnVhbF9jbG9jay5o) | `100.0% <100.0%> (ø)` | | | [.../beast/container/detail/aged\_unordered\_container.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbeast%2Fcontainer%2Fdetail%2Faged_unordered_container.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2JlYXN0L2NvbnRhaW5lci9kZXRhaWwvYWdlZF91bm9yZGVyZWRfY29udGFpbmVyLmg=) | `96.1% <100.0%> (ø)` | | | [include/xrpl/beast/core/LexicalCast.h](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&filepath=include%2Fxrpl%2Fbeast%2Fcore%2FLexicalCast.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-aW5jbHVkZS94cnBsL2JlYXN0L2NvcmUvTGV4aWNhbENhc3QuaA==) | `92.5% <100.0%> (ø)` | | | ... and [235 more](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF) | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/XRPLF/rippled/pull/5042/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF) [![Impacted file tree graph](https://app.codecov.io/gh/XRPLF/rippled/pull/5042/graphs/tree.svg?width=650&height=150&src=pr&token=i2RPGI5xGF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF)](https://app.codecov.io/gh/XRPLF/rippled/pull/5042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF)
Bronek commented 2 weeks ago

The choice of cmake option name voidstar comes from the reference to libvoidstar.so in the implementation of the Antithesis instrumentation - which is inside external/antithesis-sdk/antithesis_instrumentation.h file. I am open to replacing it with something else, e.g. instrumentation.

Bronek commented 2 days ago

TODO: Alter the consensus threshold to 80% (only when voidstar enabled), so we can test the system with 6 validators only.

intelliot commented 2 days ago

6 validators is a good start and should yield useful results.

But just curious, how difficult would it be to later scale up the test to 35 (or more) validators?

(This would make the testing even more realistic and predict what could happen in the future if more validators are added)