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!: Add support for priority validators #2101

Merged
merged 41 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
536243a
Start adding priority validators
p-offtermatt Jul 26, 2024
7b7612e
Add new priority_validator field
p-offtermatt Jul 26, 2024
c3df006
Resolve conflicts with main
kirdatatjana Oct 7, 2024
f96fb22
Added priority list to the PowerShapingParameters
kirdatatjana Oct 15, 2024
e41bd64
Add documentation for priority list
kirdatatjana Oct 16, 2024
5893cd3
Add priority list in local-testnet.sh
kirdatatjana Oct 16, 2024
09beb73
Update .changelog/unreleased/features/provider/xxxx-priority-validato…
kirdatatjana Oct 16, 2024
d442765
Update x/ccv/provider/keeper/power_shaping.go
kirdatatjana Oct 16, 2024
e6b17ef
Update x/ccv/provider/keeper/power_shaping_test.go
kirdatatjana Oct 16, 2024
4083463
Update x/ccv/provider/keeper/power_shaping_test.go
kirdatatjana Oct 16, 2024
508aa1c
Update .changelog/unreleased/api-breaking/provider/xxxx-priority-vali…
kirdatatjana Oct 16, 2024
da41d15
Fix typo in provider.proto
kirdatatjana Oct 16, 2024
a7572eb
Merge branch 'ph/priority-validators' of https://github.com/cosmos/in…
kirdatatjana Oct 16, 2024
165ef87
Remove unnecessary priority list from test in steps_permissionless_ic…
kirdatatjana Oct 16, 2024
d5cb420
Remove comment from grpc_query.go
kirdatatjana Oct 16, 2024
b6788e6
Add e2e test for priority list
kirdatatjana Oct 16, 2024
1c19591
Improved e2e test
kirdatatjana Oct 17, 2024
b36e28f
Merge branch 'main' into ph/priority-validators
kirdatatjana Oct 17, 2024
171246d
Merge branch 'main' into ph/priority-validators
kirdatatjana Oct 17, 2024
ae2c771
Fixed some issues
kirdatatjana Oct 21, 2024
e40a8c6
Refactored code logic
kirdatatjana Oct 21, 2024
e878390
Refactored code logic
kirdatatjana Oct 22, 2024
837a078
Renamed files
kirdatatjana Oct 22, 2024
04e9c57
Removed priority list from migrations.go
kirdatatjana Oct 22, 2024
f866876
Fixed bug for priority list
kirdatatjana Oct 23, 2024
21d8ff7
Added priority list to e2e nightly tests
kirdatatjana Oct 23, 2024
abd2773
Update tx.go
kirdatatjana Oct 23, 2024
2c83503
Refactored TestCapValidatorSet
kirdatatjana Oct 23, 2024
a78038f
Merge branch 'ph/priority-validators' of https://github.com/cosmos/in…
kirdatatjana Oct 23, 2024
5ef9ff2
Small fixes
kirdatatjana Oct 24, 2024
ba04ab8
Small fixes
kirdatatjana Oct 24, 2024
d5d043b
Fix PartitionBasedOnPriorityList function
kirdatatjana Oct 24, 2024
31e8001
Update contrib/local-testnet.sh
kirdatatjana Oct 25, 2024
cc84d75
Moved 2101-introduce-priority-validators.md into state-breaking
kirdatatjana Oct 25, 2024
6336f9d
Merge branch 'ph/priority-validators' of https://github.com/cosmos/in…
kirdatatjana Oct 25, 2024
adc3a0e
Fixed TestGetConsumerChain
kirdatatjana Oct 25, 2024
94eba83
Added test case in TestCapValidatorSet
kirdatatjana Oct 25, 2024
a49866c
Revert changes made by the merge
kirdatatjana Oct 25, 2024
0b38ed4
Removed changes from ADRs that were already implemented
kirdatatjana Oct 25, 2024
a1d974d
Added a comment in CapValidatorSet function
kirdatatjana Oct 25, 2024
9f4d771
Removed unnecessary imports
kirdatatjana Oct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Allow consumer chains to specify a list of priority validators that are included in the validator set before other validators are considered
kirdatatjana marked this conversation as resolved.
Show resolved Hide resolved
([\#2101](https://github.com/cosmos/interchain-security/pull/2101))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Allow consumer chains to specify a list of priority validators that are included in the validator set before other validators are considered
([\#2101](https://github.com/cosmos/interchain-security/pull/2101))
3 changes: 2 additions & 1 deletion contrib/local-testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ tee ${PROV_NODE_DIR}/consumer_prop.json<<EOF
"allowlist": [],
"denylist": [],
"min_stake": 1000,
"allow_inactive_vals": true
"allow_inactive_vals": true,
"prioritylist": [],
kirdatatjana marked this conversation as resolved.
Show resolved Hide resolved
}
}
],
Expand Down
3 changes: 3 additions & 0 deletions docs/docs/adrs/adr-019-permissionless-ics.md
kirdatatjana marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ or a combination of them.
| `ConsumerCommissionRatePrefix` | Commission rate per chain per validator | validator | consumer chain | Every `MsgSetConsumerCommissionRate` message |
| `MinimumPowerInTopNBytePrefix` | Stores the minimum power needed to opt in for a chain | not applicable for Opt In chains | not applicable for Opt In chains | Every epoch |
| `ConsumerAddrsToPruneV2BytePrefix` | Stores consumer addresses to be pruned (as part of `VSCMaturedPacket`s deprecation) | validator or provider chain | provider chain | Every `MsgAssignConsumerKey` or `MsgOptIn` and later during actual pruning |
| `PrioritylistPrefix` | Stores the prioritylist of a chain | consumer chain | consumer chain| Every parameter update |

Everything stored under one of the above keys is associated with a `chainId` and has to be migrated to new state under a `consumerId`.

Expand Down Expand Up @@ -271,6 +272,8 @@ message PowerShapingParameters {
uint64 min_stake = 6;
// Corresponds to whether inactive validators are allowed to validate the consumer chain.
bool allow_inactive_vals = 7;
// corresponds to a list of provider consensus addresses of validators that have priority
repeated string prioritylist = 8;
}

```
Expand Down
11 changes: 10 additions & 1 deletion docs/docs/build/modules/02-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ Format: `byte(37) | len(consumerId) | []byte(consumerId) | addr -> []byte{}`, wi

Format: `byte(40) | len(consumerId) | []byte(consumerId) -> uint64`

#### Prioritylist

`Prioritylist` is the list of provider validators that have priority to validate a given consumer chain.

Format: `byte(56) | len(consumerId) | []byte(consumerId) | addr -> []byte{}`, with `addr` the validator's consensus address on the provider chain.

### Validator Set Updates

#### ValidatorSetUpdateId
Expand Down Expand Up @@ -1089,6 +1095,7 @@ Output:
chains:
- allow_inactive_vals: true
allowlist: []
prioritylist: []
chain_id: pion-1
client_id: 07-tendermint-0
consumer_id: "0"
Expand Down Expand Up @@ -1554,6 +1561,7 @@ power_shaping_params:
top_N: 100
validator_set_cap: 0
validators_power_cap: 0
prioritylist: []
```

</details>
Expand Down Expand Up @@ -1680,7 +1688,8 @@ where `update-consumer-msg.json` contains:
"allowlist":["cosmosvalcons1l9qq4m300z8c5ez86ak2mp8znftewkwgjlxh88"],
"denylist":[],
"min_stake": "1000",
mpoke marked this conversation as resolved.
Show resolved Hide resolved
"allow_inactive_vals":true
"allow_inactive_vals":true,
"prioritylist":[]
},
"allowlisted_reward_denoms": {
"denoms": ["ibc/0025F8A87464A471E66B234C4F93AEC5B4DA3D42D7986451A059273426290DD5"]
Expand Down
4 changes: 3 additions & 1 deletion docs/docs/consumer-development/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ Example of power-shaping parameters:
// Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain.
"min_stake": 0,
// Corresponds to whether inactive validators are allowed to validate the consumer chain.
"allow_inactive_vals": false
"allow_inactive_vals": false,
// Corresponds to a list of provider consensus addresses of validators that have priority
"prioritylist": [],
}
```

Expand Down
4 changes: 4 additions & 0 deletions docs/docs/features/power-shaping.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ This can be useful for chains that want to have a larger validator set than the
Consumer chains that enable this feature should strongly consider setting a minimum validator stake to ensure that only validators with some reputation/stake can validate the chain.
By default, this parameter is set to `false`, i.e., validators outside of the provider's active set are not eligible to opt in.

### Prioritylist

The consumer chain can specify a priority list of validators for participation in the validator set. Validators on the priority list are considered first when forming the consumer chain's validator set. If a priority list isn't set, the remaining slots are filled based on validator power.

## Setting Power Shaping Parameters

All the power shaping parameters can be set by the consumer chain in the `MsgCreateConsumer` or `MsgUpdateConsumer` messages.
Expand Down
Loading
Loading