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(station): configurable station initialization #482

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

Conversation

keplervital
Copy link
Member

No description provided.

@keplervital keplervital self-assigned this Jan 21, 2025
@olaszakos olaszakos self-assigned this Mar 6, 2025
@olaszakos olaszakos marked this pull request as ready for review March 6, 2025 14:11
@olaszakos olaszakos requested a review from a team as a code owner March 6, 2025 14:11
return Ordering::Less;
}
}
Ordering::Greater
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure this result leads to keeping the original order: shouldn't we compare the original indices here?

print("Adding initial accounts");
install_canister_handlers::set_initial_accounts(accounts, &init.assets, quorum)
let initial_user_count = init.users.len() as u16;
let quorum = calc_initial_quorum(initial_user_count, init.quorum);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is the quorum based on the number of all initial users (incl. non-admins)?

max: u16::MAX as usize,
})?;
}

// adds the default admin group
init_canister_sync_handlers::add_initial_groups();
let admin_quorum = calc_initial_quorum(input.users.len() as u16, input.quorum);
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like user quorum

@mraszyk
Copy link
Collaborator

mraszyk commented Mar 10, 2025

What happens if the init args contain the same UUID multiple times? I'm not sure if the code checks for duplicate UUIDs in the input.

olaszakos and others added 6 commits March 10, 2025 12:17
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
@olaszakos
Copy link
Contributor

What happens if the init args contain the same UUID multiple times? I'm not sure if the code checks for duplicate UUIDs in the input.

Since the service layer is used for initial entry creation, it's up to the validation implemented there. Thanks for pointing this out, because the newly added create_xyz_with_id functions didn't check for duplicate ID's, so the service function would just overwrite those possibly creating invalid state.

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