-
Notifications
You must be signed in to change notification settings - Fork 0
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(rust/rbac-registration): Record each role data fields #244
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
✅ Test Report | |
.or_insert(RoleDataRecord::new()); | ||
|
||
// Update role data record | ||
if let Some(record) = role_data_record.get_mut(&number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, but maybe it would be better to move this block to role_data_record.entry(number).and_modify(...)
closure?.. Currently this condition is slightly confusing. because the record is always present because we inserting it above.
Signed-off-by: bkioshn <[email protected]>
pub struct RoleDataRecord { | ||
/// List of signing key and its associated point + tx index . | ||
/// The vector index is used to indicate the key rotation. | ||
signing_keys: Vec<PointData<KeyLocalRef>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historically, this will become inaccurate.
As time passes, the array being referenced will change, so the key ref will not point to the historical key/cert, it will point to the latest key/cert in the array.
Simplified Example:
simple_keys_array = [none, key_a, key_b]
role_key = points to simple_keys_array[1]
So, this would create a signing key with that ref, in the first element of the vec.
If an update occurs like this:
simple_keys_array = [none, key_c, key_b]
The vec will still refer to the first element which is now key_c and not key_a as it was.
What should happen is we end up with a vec that has a form like:
signing_keys: [(time0, key_a,) (time1, key_c)]
So the changes over time are acurately captured.
The reality is, its most likely that updates will simply just replace the key in the array and will not (because they don't need to) update the key reference.
Description
Record each role data fields
Related Issue(s)
Closes #241
Description of Changes
Each role data fields are record separately which is stored in
role_data_record
.This
role_data_record
is difference fromrole_data_history
whererole_data_history
store the whole role data at the specific point.For example, for role 0,
Each entry of Roledata as shown above will be store in
role_data_history
The
role_data_record
of role 0 will beNote that when dealing with key rotation, if the key added is already exist in the list, it will not be added into the list.
Breaking Changes
Renaming
all_role_data
->role_data_history
role_data
->role_data_record
and the structure changesTest
This change need to be tested again once test data is fully prepared
input-output-hk/catalyst-voices#2037
Please confirm the following checks