-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add ImmutableOwner extension to block ATA owner authority changes #2854
Conversation
@@ -77,7 +81,7 @@ fn get_extension_indices<V: Extension>( | |||
let v_account_type = V::TYPE.get_account_type(); | |||
while start_index < tlv_data.len() { | |||
let tlv_indices = get_tlv_indices(start_index); | |||
if tlv_data.len() <= tlv_indices.value_start { | |||
if tlv_data.len() < tlv_indices.value_start { |
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.
🙋🏼 <=
to <
was needed to support extensions that hold no data, like the FixedOwner
extension
I'm not sure I love the name "FixedOwner". Drive-by bikeshedding welcome! |
|
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.
Functionality looks good. Test failures look legit, though (related to rent-exempt minimum).
I do think we should come up with a different name, since in addition to "Static", "Fixed" can also mean "Repaired" (and even though that's slightly true in this case, it's also confusing).
I like ImmutableOwner
reasonably well; other options: FrozenOwner
, LockedOwner
(both of which suffer from implying that the operation can be un-done), StaticOwner
|
|
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.
lgtm if CI is happy!
@@ -64,6 +67,7 @@ fn get_tlv_indices(type_start: usize) -> TlvIndices { | |||
|
|||
/// Helper struct for returning the indices of the type, length, and value in | |||
/// a TLV entry | |||
#[derive(Debug)] |
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.
Heh, I added and removed this about a dozen times when working on #2824
Pull request has been modified.
ATA will now set the ImmutableOwner extension on new accounts it creates.
Fixes #2640