Skip to content

Commit b1039b2

Browse files
authored
Merge pull request #779 from opentensor/revert-776-feat/bump_testnet_total_issuance
Revert "hotfix: bumps testnet total issuance"
2 parents 94256d5 + ffd8ed3 commit b1039b2

File tree

8 files changed

+51
-79
lines changed

8 files changed

+51
-79
lines changed

Diff for: Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,3 @@ runtime-benchmarks = [
176176
"node-subtensor-runtime/runtime-benchmarks",
177177
]
178178
metadata-hash = ["node-subtensor-runtime/metadata-hash"]
179-
testnet = []

Diff for: justfile

-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,3 @@ lint:
5252
production:
5353
@echo "Running cargo build with metadata-hash generation..."
5454
cargo +{{RUSTV}} build --profile production --features="runtime-benchmarks metadata-hash"
55-
56-
testnet:
57-
@echo "Running cargo build with testnet config..."
58-
cargo +{{RUSTV}} build --profile production --features="runtime-benchmarks metadata-hash testnet"

Diff for: node/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,3 @@ try-runtime = [
107107
]
108108

109109
metadata-hash = ["node-subtensor-runtime/metadata-hash"]
110-
testnet = []

Diff for: pallets/subtensor/Cargo.toml

+3-6
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ hex = { workspace = true }
4545
pallet-collective = { version = "4.0.0-dev", default-features = false, path = "../collective" }
4646
pallet-membership = { workspace = true }
4747
hex-literal = { workspace = true }
48-
num-traits = { version = "0.2.19", default-features = false, features = [
49-
"libm",
50-
] }
48+
num-traits = { version = "0.2.19", default-features = false, features = ["libm"] }
5149

5250
[dev-dependencies]
5351
pallet-balances = { workspace = true, features = ["std"] }
@@ -91,7 +89,7 @@ std = [
9189
"serde_with/std",
9290
"substrate-fixed/std",
9391
"num-traits/std",
94-
"serde_json/std",
92+
"serde_json/std"
9593
]
9694
runtime-benchmarks = [
9795
"frame-benchmarking/runtime-benchmarks",
@@ -115,7 +113,6 @@ try-runtime = [
115113
"pallet-transaction-payment/try-runtime",
116114
"pallet-utility/try-runtime",
117115
"sp-runtime/try-runtime",
118-
"pallet-collective/try-runtime",
116+
"pallet-collective/try-runtime"
119117
]
120118
pow-faucet = []
121-
testnet = []

Diff for: pallets/subtensor/src/lib.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,10 @@ pub mod pallet {
187187
/// ============================
188188
189189
#[pallet::type_value]
190-
/// Total TAO Cap.
190+
/// Total Rao in circulation.
191191
pub fn TotalSupply<T: Config>() -> u64 {
192-
#[cfg(feature = "testnet")]
193-
{
194-
15_000_000_000_000_000_000
195-
}
196-
#[cfg(not(feature = "testnet"))]
197-
{
198-
21_000_000_000_000_000
199-
}
192+
21_000_000_000_000_000
200193
}
201-
202194
#[pallet::type_value]
203195
/// Default Delegate Take.
204196
pub fn DefaultDelegateTake<T: Config>() -> u16 {
@@ -673,8 +665,6 @@ pub mod pallet {
673665
/// separate accounting.
674666
#[pallet::storage] // --- ITEM ( total_issuance )
675667
pub type TotalIssuance<T> = StorageValue<_, u64, ValueQuery, DefaultTotalIssuance<T>>;
676-
#[pallet::storage] // --- ITEM ( total_supply )
677-
pub type TotalTaoSupplyCap<T> = StorageValue<_, u64, ValueQuery, TotalSupply<T>>;
678668
#[pallet::storage] // --- ITEM ( total_stake )
679669
pub type TotalStake<T> = StorageValue<_, u64, ValueQuery>;
680670
#[pallet::storage] // --- ITEM ( default_delegate_take )

Diff for: runtime/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,3 @@ try-runtime = [
207207
"pallet-registry/try-runtime",
208208
]
209209
metadata-hash = ["substrate-wasm-builder/metadata-hash"]
210-
testnet = []

Diff for: runtime/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
142142
// `spec_version`, and `authoring_version` are the same between Wasm and native.
143143
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
144144
// the compatible custom types.
145-
spec_version: 196,
145+
spec_version: 195,
146146
impl_version: 1,
147147
apis: RUNTIME_API_VERSIONS,
148148
transaction_version: 1,

Diff for: scripts/localnet.sh

+45-53
Original file line numberDiff line numberDiff line change
@@ -15,94 +15,86 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
1515
# The base directory of the subtensor project
1616
BASE_DIR="$SCRIPT_DIR/.."
1717

18-
# Get parameters
18+
# get parameters
19+
# Get the value of fast_blocks from the first argument
1920
fast_blocks=${1:-"True"}
20-
testnet=${2:-"Fale"}
21-
22-
# Initialize FEATURES
23-
FEATURES="pow-faucet runtime-benchmarks"
2421

2522
# Check the value of fast_blocks
26-
if [ "$fast_blocks" == "True" ]; then
27-
echo "fast_blocks is On"
28-
FEATURES+=" fast-blocks"
29-
else
30-
echo "fast_blocks is Off"
31-
fi
32-
33-
# Check the value of testnet
34-
if [ "$testnet" == "True" ]; then
35-
echo "testnet is On"
36-
FEATURES+=" testnet"
23+
if [ "$fast_blocks" == "False" ]; then
24+
# Block of code to execute if fast_blocks is False
25+
echo "fast_blocks is Off"
26+
: "${CHAIN:=local}"
27+
: "${BUILD_BINARY:=1}"
28+
: "${FEATURES:="pow-faucet runtime-benchmarks"}"
3729
else
38-
echo "testnet is Off"
30+
# Block of code to execute if fast_blocks is not False
31+
echo "fast_blocks is On"
32+
: "${CHAIN:=local}"
33+
: "${BUILD_BINARY:=1}"
34+
: "${FEATURES:="pow-faucet runtime-benchmarks fast-blocks"}"
3935
fi
4036

41-
: "${CHAIN:=local}"
42-
: "${BUILD_BINARY:=1}"
43-
4437
SPEC_PATH="${SCRIPT_DIR}/specs/"
4538
FULL_PATH="$SPEC_PATH$CHAIN.json"
4639

47-
4840
# Kill any existing nodes which may have not exited correctly after a previous
4941
# run.
5042
pkill -9 'node-subtensor'
5143

5244
if [ ! -d "$SPEC_PATH" ]; then
53-
echo "*** Creating directory ${SPEC_PATH}..."
54-
mkdir $SPEC_PATH
45+
echo "*** Creating directory ${SPEC_PATH}..."
46+
mkdir $SPEC_PATH
5547
fi
5648

5749
if [[ $BUILD_BINARY == "1" ]]; then
58-
echo "*** Building substrate binary..."
59-
cargo build --workspace --profile=release --features "$FEATURES" --manifest-path "$BASE_DIR/Cargo.toml"
60-
echo "*** Binary compiled"
50+
echo "*** Building substrate binary..."
51+
cargo build --workspace --profile=release --features "$FEATURES" --manifest-path "$BASE_DIR/Cargo.toml"
52+
echo "*** Binary compiled"
6153
fi
6254

6355
echo "*** Building chainspec..."
6456
"$BASE_DIR/target/release/node-subtensor" build-spec --disable-default-bootnode --raw --chain $CHAIN >$FULL_PATH
6557
echo "*** Chainspec built and output to file"
6658

6759
if [ $NO_PURGE -eq 1 ]; then
68-
echo "*** Purging previous state skipped..."
60+
echo "*** Purging previous state skipped..."
6961
else
70-
echo "*** Purging previous state..."
71-
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
72-
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
73-
echo "*** Previous chainstate purged"
62+
echo "*** Purging previous state..."
63+
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
64+
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
65+
echo "*** Previous chainstate purged"
7466
fi
7567

7668
echo "*** Starting localnet nodes..."
7769
alice_start=(
78-
"$BASE_DIR/target/release/node-subtensor"
79-
--base-path /tmp/alice
80-
--chain="$FULL_PATH"
81-
--alice
82-
--port 30334
83-
--rpc-port 9946
84-
--validator
85-
--rpc-cors=all
86-
--allow-private-ipv4
87-
--discover-local
70+
"$BASE_DIR/target/release/node-subtensor"
71+
--base-path /tmp/alice
72+
--chain="$FULL_PATH"
73+
--alice
74+
--port 30334
75+
--rpc-port 9946
76+
--validator
77+
--rpc-cors=all
78+
--allow-private-ipv4
79+
--discover-local
8880
)
8981

9082
bob_start=(
91-
"$BASE_DIR"/target/release/node-subtensor
92-
--base-path /tmp/bob
93-
--chain="$FULL_PATH"
94-
--bob
95-
--port 30335
96-
--rpc-port 9945
97-
--validator
98-
--allow-private-ipv4
99-
--discover-local
83+
"$BASE_DIR"/target/release/node-subtensor
84+
--base-path /tmp/bob
85+
--chain="$FULL_PATH"
86+
--bob
87+
--port 30335
88+
--rpc-port 9945
89+
--validator
90+
--allow-private-ipv4
91+
--discover-local
10092
)
10193

10294
trap 'pkill -P $$' EXIT SIGINT SIGTERM
10395

10496
(
105-
("${alice_start[@]}" 2>&1) &
106-
("${bob_start[@]}" 2>&1)
107-
wait
97+
("${alice_start[@]}" 2>&1) &
98+
("${bob_start[@]}" 2>&1)
99+
wait
108100
)

0 commit comments

Comments
 (0)