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

[VID Upgrade] add version number to VID interfaces #4062

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

mrain
Copy link
Contributor

@mrain mrain commented Jan 20, 2025

Closes #4061

This PR:

This PR does not:

Key places to review:

@mrain mrain requested a review from ss-es January 20, 2025 21:22
@mrain mrain requested a review from bfish713 as a code owner January 20, 2025 21:22
@@ -262,6 +262,9 @@ impl Versions for TestVersions {
type Marketplace = StaticVersion<0, 3>;

type Epochs = StaticVersion<0, 4>;

// TODO(Chengyu): fill number here
type AVIDMUpgrade = StaticVersion<0, 0>;
Copy link
Contributor

Choose a reason for hiding this comment

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

this should probably be larger than all the other versions by default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a place holder. Will ask more about the version upgrade process.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should we set it as <0,5>?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think that's reasonable. I just wanted to make sure CI still passes with it set to something higher than the base/upgrade versions

@@ -175,6 +181,9 @@ pub fn precompute_vid_commitment(
/// do dispersal for the genesis block. For simplicity and performance, we use 1.
pub const GENESIS_VID_NUM_STORAGE_NODES: usize = 1;

/// The genesis block VID version number.
pub const GENESIS_VID_VERSION: Version = Version { major: 0, minor: 0 };
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this should be a global const; is there a reason we need this?

@@ -145,28 +149,30 @@ pub trait TestableBlock<TYPES: NodeType>: BlockPayload<TYPES> + Debug {
/// If the VID computation fails.
#[must_use]
#[allow(clippy::panic)]
pub fn vid_commitment(
pub fn vid_commitment<V: Versions>(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if this is a strong preference, but I think typically we would implement a vid_commitment2 and switch on the version at use sites

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then for future upgrades, we could have complicated codes at use sides. It might be better to hide the versions after a proxy fn.

payload: &TYPES::BlockPayload,
membership: &Arc<RwLock<TYPES::Membership>>,
view: TYPES::View,
target_epoch: Option<TYPES::Epoch>,
data_epoch: Option<TYPES::Epoch>,
version: Version,
Copy link
Contributor

Choose a reason for hiding this comment

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

minor comment: I usually prefer passing upgrade_lock over passing version

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.

[VID Upgrade] - add version information to VID interfaces
4 participants