- Individuals wishing to contribute to subtensor should develop their change/feature/fix in a
Pull Request (PR) targeting the
main
branch of the subtensor GitHub repository. It is recommended to start your pull request as a draft initially until you are ready to have other developers actively look at it. Any changes to pallet/runtime code should be accompanied by integration and/or unit tests fully testing all the edge cases of this functionality, if applicable. - Once you have finished developing your change/feature/fix and the Rust portion of the CI is passing for your PR (everything prefixed with "CI"), you should mark your PR as "Ready for Review" and request review from "Nucleus".
- Core Nucleus team members will review your PR, possibly requesting changes, and will also add appropriate labels to your PR as shown below. Three positive reviews are required.
- Once the required passing reviews have been obtained, you are ready to request that your PR
be included in the next
devnet
deploy. To do this, you should open a companion PR merging a copy of your branch into thedevnet-ready
branch. You must include a link to the parent PR in the description and preface your PR title with "(Devnet Ready)" or the PR will be closed/ignored. Your companion PR should have thedevnet-companion
label. - A core team administrator will review your "(Devnet Ready)" PR, verifying that it logically
matches the changes introduced in the parent PR (there will sometimes be minor differences
due to merge conflicts) and will either request changes or approve the PR and merge it. Once
your companion PR is merged, the administrator will add the
devnet-ready
label to the parent PR, indicating that the PR is on thedevnet-ready
branch and will be included in the next deploy todevnet
. - At some point, a core team administrator will open a PR merging the current
devnet-ready
branch intodevnet
, and the CI will enforce some additional safety checks on this PR including a requirement that the newspec_version
be greater than the current on-chainspec_version
. The PR should include a bulleted list of all PRs included in the deploy so they can be easily found after the fact (TODO: automate this). This PR will require two reviews from the core team as a sanity check. After merging, the administrator will then need to update all PRs with thedevnet-ready
label to instead have theon-devnet
label (TODO: automate this upon merge). The administrator will then deploydevnet
. - Once the
on-devnet
label appears on your PR, if you are a core team member it is your responsibility to verify that the features/changes/fixes introduced by your PR are functioning properly ondevnet
by interacting with the live network. If you are an external contributor, a core team member will be assigned to test this for you. - If your feature/change/fix is confirmed working on
devnet
, thedevnet-pass
label should be added. Otherwise if there are issues, thedevnet-fail
label should be added and you will need to make changes to your PR and repeat the previous steps in this process. In some cases a revert PR will need to be created reverting your changes from thepre-devnet
anddevnet
branches, respectively. - Once
devnet-pass
has been added to your PR, it is eligible for inclusion in the nexttestnet
deploy. We typically runtestnet
deploys every other wednesday. - On the appropriate date, an administrator will open a PR merging the current
devnet
branch intotestnet
. This PR should include a bulleted list of all PRs included in the deploy so they can be easily found after the fact (TODO: automate this). The PR should exclude any PRs that currently have thedevnet-fail
label via a revert (TODO: enforce via CI). This PR will require two reviews from the core team as a sanity check. After merging intotestnet
, the administrator will then need to run the deploy and update all PRs included in the deploy with theon-testnet
label (TODO: automate this upon merge). Next the administrator must cut a (pre-release) release in GitHub fortestnet
(TODO: github action to generate the release and release notes). - Once the
on-testnet
label appears on your PR, if you are a core team member it is your responsibility to once again verify that the features/changes/fixes introduced by your PR are functioning properly ontestnet
by interacting with the live network, if applicable. If you are an external contributor, a core team member may be assigned to do this testing for you but otherwise it will be your responsibility to show evidence on the PR that the testing is successful. Once this has been verified, thetestnet-pass
label should be added. If testing fails, thetestnet-fail
label should be added and PRs should be opened reverting the change fromdevnet-ready
, and then a PR should be opened merging the modifieddevnet
intotestnet
. These revert PRs, if they occur, must be merged before a new deploy can be run (TODO: enforce this via CI). - After the SOP period (1 week on
testnet
) has passed and thetestnet-pass
label has been added, the CI checks on your PR should now turn all green and a core team member will be able to merge your PR intomain
. At this point your PR is done and is eligible to be included in the nextfinney
deploy (TODO: track and enforce SOP compliance on a per-PR basis in CI based on the timestamps of label changes). We typically runfinney
deploys every other Wednesday, so this will typically happen the Wednesday following the Wednesday your PR was deployed totestnet
. An administrator will run this deploy. The process the administrator follows is to open a PR mergingmain
into thefinney
branch, which will always track the current state offinney
. This PR automatically has some additional checks on it such as asserting that the spec_version gets bumped properly and other sanity checks designed to stop a bad deploy. Once the PR is reviewed and merged, the administrator will run the actual deploy. Once that is successful, the administrator will cut a new GitHub release tagged off of the latestmain
branch commit that was included in the deploy, and announcements will be made regarding the release.
Name | Description | Automations |
---|---|---|
red-team |
PR is focused on feature additions/changes | none |
blue-team |
PR is focused on preventative/safety measures and/or dev UX improvements | none |
runtime |
PR contains substantive changes to runtime / pallet code | none |
breaking-change |
PR requires synchronized changes with bittensor | Triggers an automatic bot message so the relevant teams are made aware of the change well in advance |
migration |
PR contains one or more migrations | none |
devnet-companion |
Designates a devnet companion PR | Presence of devnet-companion label is checked |
devnet-ready |
PR's branch has been merged into the devnet-ready branch and will be included in the next devnet deploy |
none |
on-devnet |
PR has been deployed to devnet |
Removes devnet-ready |
devnet-pass |
PR has passed manual testing on devnet |
devnet-pass or devnet-skip required |
devnet-skip |
Allows a critical hotfix PR to skip required testing on devnet |
devnet-pass or devnet-skip required |
devnet-fail |
PR has failed manual testing on devnet and requires modification |
none |
testnet-companion |
Designates a testnet companion PR | Presence of testnet-companion label is checked |
on-testnet |
PR has been deployed to testnet |
none |
testnet-pass |
PR has passed manual testing on testnet |
testnet-pass or testnet-skip required |
testnet-skip |
Allows a critical hotfix PR to skip required manual testing and SOP on testnet |
testnet-pass or testnet-skip required |
testnet-fail |
PR has failed manual testing on testnet and requires modification |
none |
Companion PRs merge into this branch, eventually accumulating into a merge of devnet-ready
into devnet
, coinciding with a deploy of devnet
.
- no deleting the branch
- no force pushes
- no direct pushes
- require 1 positive review from an administrator
- new code changes invalidate existing reviews
- only merge commit style merging allowed
check-rust.yml
must pass- TODO: parent PR must be linked to in description
- TODO: parent PR must have the required number of positive reviews
Tracks the current state of what is deployed to devnet
. Modified by an administrator via a PR
merging devnet-ready
into devnet
, in concert with a deploy of devnet
.
- no deleting the branch
- no force pushes
- no direct pushes
- require 2 positive reviews from core team members
- new code changes invalidate existing reviews
- only merge commit style merging allowed
check-rust.yml
must passcheck-devnet.yml
must pass- spec_version must be greater than what is currently on live
devnet
- TODO: other pre-deploy sanity checks here
Tracks the current state of what is deployed to testnet
. Administrator will open a PR merging
current devnet
into testnet
and merge it in concert with a deploy to testnet
. Contains
tags for testnet
releases.
- no deleting the branch
- no force pushes
- no direct pushes
- require 2 positive reviews from core team members
- new code changes invalidate existing reviews
- only merge commit style merging allowed
check-rust.yml
must passcheck-testnet.yml
must pass- spec_version must be greater than what is currently on live
testnet
- TODO: other pre-deploy sanity checks here
Default branch for all new PRs. Slightly ahead of what is currently on finney
. When a PR is all
green and "done", meaning it has been tested on devnet
and testnet
, it can be merged into
main
. Contains tags for finney
releases.
- no deleting the branch
- no force pushes
- no direct pushes
- require 3 positive reviews from core team members
- new code changes invalidate existing reviews
- all conversations must be resolved
- only merge commit style merging allowed
check-rust.yml
must passcheck-labels.yml
must pass- must have
devnet-skip
ordevnet-pass
label - must have
testnet-skip
ortestnet-pass
label - if
breaking-change
label is present, bot will message the appropriate teams - TODO: when we get auditing, presence of
needs-audit
label = require a review from auditor - TODO: track SOP on PR based on label age
Tracks the current state of what is deployed to finney
(mainnet). Updated via an
administrator-submitted PR merging main
into finney
in concert with a finney
deploy.
- no deleting the branch
- no force pushes
- no direct pushes
- require 3 positive reviews from core team members
- new code changes invalidate existing reviews
- only merge commit style merging allowed
check-rust.yml
must passcheck-finney.yml
must pass- spec_version must be greater than what is currently on live
finney
- TODO: other pre-deploy sanity checks here