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

Add Member::expelled #164

Closed
junha1 opened this issue Nov 28, 2022 · 2 comments · Fixed by #454
Closed

Add Member::expelled #164

junha1 opened this issue Nov 28, 2022 · 2 comments · Fixed by #454
Assignees

Comments

@junha1
Copy link
Member

junha1 commented Nov 28, 2022

/// If true, all voting powers are ignored.
/// Note that once granted, Simperby keeps all members forever in the reserved state.
/// If you want to remove a member, you must set this to true instead of removing the member.
///
/// TODO: consider this in various verification functions.
pub expelled: bool,
@junha1
Copy link
Member Author

junha1 commented Jul 17, 2023

Tips

  • Write a test case and merge it first
  • Take a careful look of verify.rs from the common crate

@sejongk sejongk self-assigned this Jul 18, 2023
@yuhatown yuhatown self-assigned this Jul 20, 2023
@sigridjineth sigridjineth self-assigned this Jul 21, 2023
@sigridjineth sigridjineth mentioned this issue Jul 21, 2023
9 tasks
sigridjineth added a commit to sigridjineth/simperby that referenced this issue Jul 30, 2023
Implement version validation and comparison in verify_reserved_state()
sigridjineth added a commit to sigridjineth/simperby that referenced this issue Jul 30, 2023
Elaborate validation login in verify_reserved_state()
@sigridjineth
Copy link
Member

Check that the version advances correctly.

cc. @yuhatown

struct ReservedState comes from the reserved.rs file. when looking into reserved.rs, finding that the ReservedState struct contains a version is easy one.

Task
Add code to the verify_reserved_state function in verify.rs to check if the current state and the ReservedState version match, but to use semver crate.

 // 2. Check that the version advances correctly.
        if self.reserved_state.version != rs.version {
            if !(self.reserved_state.version < rs.version && verify_version_syntax(&rs.version)) {
                return Err(Error::InvalidArgument(format!("Version advances is incorrect")));
            }
        }

Considering the point where the version of the ReservedState could be arbitrarily changed (but to be included in the git Diff) any block header generated afterwards must adhere to these rules:

  1. It must follow the ReservedState.
  2. If there's a change, the version must only increment.
  3. It should comply with the x.x.x syntax (as per the semver crate).

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 a pull request may close this issue.

4 participants