Skip to content

Commit

Permalink
Add more nuanced global whitelists and bulk operations (#716)
Browse files Browse the repository at this point in the history
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v           ✰  Thanks for creating a PR! You're awesome! ✰
v Please note that maintainers will only review those PRs with a
completed PR template.
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

# Purpose of Changes and their Description

### High Level Intentions -- Whitelist Improvements

1. params proto props omitempty + new params
2. global worker whitelist
3. global reputer whitelist
4. bulk adds
	* global parameter to meter this
5. global admins
	* add to topic and global lists
	* managed by super admins

### global params to add -- DONE

0. omitempty
1. global_worker_whitelist_enabled
2. global_reputer_whitelist_enabled
3. global_admin_whitelist_appended
4. max_whitelist_input_array_length

### stores to add -- DONE

1. GlobalWorkerWhitelist
2. GlobalReputerWhitelist
3. GlobalAdminWhitelist

### acl logic to add -- DONE

1. global admins can update global and topic worker and reputer
whitelists when global admin whitelist appended. when not appended, no
one can except whitelist (super) admins
2. only global workers and reputers can work and reputer, resp, across
all topics, when their resp whitelist enabled. when diabled, anyone can
* Note: We must be sure that Global whitelist is enabled as well for
global_worker_whitelist_enabled and global_reputer_whitelist_enabled to
have meaningful effect
3. whitelist (super) admins can update all global whitelists

### rpc tx to add -- DONE

1. add global worker
2. rm global worker
3. add global reputer
4. rm global reputer
5. add global admin
6. rm global admin
7. bulk add topic workers
8. bulk add global workers
9. bulk add topic reputers
10. bulk add global reputers

### rpc q to add -- DONE

1. is_global_worker_whitelist
2. is_global_reputer_whitelist
3. is_global_admin
4. can_update_global_worker_whitelist
5. can_update_global_reputer_whitelist

## Link(s) to Ticket(s) or Issue(s) resolved by this PR

## Are these changes tested and documented?

- [x] If tested, please describe how. If not, why tests are not needed.
   - Unit tests created.
- [x] If documented, please describe where. If not, describe why docs
are not needed.
   - Documentation for this will be more carefully crafted elsewhere.
- [x] Added to `Unreleased` section of `CHANGELOG.md`?

## Still Left Todo

Just rebase atop base branch.
  • Loading branch information
kpeluso authored Dec 19, 2024
2 parents 250da2b + 6833d6a commit 2792c82
Show file tree
Hide file tree
Showing 38 changed files with 61,123 additions and 29,527 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#708](https://github.com/allora-network/allora-chain/pull/708) Add Emission Enabled bolean flag to Mint Module
* [#703](https://github.com/allora-network/allora-chain/pull/703) Add outlier detection to inferences
* [#714](https://github.com/allora-network/allora-chain/pull/714) Add initialization of actors' EMA scores
* [#716](https://github.com/allora-network/allora-chain/pull/716) Add global workers, reputers, admins + bulk operations

### Changed

Expand Down
12 changes: 12 additions & 0 deletions test/integration/update_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ func UpdateParamsChecks(m testCommon.TestConfig) {
InferenceOutlierDetectionThreshold: nil,
InferenceOutlierDetectionAlpha: nil,
LambdaInitialScore: nil,
GlobalWorkerWhitelistEnabled: nil,
GlobalReputerWhitelistEnabled: nil,
GlobalAdminWhitelistAppended: nil,
MaxWhitelistInputArrayLength: nil,
},
}
txResp, err := m.Client.BroadcastTx(ctx, m.AliceAcc, updateParamRequest)
Expand Down Expand Up @@ -154,6 +158,10 @@ func UpdateParamsChecks(m testCommon.TestConfig) {
InferenceOutlierDetectionThreshold: nil,
InferenceOutlierDetectionAlpha: nil,
LambdaInitialScore: nil,
GlobalWorkerWhitelistEnabled: nil,
GlobalReputerWhitelistEnabled: nil,
GlobalAdminWhitelistAppended: nil,
MaxWhitelistInputArrayLength: nil,
},
}
_, err = m.Client.BroadcastTx(ctx, m.BobAcc, updateParamRequest)
Expand Down Expand Up @@ -220,6 +228,10 @@ func UpdateParamsChecks(m testCommon.TestConfig) {
InferenceOutlierDetectionThreshold: nil,
InferenceOutlierDetectionAlpha: nil,
LambdaInitialScore: nil,
GlobalWorkerWhitelistEnabled: nil,
GlobalReputerWhitelistEnabled: nil,
GlobalAdminWhitelistAppended: nil,
MaxWhitelistInputArrayLength: nil,
},
}
txResp, err = m.Client.BroadcastTx(ctx, m.AliceAcc, updateParamRequest)
Expand Down
Loading

0 comments on commit 2792c82

Please sign in to comment.