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

feat(pd): add app_version checks in local storage #4918

Closed
wants to merge 1 commit into from

Conversation

conorsch
Copy link
Contributor

Describe your changes

Initial spike on adding support for APP_VERSION to pd start and pd migrate. Opening early to facilitate discussion and collaboration.

Issue ticket number and link

Towards #4793.

Checklist before requesting a review

  • I have added guiding text to explain how a reviewer should test these changes.

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    REPLACE THIS TEXT WITH RATIONALE (CAN BE BRIEF)

/// Wrapper struct representing the `APP_VERSION`, intended
/// for custom TryInto/TryFrom implementations.
#[derive(Debug)]
struct AppVersion(u64);
Copy link
Member

@erwanor erwanor Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we write a proto to storage we can dispense with the wrapper type and custom serialization. In general, we should try to avoid doing custom serialization and using the _raw methods, preferring extension traits like StateWriteProto.

Here's an example of writing a primitive type to NV storage: https://github.com/penumbra-zone/penumbra/blob/main/crates/core/component/governance/src/component/view.rs#L978

// use penumbra_app::app::StateReadExt as _;
use penumbra_app::APP_VERSION;

const APP_VERSION_KEY: &str = "app_version";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this with the other application state keys

@cronokirby
Copy link
Contributor

closing in favor of #4919

@cronokirby cronokirby closed this Nov 13, 2024
@conorsch conorsch mentioned this pull request Nov 13, 2024
2 tasks
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