Skip to content

Add golden transactions test to the local transaction submission server #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 25, 2023

Conversation

dnadales
Copy link
Member

This PR introduces a test to detect errors in the Ledger code, like this one, early on.

Other changes include:

  • Addition of a new test library to mock a mempool.
  • Addition of a module to elaborate a ProtocolInfo for testing purposes. This protocol info is used when opening a Cardano mempool.

@dnadales dnadales requested a review from a team as a code owner July 11, 2023 14:52
@dnadales dnadales force-pushed the 137-add-golden-txs-test-for-localTxSubmissionServer branch from 446a135 to ff38371 Compare July 11, 2023 14:54
@jorisdral jorisdral requested a review from a team July 11, 2023 16:28
dnadales added 5 commits July 13, 2023 17:04
This commit creates the `mempool-test-utils` library, which at the
moment contains only one module. The benchmarks use this library, and we
plan on using it in other mempool tests.
... that can be used in the elaboration of `ProtocolInfo` types for
testing purposes.
@dnadales dnadales force-pushed the 137-add-golden-txs-test-for-localTxSubmissionServer branch from 68edc41 to c311626 Compare July 13, 2023 15:23
@dnadales
Copy link
Member Author

For reference: sample Cardano ThreadNet test output:

  • Before refactoring
  Cardano ThreadNet
    simple convergence: OK (80.34s)
      +++ OK, passed 40 tests.
      
      Observed forge during a non-overlay Shelley slot (40 in total):
      85% False
      15% True
      
      ReachesEra2 label (40 in total):
      98% pv Enabled, slots1 Enabled, slots2 Required, blocks2 True
       2% pv Enabled, slots1 Blocked, slots2 Optional, blocks2 False
      
      average #txs/block (40 in total):
      100% R_Btwn (0.0,1.0)
      
      final intersection depth, Byron, count (1 in total):
      100% 0 blocks
      
      final intersection depth, Byron, k diff (1 in total):
      100% k - 10 blocks
      
      final intersection depth, Byron, k frac (1 in total):
      100% k * 0.0 blocks
      
      final intersection depth, Shelley, count (39 in total):
      100% 0 blocks
      
      final intersection depth, Shelley, k diff (39 in total):
      44% k - 8 blocks
      38% k - 9 blocks
      18% k - 10 blocks
      
      final intersection depth, Shelley, k frac (39 in total):
      100% k * 0.0 blocks
      
      floor(4 * lastJoinSlot / numSlots) (40 in total):
      100% Just 0
      
      involves >=1 re-delegation (40 in total):
      100% False
      
      k (40 in total):
      42% 8
      38% 9
      20% 10
      
      minimumDegreeNodeTopology (40 in total):
      50% Just 2
      40% Just 1
       8% Just 3
       2% Just 4
      
      partition duration, count (40 in total):
      15% 6 slots
      10% 11 slots
      10% 5 slots
      10% 7 slots
       8% 12 slots
       8% 3 slots
       8% 4 slots
       8% 8 slots
       8% 9 slots
       5% 1 slots
       5% 15 slots
       2% 0 slots
       2% 13 slots
       2% 14 slots
      
      partition duration, k frac (40 in total):
      18% k * 0.8 slots
      12% k * 0.6 slots
      12% k * 1.0 slots
      10% k * 1.4 slots
      10% k * 1.5 slots
       8% k * 0.4 slots
       8% k * 1.2 slots
       5% k * 0.1 slots
       5% k * 0.3 slots
       5% k * 0.7 slots
       2% k * 0.0 slots
       2% k * 0.5 slots
       2% k * 0.9 slots
      
      partition in or abuts era (First era, Second era) (40 in total):
      45% (True,True)
      30% (True,False)
      22% (False,True)
       2% (False,False)
      
      shortestLength (k = 10) (8 in total):
      88% ≈ (k = 10) << 138
      12% ≈ (k = 10) << 522
      
      shortestLength (k = 8) (17 in total):
      82% ≈ (k = 8) << 136
      12% ≈ (k = 8) << 264
       6% ≈ (k = 8) << 520
      
      shortestLength (k = 9) (15 in total):
      80% ≈ (k = 9) << 137
      13% ≈ (k = 9) << 521
       7% ≈ (k = 9) << 265     
  • After refactoring:
cardano
  Cardano ThreadNet
    simple convergence: OK (101.23s)
      +++ OK, passed 40 tests.

      Observed forge during a non-overlay Shelley slot (40 in total):
      82% False
      18% True

      ReachesEra2 label (40 in total):
      88% pv Enabled, slots1 Enabled, slots2 Required, blocks2 True
      12% pv Enabled, slots1 Blocked, slots2 Optional, blocks2 False

      average #txs/block (40 in total):
      100% R_Btwn (0.0,1.0)

      final intersection depth, Byron, count (5 in total):
      80% 0 blocks
      20% 9 blocks

      final intersection depth, Byron, k diff (5 in total):
      40% k - 9 blocks
      20% k - 1 blocks
      20% k - 10 blocks
      20% k - 8 blocks

      final intersection depth, Byron, k frac (5 in total):
      80% k * 0.0 blocks
      20% k * 0.9 blocks

      final intersection depth, Shelley, count (35 in total):
      100% 0 blocks

      final intersection depth, Shelley, k diff (35 in total):
      40% k - 10 blocks
      34% k - 9 blocks
      26% k - 8 blocks

      final intersection depth, Shelley, k frac (35 in total):
      100% k * 0.0 blocks

      floor(4 * lastJoinSlot / numSlots) (40 in total):
      100% Just 0

      involves >=1 re-delegation (40 in total):
      100% False

      k (40 in total):
      40% 10
      35% 9
      25% 8

      minimumDegreeNodeTopology (40 in total):
      57% Just 1
      38% Just 2
       5% Just 3

      partition duration, count (40 in total):
      10% 1 slots
      10% 6 slots
       8% 0 slots
       8% 10 slots
       8% 16 slots
       8% 3 slots
       8% 5 slots
       8% 7 slots
       8% 8 slots
       5% 12 slots
       5% 13 slots
       5% 14 slots
       5% 17 slots
       5% 4 slots
       2% 15 slots

      partition duration, k frac (40 in total):
      12% k * 0.8 slots
      10% k * 0.1 slots
       8% k * 0.0 slots
       8% k * 0.4 slots
       8% k * 0.7 slots
       8% k * 1.6 slots
       8% k * 1.8 slots
       5% k * 0.3 slots
       5% k * 0.6 slots
       5% k * 0.9 slots
       5% k * 1.1 slots
       5% k * 1.2 slots
       5% k * 1.5 slots
       5% k * 1.7 slots
       2% k * 0.5 slots
       2% k * 1.4 slots

      partition in or abuts era (First era, Second era) (40 in total):
      35% (True,True)
      30% (True,False)
      28% (False,True)
       8% (False,False)

      shortestLength (k = 10) (16 in total):
      62% ≈ (k = 10) << 138
      31% ≈ (k = 10) << 266
       6% ≈ (k = 10) << 522

      shortestLength (k = 8) (10 in total):
      60% ≈ (k = 8) << 136
      30% ≈ (k = 8) << 264
      10% ≈ (k = 8) << 72

      shortestLength (k = 9) (14 in total):
      79% ≈ (k = 9) << 137
      21% ≈ (k = 9) << 265

      updates (40 in total):

@jorisdral jorisdral force-pushed the 137-add-golden-txs-test-for-localTxSubmissionServer branch from 462d9b7 to 31a2529 Compare July 18, 2023 13:14
@jorisdral jorisdral added this pull request to the merge queue Jul 25, 2023
Merged via the queue into main with commit 242fd7f Jul 25, 2023
@jorisdral jorisdral deleted the 137-add-golden-txs-test-for-localTxSubmissionServer branch July 25, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants