-
Notifications
You must be signed in to change notification settings - Fork 314
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
app: 🥞 dynamic application Components
#3740
Comments
So far this has been a non-goal. Components have to execute in order, and this design assumption cannot be easily changed. Making components dynamic would have to have some way of dynamically specifiying constraints on execution ordering, adding additional complexity. However, it's a little unclear what the upside would be. Why is it desirable to be able to punch out arbitrary subsets of the Penumbra application? Why don't we just test the whole thing, first? |
i am a little surprised to hear this! this seemed like a reasonable approach after our conversation in #3695, where you said:
we had a conversation after that where you pointed me towards #1664, which states that "we want to be able to write unit tests that check parts of the state machine in isolation." our app tests today do this by working directly with components like |
(following up to the above) ☝️ perhaps an unstated assumption here on my part is that this would not be about changing the application components in the "real" |
@hdevalence talked today and after some direct discussion, i agree this can be put aside for the time being. i'm going to mark this as a low priority and save it for later on in the broader in-memory consensus effort. |
after further thought, going to close this as unplanned work. |
penumbra_app::App
is a "bundle ofComponent
s". it should provide a way to dynamically define its constituent components. this, in tandem with an in-memory consensus engine feeding ABCI messages into theApp
, would allow us to easily test distinct parts of our state machine.🏢
App
todayas-is, the component stack is hard-coded, in blocks like this:
penumbra/crates/core/app/src/app/mod.rs
Lines 129 to 137 in 59cdd75
penumbra/crates/core/app/src/app/mod.rs
Lines 242 to 256 in 59cdd75
penumbra/crates/core/app/src/app/mod.rs
Lines 363 to 372 in 59cdd75
(...and so on...)
invoking these programmatically would help prevent bugs as we continue to maintain and extend
App
. for example, it's easy to miss that theSct
component is only invoked uponinit_chain
andbegin_block
. components should be consistently invoked by theApp
. (#3739)🧪 testing benefits
in #3588, we are building an in-memory mock consensus engine. as background, regarding our goals with testing, consider these excerpts from #1664:
as is, the unit tests in
penumbra-app
work with a different, specific subset of components, by hard-coding the calls to these hooks, like so:penumbra/crates/core/app/src/tests/swap_and_swap_claim.rs
Lines 82 to 85 in 59cdd75
in a sense, this is re-implementing the internals of
App
, which makes tests both more tedious to implement and more brittle to change over time.an interface to select components programmatically would allow test authors to connect a mock consensus engine to distinct state machine components, and generally write unit tests more effectively.
The text was updated successfully, but these errors were encountered: