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

Remove public get_node_state() API #3552

Merged
merged 25 commits into from
Feb 22, 2022

Conversation

eddyashton
Copy link
Member

@eddyashton eddyashton commented Feb 15, 2022

Explanation from #2428:

We currently expose this to apps, even though it mostly contains methods explicitly for the node or gov frontends that we don't want apps to call. We should split this up into smaller interfaces, and pass each only where it is needed. This will probably mean a breaking change removing functionality from node_context.h, but this functionality should be unused. Relatedly I'm tempted to rewrite AbstractNodeContext as a more generic interface container/service discovery point, which would make it clearer that we can (and should!) shard the systems we register with it into their minimal atoms.

What this means in practice is that instead of giving a ccf::AbstractNodeState& to all frontends (including methods that apps definitely shouldn't be calling!), we pass some smaller, more-focussed interfaces to the node and gov frontends to do the things they need. This involves some extremely hard naming, suggestions welcome.

The actual implementation of these new interfaces is currently, for minimal impact, just redirecting to the existing NodeState monolith, but hopefully the separation of interfaces is an entry point to how this could be split up.

Opening as a draft for now, because I'd like to take a run at the last part of that: rather than a mix of access/ownership patterns, and increasingly messy constructors for the node and gov frontends, we could replace (without breaking changes!) the existing AbstractNodeContext with a more generic container/access point for subsystems, some private and some public. This isn't a necessary part of this change, but very related - if it's small enough to be glued on the end, I'll include it in this PR.

EDIT - This last bit is now done. It may be standalone readable in this commit: b4aaba9. This approach has major benefits in decoupling these subsystems, and making it trivial to make them public/private as required. For instance, it lets us also make the entire LFSAccess subsystem private. It is used by apps, if they use the Bucketed indexing strategy, but we don't really want to give them direct access. Since the fact it's used is entirely private (in the private implementation of that strategy), we can make the entire subsystem (even its abstract interface type) private and unavailable to apps.

src/enclave/enclave.h Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Feb 15, 2022

shatter_node_interface@42297 aka 20220222.19 vs main ewma over 20 builds from 41943 to 42293

Click to see table

main

build_id build_number tpcc_sgx_cft^ tpcc_sgx_cft_mem ls_sgx_cft^ ls_sgx_cft_mem ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem ls_js_sgx_cft^ ls_js_sgx_cft_mem ls_v8_sgx_cft^ ls_v8_sgx_cft_mem ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_full_v8_sgx_cft^ ls_full_v8_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem hist_sgx_cft^ RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
41943 20220216.1 6053.86 9.10992e+07 19977.7 1.63882e+07 5632.89 1.6126e+07 2524.46 1.0621e+07 1663.47 1.63975e+08 2166.73 1.00967e+07 1482.81 9.89635e+07 1969.38 9.31027e+06 17362.9 879418 1.40148e+06 9.40308e+06 3.58669e+07
41971 20220217.1 5961.12 9.00506e+07 19956.7 1.66503e+07 5662.83 1.56017e+07 2545.28 1.03588e+07 1655.01 1.62402e+08 2185.9 9.83456e+06 1487.66 9.87014e+07 1984.7 9.31027e+06 19455.6 908722 1.38303e+06 9.21688e+06 3.67019e+07
42010 20220217.15 6000.5 9.03128e+07 19673.9 1.69124e+07 5661.87 1.58639e+07 2400.44 1.03588e+07 1637.96 1.63451e+08 2230.07 9.57242e+06 1478.06 9.87014e+07 1966.5 9.31027e+06 17686.2 903869 1.38602e+06 9.30905e+06 3.63766e+07
42017 20220217.18 5901.08 9.13613e+07 19836 1.74367e+07 5518.43 1.56017e+07 2533.56 1.00967e+07 1638.9 1.62665e+08 2149.57 9.83456e+06 1450.01 9.87014e+07 1937.65 1.11453e+07 19972 901482 1.39044e+06 9.33876e+06 3.58669e+07
42040 20220217.26 5837.37 8.97885e+07 19762.9 1.66503e+07 5636.59 1.56017e+07 2538.87 1.0621e+07 1644.94 1.63189e+08 2163.74 1.00967e+07 1462.36 9.76528e+07 1964.24 9.83456e+06 20054.6 903595 1.37394e+06 9.28798e+06 3.57417e+07
42063 20220218.1 5836.31 8.97885e+07 19979.8 1.58639e+07 5654.85 1.58639e+07 2534.49 1.03588e+07 1652.36 1.645e+08 2161.46 9.83456e+06 1461.92 9.89635e+07 2018.57 8.78598e+06 21834.2 903032 1.37219e+06 9.22934e+06 3.58663e+07
42069 20220218.3 6118.04 9.16235e+07 18538.9 1.6126e+07 5573.33 1.58639e+07 2525.65 1.03588e+07 1656.49 1.64237e+08 2162.93 1.00967e+07 1425.53 9.87014e+07 1964.72 9.31027e+06 20305.9 906268 1.41857e+06 9.4074e+06 3.54939e+07
42075 20220218.5 5645.07 9.05749e+07 19205.9 1.66503e+07 5589.19 1.56017e+07 2531.81 1.0621e+07 1635.21 1.61878e+08 2160.44 1.03588e+07 1467.45 9.87014e+07 1968.46 9.31027e+06 18034.8 922557 1.38107e+06 9.4074e+06 3.64413e+07
42089 20220218.11 5970.53 9.10992e+07 19748.5 1.63882e+07 5613.78 1.58639e+07 2526.78 1.08831e+07 1620.27 1.63975e+08 2114.89 9.83456e+06 1422.61 9.76528e+07 1907.5 9.31027e+06 18943.2 910096 1.38537e+06 9.25855e+06 3.57417e+07
42094 20220218.13 5968.92 9.00506e+07 20004.6 1.6126e+07 5685.72 1.56017e+07 2542.61 1.0621e+07 1659.39 1.61354e+08 2167.73 1.00967e+07 1477.41 9.92257e+07 1972.93 9.04813e+06 19940.9 910262 1.37829e+06 9.20445e+06 3.58036e+07
42121 20220218.24 5867.23 9.00506e+07 19773.3 1.66503e+07 5581.76 1.56017e+07 2542.89 1.03588e+07 1629.23 1.645e+08 2164.03 1.00967e+07 1479.84 9.84392e+07 1968.76 9.04813e+06 17943.9 893929 1.39395e+06 9.39445e+06 3.55556e+07
42144 20220218.32 5924.88 8.97885e+07 19749.4 1.69124e+07 5693.79 1.58639e+07 2523.42 1.0621e+07 1619.45 1.63975e+08 2165.48 1.14074e+07 1460.44 9.89635e+07 1938.67 9.57242e+06 19984.8 907952 1.38377e+06 9.21265e+06 3.58663e+07
42175 20220221.2 6075.56 9.13613e+07 19781 1.63882e+07 5494.48 1.56017e+07 2529.54 1.0621e+07 1624.12 1.61616e+08 2119.01 9.83456e+06 1475.48 9.84392e+07 1971.31 9.31027e+06 18140.9 902755 1.37902e+06 9.4334e+06 3.57417e+07
42191 20220221.7 6051.75 9.03128e+07 20063.8 1.69124e+07 5638.91 1.56017e+07 2540.21 1.08831e+07 1661.68 1.61354e+08 2182.64 9.83456e+06 1491.37 9.84392e+07 1943.5 9.57242e+06 17974.1 894982 1.38284e+06 9.27108e+06 3.56174e+07
42211 20220221.14 5930.94 9.13613e+07 19594.8 1.63882e+07 5652.28 1.56017e+07 2425.32 1.03588e+07 1612.61 1.63975e+08 2158.03 1.03588e+07 1473.15 9.84392e+07 2015 8.78598e+06 19769.4 879795 1.38154e+06 9.26269e+06 3.54939e+07
42229 20220221.20 5790.78 9.10992e+07 19795.7 1.6126e+07 5669.65 1.56017e+07 2402.08 1.0621e+07 1574.69 1.63713e+08 2159.76 1.32424e+07 1464.57 9.87014e+07 1926.65 9.57242e+06 17878.3 880893 1.34976e+06 9.19615e+06 3.5249e+07
42256 20220222.2 6017.97 9.18856e+07 19773.7 1.69124e+07 5594.56 1.56017e+07 2533.2 1.0621e+07 1650.07 1.64237e+08 2167.91 1.00967e+07 1474.53 9.87014e+07 1971.99 9.57242e+06 20985.9 898634 1.37634e+06 9.33876e+06 3.63766e+07
42274 20220222.10 5909.34 9.03128e+07 19948.7 1.69124e+07 5482.21 1.58639e+07 2540.55 1.0621e+07 1624.27 1.61616e+08 2168.01 9.83456e+06 1458.42 9.73907e+07 1812.84 1.0621e+07 20640.9 878213 1.37256e+06 9.29215e+06 3.54933e+07
42288 20220222.16 5744.88 9.05749e+07 19615.6 1.66503e+07 5621.54 1.58639e+07 2535.8 1.00967e+07 1610.04 1.64237e+08 2155.18 9.83456e+06 1393.29 9.87014e+07 1921.31 9.31027e+06 17777.5 913585 1.38218e+06 9.25432e+06 3.56794e+07
42293 20220222.18 5906.28 9.03128e+07 19469.5 1.69124e+07 5618.43 1.56017e+07 2552.77 1.00967e+07 1622.7 1.63975e+08 2200.94 9.31027e+06 1460.63 9.87014e+07 1971.63 9.31027e+06 19807.6 903670 1.39547e+06 9.39876e+06 3.58036e+07

shatter_node_interface

build_id build_number tpcc_sgx_cft^ tpcc_sgx_cft_mem ls_sgx_cft^ ls_sgx_cft_mem ls_jwt_sgx_cft^ ls_jwt_sgx_cft_mem ls_js_sgx_cft^ ls_js_sgx_cft_mem ls_v8_sgx_cft^ ls_v8_sgx_cft_mem ls_full_js_sgx_cft^ ls_full_js_sgx_cft_mem ls_full_v8_sgx_cft^ ls_full_v8_sgx_cft_mem ls_js_jwt_sgx_cft^ ls_js_jwt_sgx_cft_mem hist_sgx_cft^ RB put (/s)^ CHAMP put (/s)^ RB get (/s)^ CHAMP get (/s)^
41881 20220215.36 5898.18 9.08371e+07 19838.4 1.66503e+07 5691.69 1.56017e+07 2532.11 1.00967e+07 1663.05 1.63189e+08 2157.59 1.03588e+07 1476.59 9.84392e+07 1978.81 1.14074e+07 18075.2 871446 1.37958e+06 8.97844e+06 3.53713e+07
42195 20220221.8 5881.29 9.21478e+07 19643.2 1.69124e+07 5658.97 1.58639e+07 2544.76 1.03588e+07 1610.53 1.63713e+08 2164.48 9.83456e+06 1456.3 9.84392e+07 1920.04 9.31027e+06 17888.1 906431 1.3756e+06 9.21688e+06 3.57417e+07
42262 20220222.5 5872.75 9.05749e+07 19725.8 1.71746e+07 5617.2 1.56017e+07 2539.25 1.0621e+07 1634.4 1.63975e+08 2160.18 1.00967e+07 1465.46 9.87014e+07 1962.57 8.78598e+06 19130.7 926815 1.40929e+06 9.40304e+06 3.58042e+07
42285 20220222.14 6010.68 9.08371e+07 19842.9 1.74367e+07 5682.66 1.58639e+07 2537.86 1.27181e+07 1662.12 1.63975e+08 2182.4 1.03588e+07 1481.64 9.89635e+07 1976.16 9.04813e+06 17917.8 907875 1.38228e+06 9.46387e+06 3.51286e+07
42297 20220222.19 5972.16 9.00506e+07 19881.1 1.69124e+07 5661.09 1.56017e+07 2527.75 1.03588e+07 1664.68 1.63189e+08 2171.23 9.83456e+06 1491.53 9.81771e+07 1982.38 9.31027e+06 22225.1 898116 1.37892e+06 9.26265e+06 3.58663e+07

images

@eddyashton eddyashton marked this pull request as ready for review February 15, 2022 16:22
@eddyashton eddyashton requested a review from a team February 15, 2022 16:22
@eddyashton eddyashton merged commit 006e911 into microsoft:main Feb 22, 2022
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.

2 participants