Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
776d886
add stake amount to priority
JohnReedV Feb 17, 2025
a0ffb6a
bring in utility pallet code
JohnReedV Feb 19, 2025
702ceb4
fix tests
JohnReedV Feb 19, 2025
67e23ef
fmt
JohnReedV Feb 19, 2025
9bdc8c6
skip adding weight if pays::no
JohnReedV Feb 19, 2025
abdb88b
address lints
JohnReedV Feb 19, 2025
cd90326
zepter
JohnReedV Feb 19, 2025
53154e4
Merge branch 'devnet-ready' into utility-pallet-fees
JohnReedV Feb 19, 2025
d237a0a
add types e2e test for evm
open-junius Mar 7, 2025
1c8e45a
fix comments
open-junius Mar 10, 2025
8ce14e1
update readme
open-junius Mar 10, 2025
4ef30b2
Merge branch 'devnet-ready' into feat/evm-typed-test
open-junius Mar 10, 2025
19be9c6
update test case name
open-junius Mar 10, 2025
6f3ce2c
EMA price halving period hyperparameter - in progress
gztensor Mar 10, 2025
ae4a15e
bring in proxy pallet code & skip pays::No
JohnReedV Mar 10, 2025
e28f934
address lints
JohnReedV Mar 10, 2025
d31e278
Add ema price period pallet type
gztensor Mar 10, 2025
0eedabe
lints
JohnReedV Mar 10, 2025
a0af732
Merge branch 'devnet-ready' into utility-pallet-fees
JohnReedV Mar 10, 2025
d75e442
Update chainspecs
JohnReedV Mar 10, 2025
470a73f
clippy
JohnReedV Mar 10, 2025
449bab0
Merge branch 'utility-pallet-fees' of github.com:opentensor/subtensor…
JohnReedV Mar 10, 2025
a8d1596
Split target folders for fast and non-fast block's chain
Mar 10, 2025
f293e46
Merge pull request #1388 from opentensor/feat/roman/split-targets-for…
sam0x17 Mar 11, 2025
def4b93
update readme
open-junius Mar 11, 2025
4892604
upgrade ring
open-junius Mar 11, 2025
0bf13a6
Add view specifier for stake getters in saking precompile
ales-otf Mar 11, 2025
194da70
Reformat
ales-otf Mar 11, 2025
0479ad1
Merge branch 'devnet-ready' into feat/ema-slowdown-hyperparam
gztensor Mar 11, 2025
b8cbd8d
Merge pull request #1390 from opentensor/fix/staking-precompile
sam0x17 Mar 11, 2025
9d018c0
Enforce ema price halving hyperparameter and add tests
gztensor Mar 11, 2025
cff4153
remove unnecessary subscription
open-junius Mar 11, 2025
c771436
Merge pull request #1374 from opentensor/feat/evm-typed-test
sam0x17 Mar 11, 2025
5903742
Merge pull request #1317 from opentensor/utility-pallet-fees
sam0x17 Mar 11, 2025
f19a566
Add flag `--build-only`
Mar 11, 2025
88df14e
Merge pull request #1393 from opentensor/feat/roman/add-flag-build-only
sam0x17 Mar 11, 2025
de04903
Update pallets/admin-utils/src/tests/mod.rs
gztensor Mar 11, 2025
47dacb6
Merge pull request #1313 from opentensor/staking-amount-priority
sam0x17 Mar 11, 2025
f6e6ee4
Merge pull request #1392 from opentensor/feat/ema-slowdown-hyperparam
sam0x17 Mar 11, 2025
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
4 changes: 4 additions & 0 deletions precompiles/src/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ where
}

#[precompile::public("getTotalColdkeyStake(bytes32)")]
#[precompile::view]
fn get_total_coldkey_stake(
_handle: &mut impl PrecompileHandle,
coldkey: H256,
Expand All @@ -131,6 +132,7 @@ where
}

#[precompile::public("getTotalHotkeyStake(bytes32)")]
#[precompile::view]
fn get_total_hotkey_stake(
_handle: &mut impl PrecompileHandle,
hotkey: H256,
Expand Down Expand Up @@ -275,6 +277,7 @@ where
}

#[precompile::public("getTotalColdkeyStake(bytes32)")]
#[precompile::view]
fn get_total_coldkey_stake(
_handle: &mut impl PrecompileHandle,
coldkey: H256,
Expand All @@ -292,6 +295,7 @@ where
}

#[precompile::public("getTotalHotkeyStake(bytes32)")]
#[precompile::view]
fn get_total_hotkey_stake(
_handle: &mut impl PrecompileHandle,
hotkey: H256,
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// `spec_version`, and `authoring_version` are the same between Wasm and native.
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
// the compatible custom types.
spec_version: 246,
spec_version: 247,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
32 changes: 17 additions & 15 deletions scripts/localnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,63 +15,66 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
# The base directory of the subtensor project
BASE_DIR="$SCRIPT_DIR/.."

# get parameters
# Get the value of fast_blocks from the first argument
fast_blocks=${1:-"True"}

# Check the value of fast_blocks
# Define the target directory for compilation
if [ "$fast_blocks" == "False" ]; then
# Block of code to execute if fast_blocks is False
echo "fast_blocks is Off"
: "${CHAIN:=local}"
: "${BUILD_BINARY:=1}"
: "${FEATURES:="pow-faucet"}"
BUILD_DIR="$BASE_DIR/target/non-fast-blocks"
else
# Block of code to execute if fast_blocks is not False
echo "fast_blocks is On"
: "${CHAIN:=local}"
: "${BUILD_BINARY:=1}"
: "${FEATURES:="pow-faucet fast-blocks"}"
BUILD_DIR="$BASE_DIR/target/fast-blocks"
fi

# Ensure the build directory exists
mkdir -p "$BUILD_DIR"

SPEC_PATH="${SCRIPT_DIR}/specs/"
FULL_PATH="$SPEC_PATH$CHAIN.json"

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

if [ ! -d "$SPEC_PATH" ]; then
echo "*** Creating directory ${SPEC_PATH}..."
mkdir $SPEC_PATH
mkdir -p "$SPEC_PATH"
fi

if [[ $BUILD_BINARY == "1" ]]; then
echo "*** Building substrate binary..."
cargo build --workspace --profile=release --features "$FEATURES" --manifest-path "$BASE_DIR/Cargo.toml"
CARGO_TARGET_DIR="$BUILD_DIR" cargo build --workspace --profile=release --features "$FEATURES" --manifest-path "$BASE_DIR/Cargo.toml"
echo "*** Binary compiled"
fi

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

# generate node keys
$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/alice
$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/bob
# Generate node keys
"$BUILD_DIR/release/node-subtensor" key generate-node-key --chain="$FULL_PATH" --base-path /tmp/alice
"$BUILD_DIR/release/node-subtensor" key generate-node-key --chain="$FULL_PATH" --base-path /tmp/bob

if [ $NO_PURGE -eq 1 ]; then
echo "*** Purging previous state skipped..."
else
echo "*** Purging previous state..."
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
"$BUILD_DIR/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
"$BUILD_DIR/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
echo "*** Previous chainstate purged"
fi

echo "*** Starting localnet nodes..."
alice_start=(
"$BASE_DIR/target/release/node-subtensor"
"$BUILD_DIR/release/node-subtensor"
--base-path /tmp/alice
--chain="$FULL_PATH"
--alice
Expand All @@ -85,7 +88,7 @@ alice_start=(
)

bob_start=(
"$BASE_DIR"/target/release/node-subtensor
"$BUILD_DIR/release/node-subtensor"
--base-path /tmp/bob
--chain="$FULL_PATH"
--bob
Expand All @@ -96,7 +99,6 @@ bob_start=(
--allow-private-ipv4
--discover-local
--unsafe-force-node-key-generation
# --offchain-worker=Never
)

trap 'pkill -P $$' EXIT SIGINT SIGTERM
Expand Down
Loading