Skip to content

Allow to decrease and increase take, add tests#319

Merged
distributedstatemachine merged 26 commits intostaofrom
feature/increase_delegate_take
Apr 12, 2024
Merged

Allow to decrease and increase take, add tests#319
distributedstatemachine merged 26 commits intostaofrom
feature/increase_delegate_take

Conversation

@gztensor
Copy link
Contributor

@gztensor gztensor commented Apr 12, 2024

This PR is similar to a closed now PR#313.

Added:

  • Extrinsic decrease_take in subtensor pallet
  • Extrinsic increase_take in subtensor pallet
  • Extrinsic sudo_set_tx_rate_limit_delegate_take in admin-utils pallet
  • Separate rate limit logic for increasing delegate take (decreasing is not rate limited)
  • Unit tests for decreasing and increasing take in misc. corner cases

This PR closes #314

unconst and others added 23 commits March 27, 2024 11:04
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
Co-authored-by: cuteolaf <OliverLim818@gmail.com>
…r/subtensor into feature/increase_delegate_take
@gztensor
Copy link
Contributor Author

Tests passed locally, this is good to go.

@gztensor gztensor mentioned this pull request Apr 12, 2024
5 tasks
@gztensor gztensor changed the title Allow to increase take, add tests Allow to decrease and increase take, add tests Apr 12, 2024
@distributedstatemachine distributedstatemachine merged commit 549231e into stao Apr 12, 2024
@distributedstatemachine distributedstatemachine deleted the feature/increase_delegate_take branch April 12, 2024 23:10
@gztensor gztensor mentioned this pull request Apr 16, 2024
2 tasks
@gztensor
Copy link
Contributor Author

gztensor commented May 3, 2024

Testing on the local net is done with a combination of btcli (for setting up the network and delegates) and Polkadot AppsUI (for changing takes and admin bounds for takes - min and max). All tests passed.

Start a nerwork:

./scripts/localnet.sh

btcli:

### Create subnet, register, become delegate:
btcli root register --subtensor.network 127.0.0.1:9946
btcli s create --subtensor.network 127.0.0.1:9946
btcli s list --subtensor.network 127.0.0.1:9946
btcli s register --subtensor.network 127.0.0.1:9946
# nominate
btcli r nominate --subtensor.network 127.0.0.1:9946
# show delegates and their takes
btcli r list_delegates --subtensor.network 127.0.0.1:9946

Polkadot Apps UI:

1. Increase take -> InvalidTake error
2. Decrease take to 17% -> ok
3. Sudo set minimum take to 10000 (15.3%) -> ok 
4. Decrease take to 9999 -> InvalidTake
5. Decrease take to 10000 -> ok
6. Increase take to 10001 -> ok 
7. Increase take to 20000 -> InvalidTake
8. Sudo set maximum take to 20000 -> ok
9. Increase take to 20000 -> TxRateLimitExceeded (as expected)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants