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

app crate doesn't keep component code behind feature flag #4885

Closed
hdevalence opened this issue Oct 7, 2024 · 3 comments · Fixed by #4892
Closed

app crate doesn't keep component code behind feature flag #4885

hdevalence opened this issue Oct 7, 2024 · 3 comments · Fixed by #4892
Assignees
Labels
E-hard Effort: hard
Milestone

Comments

@hdevalence
Copy link
Member

Describe the bug
Other components keep the state machine part of the code behind a feature flag. The app crate doesn't. This means that any downstream consumer of the rust view server has to pull in and build the entire full node state machine and rocksdb.

@github-actions github-actions bot added the needs-refinement unclear, incomplete, or stub issue that needs work label Oct 7, 2024
@cronokirby
Copy link
Contributor

Something this made me think of: what if moved the StateRead / StateWrite traits to another crate ; this would allow a lot of components to just depend on the traits, and not even pull in cnidarium itself

@aubrika aubrika added this to the Sprint 14 milestone Oct 7, 2024
@aubrika aubrika added this to Penumbra Oct 7, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Penumbra Oct 7, 2024
@aubrika aubrika removed the needs-refinement unclear, incomplete, or stub issue that needs work label Oct 7, 2024
@hdevalence
Copy link
Member Author

That could work, but I'm also not sure we'd need to do it, since AFAICT there's not a need to model state access in client code, right?

@cronokirby cronokirby self-assigned this Oct 8, 2024
@cronokirby cronokirby moved this from Backlog to In progress in Penumbra Oct 8, 2024
@cronokirby cronokirby added E-easy Effort: Easy E-hard Effort: hard and removed E-easy Effort: Easy labels Oct 8, 2024
cronokirby added a commit that referenced this issue Oct 8, 2024
This required:
- feature gating `cnidarium` in `penumbra-app`
- removing the stateless transaction check in the view crate
- removing the ceremony contribution command from `pcli`

Closes #4885
@conorsch
Copy link
Contributor

conorsch commented Oct 9, 2024

While working on this, @cronokirby discovered rust-lang/cargo#8157, which describes how feature selection can vary in cargo workspaces. For example:

  1. cargo build --release --bin pcli will first build all workspace packages, selecting features as required to satisfy all bin targets, then selectively build only for pcli
  2. cargo build --release --package pcli will build only the minimal set of features required by pcli

We've previously been using only the former, but we should probably prefer the latter in most places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-hard Effort: hard
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants