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

[devnet-companion] fix chainspecs #555

Merged
merged 29 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2dd7140
fix: chain spec irregularities
orriin May 30, 2024
f94e0d4
feat: check chainspec ci
orriin May 31, 2024
cdf96f4
feat: add bootnodes
orriin May 31, 2024
a96b41d
feat: build_all_chainspecs.sh script
orriin May 31, 2024
d97ab58
Apply automatic changes
orriin Jun 2, 2024
674d0da
feat: build_all_chainspecs.sh script
orriin May 31, 2024
f3cc5b2
Merge branch 'fix/chainspecs' of github.com:opentensor/subtensor into…
orriin Jun 2, 2024
5c84d8c
chore: better automated commit message
orriin Jun 2, 2024
2e1d938
chore: simplify ci
orriin Jun 2, 2024
f045ffa
Update chainspecs
orriin Jun 2, 2024
ec14176
chore: trigger ci
orriin Jun 2, 2024
df40180
Update chainspecs
orriin Jun 2, 2024
2596553
chore: trigger ci
orriin Jun 2, 2024
0d15170
Merge branch 'fix/chainspecs' of github.com:opentensor/subtensor into…
orriin Jun 2, 2024
c96818c
ci: only build chain specs on push to main, development, staging
orriin Jun 2, 2024
890f2f6
Merge branch 'main' into fix/chainspecs
orriin Jun 3, 2024
bbd26ca
Revert "Merge branch 'main' into fix/chainspecs"
orriin Jun 3, 2024
3434c95
ci to always check chainspecs build
orriin Jun 3, 2024
590249c
ci: install pytest
orriin Jun 3, 2024
6959cba
merge
orriin Jun 19, 2024
9b5a3ea
fix main merge
orriin Jun 19, 2024
e2282e4
disallow changing genesis
orriin Jun 19, 2024
1876bc6
reset raw
orriin Jun 19, 2024
892b76c
fix specs
orriin Jun 19, 2024
544d2cd
rename file
orriin Jun 19, 2024
43a3e1b
remove raw_testspec.json
sam0x17 Jun 19, 2024
f647b16
missed one
sam0x17 Jun 19, 2024
2cf595b
more that I missed
sam0x17 Jun 19, 2024
b5bc72d
Merge remote-tracking branch 'origin/devnet-ready' into fix-chainspec…
sam0x17 Jun 21, 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
71 changes: 71 additions & 0 deletions .github/workflows/update-chainspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Update Chainspecs

concurrency:
group: update-chainspec-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches: [main, testnet, staging, staging-ready]

workflow_dispatch:
inputs:
verbose:
description: "Output more information when triggered manually"
required: false
default: ""

env:
CARGO_TERM_COLOR: always
VERBOSE: ${{ github.events.input.verbose }}

jobs:
update-chainspecs:
runs-on: SubtensorCI
permissions:
contents: write

strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
os:
- ubuntu-latest
include:
- os: ubuntu-latest
env:
RELEASE_NAME: development
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler

- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/[email protected]
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Shared Rust Cache
uses: Swatinem/[email protected]
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: Build chainspecs
run: ./scripts/build_all_chainspecs.sh

- uses: stefanzweifel/git-auto-commit-action@v5
name: Commit any updated chainspecs
with:
commit_message: Update chainspecs
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ COPY Cargo.lock Cargo.toml /subtensor/

# Specs
COPY ./snapshot.json /subtensor/snapshot.json
COPY ./raw_spec.json /subtensor/raw_spec.json
COPY ./raw_testspec.json /subtensor/raw_testspec.json

# Copy our sources
COPY ./node /subtensor/node
Expand All @@ -60,6 +58,4 @@ EXPOSE 30333 9933 9944
FROM $BASE_IMAGE AS subtensor

COPY --from=builder /subtensor/snapshot.json /
COPY --from=builder /subtensor/raw_spec.json /
COPY --from=builder /subtensor/raw_testspec.json /
COPY --from=builder /subtensor/target/release/node-subtensor /usr/local/bin
103,931 changes: 0 additions & 103,931 deletions finney_plain_spec.json

This file was deleted.

12 changes: 9 additions & 3 deletions node/src/chain_spec/finney.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn finney_mainnet_config() -> Result<ChainSpec, String> {
let mut properties = sc_service::Properties::new();
properties.insert("tokenSymbol".into(), "TAO".into());
properties.insert("tokenDecimals".into(), 9.into());
properties.insert("ss58Format".into(), 13116.into());
properties.insert("ss58Format".into(), 42.into());

Ok(ChainSpec::builder(
wasm_binary,
Expand All @@ -72,8 +72,14 @@ pub fn finney_mainnet_config() -> Result<ChainSpec, String> {
},
)
.with_name("Bittensor")
.with_protocol_id("bittensor")
.with_id("bittensor")
.with_chain_type(ChainType::Live)
.with_boot_nodes(vec![
"/dns/bootnode.finney.chain.opentensor.ai/tcp/30333/ws/p2p/12D3KooWRwbMb85RWnT8DSXSYMWQtuDwh4LJzndoRrTDotTR5gDC"
.parse()
.unwrap(),
])
.with_genesis_config_patch(finney_genesis(
// Initial PoA authorities (Validators)
// aura | grandpa
Expand Down Expand Up @@ -193,9 +199,9 @@ fn finney_genesis(
.collect::<Vec<_>>(),
},
"sudo": { "key": Some(<AccountId32 as Ss58Codec>::from_ss58check("5FCM3DBXWiGcwYYQtT8z4ZD93TqYpYxjaAfgv6aMStV1FTCT").unwrap()) },
"subtensor_module": {
"subtensorModule": {
"stakes": stakes,
"balances_issuance": balances_issuance,
"balancesIssuance": balances_issuance,
}
})
}
3 changes: 2 additions & 1 deletion node/src/chain_spec/localnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn localnet_config() -> Result<ChainSpec, String> {
let mut properties = sc_service::Properties::new();
properties.insert("tokenSymbol".into(), "TAO".into());
properties.insert("tokenDecimals".into(), 9.into());
properties.insert("ss58Format".into(), 13116.into());
properties.insert("ss58Format".into(), 42.into());

Ok(ChainSpec::builder(
wasm_binary,
Expand All @@ -26,6 +26,7 @@ pub fn localnet_config() -> Result<ChainSpec, String> {
},
)
.with_name("Bittensor")
.with_protocol_id("bittensor")
.with_id("bittensor")
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(localnet_genesis(
Expand Down
8 changes: 7 additions & 1 deletion node/src/chain_spec/testnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn finney_testnet_config() -> Result<ChainSpec, String> {
let mut properties = sc_service::Properties::new();
properties.insert("tokenSymbol".into(), "TAO".into());
properties.insert("tokenDecimals".into(), 9.into());
properties.insert("ss58Format".into(), 13116.into());
properties.insert("ss58Format".into(), 42.into());

Ok(ChainSpec::builder(
wasm_binary,
Expand All @@ -72,6 +72,12 @@ pub fn finney_testnet_config() -> Result<ChainSpec, String> {
},
)
.with_name("Bittensor")
.with_boot_nodes(vec![
"/dns/bootnode.test.chain.opentensor.ai/tcp/30333/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr"
.parse()
.unwrap(),
])
.with_protocol_id("bittensor")
.with_id("bittensor")
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(testnet_genesis(
Expand Down
208,068 changes: 104,030 additions & 104,038 deletions plain_spec_finney.json

Large diffs are not rendered by default.

113 changes: 55 additions & 58 deletions plain_spec_testfinney.json

Large diffs are not rendered by default.

Loading
Loading