Skip to content
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

Basic consistency TV app and client #6116

Merged
merged 11 commits into from
Apr 11, 2024

Conversation

achamayou
Copy link
Member

@achamayou achamayou commented Apr 9, 2024

Successor to #5727, but aimed at trace validating the consistency spec. This adds:

  1. A tweak on the basic app, which always forwards (to meet the assumption made by the consistency spec)
  2. A small client (tvc.py) that runs basic read and writes transactions as modeled by the consistency spec, and produces TLA+-friendly ndjson lines
  3. An end to end test that starts a network, runs the tvc, and causes an election in the middle. The trace is written to consistency_trace.ndjson:

Samples extract, to reproduce locally, run ./tests.sh -VV -R consistency_trace_validation:

{"action": "RwTxRequestAction", "type": "RwTxRequest", "tx": 0}
{"action": "RwTxResponseAction", "type": "RwTxRequest", "tx": 0, "tx_id": [2, 29]}
{"action": "StatusCommittedResponseAction", "type": "TxStatusReceived", "tx_id": [2, 29], "status": "CommittedStatus"}
{"action": "RwTxRequestAction", "type": "RwTxRequest", "tx": 1}
{"action": "RwTxResponseAction", "type": "RwTxRequest", "tx": 1, "tx_id": [2, 31]}
{"action": "StatusCommittedResponseAction", "type": "TxStatusReceived", "tx_id": [2, 31], "status": "CommittedStatus"}
{"action": "RoTxRequestAction", "type": "RoTxRequest", "tx": 2}
{"action": "RoTxResponseAction", "type": "RoTxRequest", "tx": 2, "tx_id": [2, 33]}
{"action": "RwTxRequestAction", "type": "RwTxRequest", "tx": 3}
{"action": "RwTxResponseAction", "type": "RwTxRequest", "tx": 3, "tx_id": [2, 34]}
{"action": "StatusInvalidResponseAction", "type": "TxStatusReceived", "tx_id": [2, 34], "status": "InvalidStatus"}
{"action": "RwTxRequestAction", "type": "RwTxRequest", "tx": 4}
{"action": "RwTxResponseAction", "type": "RwTxRequest", "tx": 4, "tx_id": [3, 35]}
{"action": "StatusCommittedResponseAction", "type": "TxStatusReceived", "tx_id": [3, 35], "status": "CommittedStatus"}
{"action": "RwTxRequestAction", "type": "RwTxRequest", "tx": 5}
{"action": "RwTxResponseAction", "type": "RwTxRequest", "tx": 5, "tx_id": [3, 37]}
{"action": "StatusCommittedResponseAction", "type": "TxStatusReceived", "tx_id": [3, 37], "status": "CommittedStatus"}
{"action": "RoTxRequestAction", "type": "RoTxRequest", "tx": 6}
{"action": "RoTxResponseAction", "type": "RoTxRequest", "tx": 6, "tx_id": [3, 38]}

It's also possible to run the tvc against a manually started sandbox, as described in the docstring.

This should already be usable for trace validation as is, but a good additional change would be to use the partition module to cause more failed transactions than can be done with the lengthened signature period. This will require some CI changes to run as part of the partition test (i.e. elevated).

@achamayou achamayou requested a review from a team as a code owner April 9, 2024 15:25
@ccf-bot
Copy link
Collaborator

ccf-bot commented Apr 9, 2024

basic_tv_app_and_client@83559 aka 20240411.7 vs main ewma over 20 builds from 83291 to 83548

Click to see table

main

build_id build_number pi_basic_mt_sgx_cft^ pi_basic_mt_sgx_cft_mem Commit latency factor tpcc_virtual_cft^ ls_virtual_cft^ pi_ls_virtual_cft^ pi_basic_virtual_cft^ tpcc_sgx_cft^ tpcc_sgx_cft_mem pi_basic_js_virtual_cft^ ls_jwt_virtual_cft^ pi_ls_jwt_virtual_cft^ ls_js_virtual_cft^ ls_full_js_virtual_cft^ ls_sgx_cft^ ls_sgx_cft_mem pi_ls_sgx_cft^ pi_ls_sgx_cft_mem ls_js_jwt_virtual_cft^ pi_basic_sgx_cft^ pi_basic_sgx_cft_mem pi_basic_mt_virtual_cft^ pi_basic_js_sgx_cft^ pi_basic_js_sgx_cft_mem hist_sgx_cft^ ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem pi_ls_jwt_sgx_cft^ pi_ls_jwt_sgx_cft_mem ls_js_sgx_cft^ ls_js_sgx_cft_mem ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem KV ser (/s)^ KV deser (/s)^ KV snap ser (/s)^ KV snap deser (/s)^ RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^ tlc_sim_traces tlc_sim_levelmean
83291 20240327.17 27965.4 2.30851e+07 0.780743 17332.2 53058 56416.2 60754.3 5493.01 8.59996e+07 4379.8 20977.1 21629.1 17657.1 17397.7 13796.8 1.88908e+07 13897.8 1.05021e+07 11624.2 15335.9 1.46964e+07 69992.7 1364.5 1.25993e+07 43762.9 6792.35 1.88908e+07 6895.4 6.30784e+06 5794.51 1.67936e+07 5466.11 1.67936e+07 3947.89 1.67936e+07 1.04987e+06 1.17151e+06 8045.56 1402.23 840550 1.18589e+06 8.13253e+06 3.14106e+07 30482 379
83300 20240327.19 27752.7 2.51822e+07 0.78619 17403.3 53596 56359.6 61298.1 5601.13 8.59996e+07 4444.4 20441.8 18354.3 17343.8 17119.5 13877.8 1.88908e+07 13835.4 1.05021e+07 11794.1 15236 1.46964e+07 92055.9 1354.1 1.25993e+07 47146.2 6733.56 1.88908e+07 6832.6 6.30784e+06 5790.36 1.67936e+07 5464.9 1.67936e+07 3984.87 1.67936e+07 1.0304e+06 1.14299e+06 7612.78 1398.2 833842 1.18002e+06 8.13325e+06 3.07332e+07 27041 380
83317 20240328.3 27733.5 2.30851e+07 0.781793 17388.7 52857.5 56362.5 60920.5 5593.45 8.59996e+07 4426.5 20677.7 22236.1 17513.6 17303.1 13968.1 1.88908e+07 13941.3 1.05021e+07 11815.9 15460.8 1.46964e+07 92447.1 1366.1 1.25993e+07 41216.7 6837.09 1.88908e+07 6883.6 6.30784e+06 5767.72 1.67936e+07 5473.13 1.67936e+07 3986.74 1.67936e+07 1.02375e+06 1.15247e+06 7902.64 1401.75 836907 1.1724e+06 8.17343e+06 3.09071e+07 30852 373
83322 20240328.4 27662.9 2.30851e+07 0.792305 16882.2 52875.1 56040 60963.2 5604.88 8.59996e+07 4434.1 20705.4 21429.8 17669.9 17210.3 14011.9 1.88908e+07 14027 1.05021e+07 11824.2 15518.3 1.46964e+07 75425.6 1370 1.25993e+07 45503.1 6814.65 1.88908e+07 6892.1 6.30784e+06 5806.46 1.67936e+07 5469.3 1.67936e+07 3994.37 1.67936e+07 1.02239e+06 1.12271e+06 7816.22 1403.32 839379 1.18377e+06 8.12911e+06 3.21739e+07 31082 374
83333 20240328.7 27967 2.51822e+07 0.800891 17450.2 52852.6 56292.7 60351.4 5537.34 8.59996e+07 4391.2 21070.3 21664.2 17626.2 17244 13854.8 1.88908e+07 13857 1.05021e+07 11797 15312.3 1.46964e+07 69549.7 1361.7 1.25993e+07 47085.4 6810.45 1.88908e+07 6856.5 6.30784e+06 5755.31 1.67936e+07 5444.47 1.67936e+07 3964.83 1.67936e+07 1.06213e+06 1.12689e+06 7852.45 1400.39 826620 1.17709e+06 8.14372e+06 3.08689e+07 31211 377
83347 20240329.3 27786.3 2.51822e+07 0.815625 17379.3 53129.6 56545.7 61858.1 5532.73 8.59996e+07 4448.5 17456.9 21924.5 20755.7 17266.3 13926.1 1.88908e+07 13952.6 1.05021e+07 11664.1 15466.9 1.46964e+07 95218.4 1369.4 1.25993e+07 45422.7 6815.13 1.88908e+07 6883.3 6.30784e+06 5768.71 1.67936e+07 5470.38 1.67936e+07 3971.29 1.67936e+07 1.01533e+06 1.14051e+06 8211.01 1403.85 831719 1.18117e+06 8.14936e+06 3.08067e+07 33241 382
83355 20240329.4 27850.2 2.30851e+07 0.832453 17319.5 52968.6 56630 61516.3 5525.24 8.59996e+07 4368.6 20630.8 21813.1 17404.7 17655.4 13838.4 1.88908e+07 13900.3 1.05021e+07 11681.6 15318.5 1.46964e+07 79747.7 1355.5 1.25993e+07 40584.2 7169.56 1.67936e+07 6933.4 6.30784e+06 5797.29 1.67936e+07 5444.59 1.67936e+07 3989.82 1.67936e+07 1.0337e+06 1.14692e+06 7583.15 1399.01 828174 1.17976e+06 8.15199e+06 3.19645e+07 30859 378
83365 20240401.3 27776.4 2.51822e+07 0.810359 17195.5 52968 56448.1 60082.8 5627.14 8.59996e+07 4417.7 20796.1 21019.9 17474.3 17492.9 13873.6 1.88908e+07 13923.8 1.05021e+07 11727.7 15440.9 1.46964e+07 68259.9 1361.7 1.25993e+07 43823.7 6842.56 1.88908e+07 6960.2 6.30784e+06 5810.32 1.67936e+07 5476.46 1.67936e+07 3997.84 1.67936e+07 1.02051e+06 1.12499e+06 7750.24 1401.2 834581 1.17926e+06 8.14907e+06 3.2663e+07 30754 377
83376 20240402.3 27361.3 2.30851e+07 0.799042 17267.7 52955.6 56862.8 59519.2 5555.59 8.59996e+07 4425.2 20973.4 21697.2 17487.8 17373.7 13917 1.88908e+07 13907.4 1.05021e+07 11609.4 15383.4 1.46964e+07 83080.8 1360.3 1.25993e+07 42110.8 6825.59 1.88908e+07 6927.1 6.30784e+06 5807.65 1.67936e+07 5487.31 1.67936e+07 4008.13 1.67936e+07 1.01843e+06 1.15929e+06 7701.94 1408.13 832051 1.18464e+06 8.12041e+06 3.08708e+07 29810 383
83387 20240402.7 27679.7 2.51822e+07 0.818038 17383.2 52921.2 56391.1 61114.2 5579.52 8.59996e+07 4398.2 20676 20801.7 17423.3 17097.1 13822 1.88908e+07 13861.3 1.05021e+07 11687.5 15353.6 1.46964e+07 88136.4 1366.2 1.25993e+07 46105.2 6873.64 1.88908e+07 6885.7 6.30784e+06 5799.29 1.67936e+07 5470.11 1.67936e+07 3964.49 1.67936e+07 1.04178e+06 1.16239e+06 7986.02 1403.94 828227 1.17352e+06 8.15313e+06 3.17092e+07 29554 372
83394 20240403.3 27512.2 2.51822e+07 0.795653 17334.1 53089.2 56972.9 61037.5 5570.57 8.59996e+07 4413.7 20606.5 20959.1 17670.3 17377.7 13917.8 1.88908e+07 13938.1 1.05021e+07 11765.2 15484.8 1.46964e+07 69002.8 1369.5 1.25993e+07 44785.5 7186.56 1.67936e+07 6957.1 6.30784e+06 5802.37 1.67936e+07 5479.51 1.67936e+07 3995.27 1.67936e+07 1.03455e+06 1.17966e+06 7801.67 1406.73 833321 1.18091e+06 8.14314e+06 3.07166e+07 30720 376
83408 20240404.3 27743 2.30851e+07 0.836361 17318.8 52945.7 56267 62433.5 5617.23 8.59996e+07 4456.1 21107 21717.9 17490.4 17251.1 13941.1 1.88908e+07 14037.1 1.05021e+07 11722.5 15562.4 1.46964e+07 96525.6 1363.3 1.25993e+07 39727.3 6903.33 1.88908e+07 6887.4 6.30784e+06 5799.01 1.67936e+07 5463.66 1.67936e+07 3987.88 1.67936e+07 1.02987e+06 1.13404e+06 7745.13 1402.62 831256 1.17788e+06 8.13557e+06 3.07554e+07 30391 379
83419 20240404.5 27958.6 2.30851e+07 0.821804 17256.1 52901.3 56589.6 61906 5577.86 8.59996e+07 4403.3 20590.2 21153.3 17442.8 17106.5 13973.3 1.67936e+07 13977.4 1.05021e+07 11674.1 15377.4 1.46964e+07 69081.1 1365.9 1.25993e+07 45979 6825.56 1.88908e+07 6917.7 6.30784e+06 5803.51 1.67936e+07 5458.29 1.67936e+07 3801.64 1.67936e+07 1.00847e+06 1.12562e+06 7474.96 1398.42 845103 1.17785e+06 8.13509e+06 3.11663e+07 32428 382
83433 20240405.2 27805.9 2.30851e+07 0.795203 17432.5 53095.5 55527.2 61761.9 5610.51 8.59996e+07 4429 20818 21148.8 17215.2 17096.2 13933.8 1.67936e+07 14008.4 1.05021e+07 11509 15466.9 1.25993e+07 73717.7 1360.5 1.25993e+07 44641.6 6820.03 1.88908e+07 6932.1 6.30784e+06 5755.14 1.67936e+07 5461.46 1.67936e+07 3987.78 1.67936e+07 1.0175e+06 1.18779e+06 8272.95 1408.52 837389 1.1752e+06 8.15196e+06 3.06927e+07 30697 373
83446 20240408.2 27601.3 2.30851e+07 0.80954 17447.2 53117.1 55958.8 61153.3 5516.27 8.59996e+07 4432.1 20761.9 20873.8 17457.9 17374.6 13896.2 1.88908e+07 13970.4 1.05021e+07 11529.9 15383.1 1.46964e+07 91917.1 1363 1.25993e+07 47154.6 6825.46 1.88908e+07 6988.6 6.30784e+06 5759.72 1.67936e+07 5425.1 1.67936e+07 3992.3 1.67936e+07 1.02533e+06 1.10779e+06 7833.59 1393.37 813419 1.18481e+06 8.14959e+06 3.15227e+07 31171 383
83465 20240409.3 27515.3 2.30851e+07 0.819344 17275.2 53026.3 56413.7 62184.1 5595.61 8.59996e+07 4436.4 20560.2 21632.4 17479.3 17314.9 13937.9 1.67936e+07 13959.8 1.05021e+07 11682.1 15443.9 1.46964e+07 93716.1 1360.5 1.25993e+07 45530.7 6888.84 1.88908e+07 7084.5 6.30784e+06 5785.52 1.67936e+07 5456.19 1.67936e+07 3964.71 1.67936e+07 1.05053e+06 1.13559e+06 7700.05 1398.41 839459 1.18433e+06 8.15345e+06 3.08211e+07 31097 380
83491 20240409.11 27923.2 2.51822e+07 0.788667 17216.4 52730.3 57049 60114 5577.9 8.59996e+07 4376.3 20863.8 22315 17644.1 17141.5 13915.5 1.88908e+07 13948.1 1.05021e+07 11680.7 15257.7 1.46964e+07 95032.1 1350.5 1.25993e+07 43435.3 6833.2 1.88908e+07 6936.2 6.30784e+06 5782.62 1.67936e+07 5459.02 1.67936e+07 3807.6 1.67936e+07 1.01225e+06 1.15969e+06 7776.73 1406.33 833597 1.17995e+06 8.15121e+06 3.15465e+07 29923 371
83516 20240410.3 27661 2.51822e+07 0.820327 17408.1 52988.5 55669.4 58564.1 5559.4 8.59996e+07 4341.5 20881.9 22172 17604.5 17131.6 13897 1.88908e+07 13983.7 1.05021e+07 11516.6 15330.8 1.46964e+07 77993.3 1365.5 1.05021e+07 46259.3 7191.21 1.67936e+07 6872.9 6.30784e+06 5784.58 1.67936e+07 5461.12 1.67936e+07 3974.35 1.67936e+07 1.04712e+06 1.11433e+06 7652.8 1399.18 829881 1.18481e+06 8.13531e+06 3.0748e+07 31688 378
83524 20240410.5 27560.8 2.51822e+07 0.802161 17232.4 52988.3 57020.7 60754 5566.3 8.59996e+07 4424.8 17578.5 21873.2 17603.5 17103.2 13947.6 1.67936e+07 14044.3 1.05021e+07 11561.1 15463.8 1.46964e+07 77062.9 1370.2 1.25993e+07 44620.9 7229.68 1.67936e+07 6998.4 6.30784e+06 5759.07 1.67936e+07 5469.21 1.67936e+07 3982.97 1.67936e+07 1.03918e+06 1.17661e+06 8224.64 1408.31 839904 1.17574e+06 8.13738e+06 3.08834e+07 31607 384
83548 20240411.2 27689.7 2.51822e+07 0.824138 17210.8 52940.3 56584.8 61285.2 5607.15 8.59996e+07 4401.1 20862.1 21969.8 17551.3 17283 13939.6 1.67936e+07 14071.7 1.05021e+07 11494.4 15436.3 1.25993e+07 66739 1366.1 1.25993e+07 43389.8 6841.5 1.88908e+07 6878.9 6.30784e+06 5790.47 1.67936e+07 5457.03 1.67936e+07 3958.92 1.67936e+07 1.04297e+06 1.1722e+06 7930.42 1400.58 836833 1.17803e+06 8.15017e+06 3.07651e+07 29736 377

basic_tv_app_and_client

build_id build_number Commit latency factor tpcc_sgx_cft^ tpcc_sgx_cft_mem pi_basic_mt_sgx_cft^ pi_basic_mt_sgx_cft_mem ls_sgx_cft^ ls_sgx_cft_mem pi_ls_sgx_cft^ pi_ls_sgx_cft_mem pi_basic_sgx_cft^ pi_basic_sgx_cft_mem pi_basic_js_sgx_cft^ pi_basic_js_sgx_cft_mem ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem pi_ls_jwt_sgx_cft^ pi_ls_jwt_sgx_cft_mem pi_basic_mt_virtual_cft^ ls_js_sgx_cft^ ls_js_sgx_cft_mem tpcc_virtual_cft^ ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_virtual_cft^ pi_ls_virtual_cft^ pi_basic_virtual_cft^ ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem pi_basic_js_virtual_cft^ ls_jwt_virtual_cft^ pi_ls_jwt_virtual_cft^ ls_js_virtual_cft^ ls_full_js_virtual_cft^ ls_js_jwt_virtual_cft^ hist_sgx_cft^ KV ser (/s)^ KV deser (/s)^ KV snap ser (/s)^ KV snap deser (/s)^ RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^ tlc_sim_traces tlc_sim_levelmean
83498 20240409.13 0.814347 5501.36 8.59996e+07 27800.8 2.51822e+07 13797.8 1.88908e+07 13896.8 1.05021e+07 15220 1.46964e+07 1345 1.25993e+07 6792.38 1.88908e+07 6856.1 6.30784e+06 86866.4 5798.21 1.67936e+07 17320.7 5437.4 1.67936e+07 52796.5 56623.9 61316.7 3817.68 1.67936e+07 4371.5 20997.1 21695.3 17995.7 17373.8 11533.6 47593.5 1.03402e+06 1.12108e+06 7689.77 1394.72 825435 1.17541e+06 8.15413e+06 3.1498e+07 31290 389
83499 20240409.14 0.852783 5621.01 8.59996e+07 27511.2 2.51822e+07 13953.2 1.88908e+07 14091.9 1.05021e+07 15466.5 1.46964e+07 1366.7 1.25993e+07 7205.2 1.67936e+07 6934.9 6.30784e+06 67907.4 5766.06 1.67936e+07 17394.4 5476.78 1.67936e+07 53146.3 56491.7 60888 3985.22 1.67936e+07 4405.6 21130.1 21409.2 17474.2 17242.3 11492.6 44040.5 1.06587e+06 1.14679e+06 7689.95 1394.09 837023 1.17905e+06 8.1237e+06 3.0724e+07 30100 382
83559 20240411.7 0.80243 5609.5 8.59996e+07 27506.3 2.30851e+07 13965.7 1.67936e+07 14060 1.05021e+07 15452.8 1.46964e+07 1367.6 1.25993e+07 7192.71 1.67936e+07 6931.5 6.30784e+06 81769.4 5781.52 1.67936e+07 17424.5 5423.65 1.67936e+07 53335 55785.2 60704.7 3978.32 1.67936e+07 4317.1 20964.4 21196.3 17611 17225.9 11516.1 46130.6 1.00452e+06 1.16537e+06 7850.21 1403.62 792464 1.18133e+06 8.13518e+06 3.10421e+07 31601 378

images

@lemmy lemmy added the tla TLA+ specifications label Apr 9, 2024
@achamayou achamayou enabled auto-merge (squash) April 11, 2024 08:50
@achamayou achamayou merged commit 1d094c5 into microsoft:main Apr 11, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tla TLA+ specifications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants