-
Notifications
You must be signed in to change notification settings - Fork 75
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(sequencer): Add new validator update action #1679
base: main
Are you sure you want to change the base?
Conversation
…iaorg/astria into ENG-883/validator_update_v2
power, | ||
name, | ||
} = value; | ||
if name.len() > MAX_VALIDATOR_NAME_LENGTH { |
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.
Should we explicitly check against chars()
, or is 32 bytes fine?
|
||
#[derive(Debug, PartialEq, Eq)] | ||
#[cfg_attr(test, derive(Clone))] | ||
pub(crate) struct ValidatorNames(BTreeMap<[u8; ADDRESS_LEN], String>); |
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.
would prefer to store each validator name in a separate storage entry so we don't have to fetch every single validator name just to update one name. then to get all the names, you can use a prefix iterator to return a stream, as all validator names will be stored after one prefix (eg. keys are of the form valname/<address>
where valname
is the storage prefix).
see example here:
fn allowed_fee_assets(&self) -> AllowedFeeAssetsStream<Self::PrefixKeysStream> { |
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.
Thanks for this catch! Done in a7a64af
Summary
Added new action
ValidatorUpdateV2
, which houses the same functionality asValidatorUpdate
but now includes a name field.Background
Previously, validator names were not stored app-side, and names could only be set in CometBFT genesis.
Changes
ValidatorUpdateV2
action to protos and core.ValidatorNames
struct, which containsaddress <> name
key-value pairs.ValidatorNames
.ValidatorSet
to useinsert
instead ofpush_update
so that it doesn't imply any ordering.Testing
VALIDATOR_NAMES
storage keyvalidator_name_request
.ValidatorUpdateV2
.ValidatorUpdateV2
toapp_execute_transaction_with_every_action
.Related Issues
closes #1590