Skip to content

Commit dd09294

Browse files
p-offtermattkirdatatjanampoke
authored
feat!: Add support for priority validators (#2101)
* Start adding priority validators * Add new priority_validator field * Added priority list to the PowerShapingParameters * Add documentation for priority list * Add priority list in local-testnet.sh * Update .changelog/unreleased/features/provider/xxxx-priority-validators.md Co-authored-by: Philip Offtermatt <[email protected]> * Update x/ccv/provider/keeper/power_shaping.go Co-authored-by: Philip Offtermatt <[email protected]> * Update x/ccv/provider/keeper/power_shaping_test.go Co-authored-by: Philip Offtermatt <[email protected]> * Update x/ccv/provider/keeper/power_shaping_test.go Co-authored-by: Philip Offtermatt <[email protected]> * Update .changelog/unreleased/api-breaking/provider/xxxx-priority-validators.md Co-authored-by: Philip Offtermatt <[email protected]> * Fix typo in provider.proto * Remove unnecessary priority list from test in steps_permissionless_ics.go * Remove comment from grpc_query.go * Add e2e test for priority list * Improved e2e test * Fixed some issues * Refactored code logic * Refactored code logic * Renamed files * Removed priority list from migrations.go * Fixed bug for priority list * Added priority list to e2e nightly tests * Update tx.go * Refactored TestCapValidatorSet * Small fixes * Small fixes * Fix PartitionBasedOnPriorityList function * Update contrib/local-testnet.sh Co-authored-by: Marius Poke <[email protected]> * Moved 2101-introduce-priority-validators.md into state-breaking * Fixed TestGetConsumerChain * Added test case in TestCapValidatorSet * Revert changes made by the merge * Removed changes from ADRs that were already implemented * Added a comment in CapValidatorSet function * Removed unnecessary imports --------- Co-authored-by: kirdatatjana <[email protected]> Co-authored-by: kirdatatjana <[email protected]> Co-authored-by: Marius Poke <[email protected]>
1 parent 0d6f75f commit dd09294

File tree

28 files changed

+1106
-426
lines changed

28 files changed

+1106
-426
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Allow consumer chains to specify a list of priority validators that are included in the validator set before other validators are considered
2+
([\#2101](https://github.com/cosmos/interchain-security/pull/2101))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Allow consumer chains to specify a list of priority validators that are included in the validator set before other validators are considered
2+
([\#2101](https://github.com/cosmos/interchain-security/pull/2101))

.github/workflows/nightly-e2e.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,22 @@ jobs:
277277
go-version: "1.22" # The Go version to download (if necessary) and use.
278278
- name: E2E partial set security denylist
279279
run: go run ./tests/e2e/... --tc partial-set-security-validators-denylisted
280+
partial-set-security-validators-prioritylisted-test:
281+
runs-on: ubuntu-latest
282+
timeout-minutes: 20
283+
steps:
284+
- uses: actions/setup-go@v5
285+
with:
286+
go-version: "1.22"
287+
- uses: actions/checkout@v4
288+
- name: Checkout LFS objects
289+
run: git lfs checkout
290+
- name: Setup Go
291+
uses: actions/setup-go@v5
292+
with:
293+
go-version: "1.22" # The Go version to download (if necessary) and use.
294+
- name: E2E partial set security prioritylist
295+
run: go run ./tests/e2e/... --tc partial-set-security-validators-prioritylisted
280296
partial-set-security-modification-proposal:
281297
runs-on: ubuntu-latest
282298
timeout-minutes: 20
@@ -376,6 +392,7 @@ jobs:
376392
- partial-set-security-validators-power-cap-test
377393
- partial-set-security-validators-allowlisted-test
378394
- partial-set-security-validators-denylisted-test
395+
- partial-set-security-validators-prioritylisted-test
379396
- partial-set-security-modification-proposal
380397
- active-set-changes-test
381398
- permissionless-basic-test

contrib/local-testnet.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ tee ${PROV_NODE_DIR}/consumer_prop.json<<EOF
317317
"allowlist": [],
318318
"denylist": [],
319319
"min_stake": 1000,
320-
"allow_inactive_vals": true
320+
"allow_inactive_vals": true,
321+
"prioritylist": []
321322
}
322323
}
323324
],

docs/docs/build/modules/02-provider.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ Format: `byte(37) | len(consumerId) | []byte(consumerId) | addr -> []byte{}`, wi
225225

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

228+
#### Prioritylist
229+
230+
`Prioritylist` is the list of provider validators that have priority to validate a given consumer chain.
231+
232+
Format: `byte(56) | len(consumerId) | []byte(consumerId) | addr -> []byte{}`, with `addr` the validator's consensus address on the provider chain.
233+
228234
### Validator Set Updates
229235

230236
#### ValidatorSetUpdateId
@@ -1089,6 +1095,7 @@ Output:
10891095
chains:
10901096
- allow_inactive_vals: true
10911097
allowlist: []
1098+
prioritylist: []
10921099
chain_id: pion-1
10931100
client_id: 07-tendermint-0
10941101
consumer_id: "0"
@@ -1554,6 +1561,7 @@ power_shaping_params:
15541561
top_N: 100
15551562
validator_set_cap: 0
15561563
validators_power_cap: 0
1564+
prioritylist: []
15571565
```
15581566

15591567
</details>
@@ -1679,8 +1687,9 @@ where `update-consumer-msg.json` contains:
16791687
"validator_set_cap": 50,
16801688
"allowlist":["cosmosvalcons1l9qq4m300z8c5ez86ak2mp8znftewkwgjlxh88"],
16811689
"denylist":[],
1682-
"min_stake": 1000,
1683-
"allow_inactive_vals":true
1690+
"min_stake": "1000",
1691+
"allow_inactive_vals":true,
1692+
"prioritylist":[]
16841693
},
16851694
"allowlisted_reward_denoms": {
16861695
"denoms": ["ibc/0025F8A87464A471E66B234C4F93AEC5B4DA3D42D7986451A059273426290DD5"]

docs/docs/consumer-development/onboarding.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ Example of power-shaping parameters:
125125
// Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain.
126126
"min_stake": 0,
127127
// Corresponds to whether inactive validators are allowed to validate the consumer chain.
128-
"allow_inactive_vals": false
128+
"allow_inactive_vals": false,
129+
// Corresponds to a list of provider consensus addresses of validators that have priority
130+
"prioritylist": [],
129131
}
130132
```
131133

docs/docs/features/power-shaping.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ This can be useful for chains that want to have a larger validator set than the
8080
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.
8181
By default, this parameter is set to `false`, i.e., validators outside of the provider's active set are not eligible to opt in.
8282

83+
### Prioritylist
84+
85+
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.
86+
8387
## Setting Power Shaping Parameters
8488

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

0 commit comments

Comments
 (0)