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

Clean hot swap To Devnet #661

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b43bed6
draft: hotkey swap for senate
Jul 9, 2024
9d1f6c9
feat: remove schedule coldkey swap
Jul 12, 2024
90512c2
chore: fix tests
Jul 12, 2024
dd87bca
Merge branch 'fix/hotkeyswap_senate' into feat/remove_schedule_coldke…
Jul 12, 2024
606b771
fixes for network resumption
Jul 12, 2024
8ebcf2d
chore: bump spec
Jul 12, 2024
7b84d3c
fix: add back arbitration check
Jul 12, 2024
2455082
fix: hotkey
Jul 12, 2024
f49bb55
fix: coldkey arb swap hotkey
Jul 12, 2024
884a179
Merge pull request #631 from opentensor/feat/remove_schedule_coldkey_…
distributedstatemachine Jul 12, 2024
76f20ce
swap delegate stake also
camfairchild Jul 13, 2024
4ccb879
add test for this
camfairchild Jul 13, 2024
73533b9
swap over stakinghotkeys map
camfairchild Jul 13, 2024
c370aad
check map first
camfairchild Jul 13, 2024
9b8c0e4
add staking hotkeys test
camfairchild Jul 13, 2024
baec581
no take
camfairchild Jul 13, 2024
a84ac6b
keep old stake
camfairchild Jul 13, 2024
221d320
add check to test
camfairchild Jul 13, 2024
f9164fc
fix some tests
camfairchild Jul 13, 2024
2a14df7
fix delegate test
camfairchild Jul 13, 2024
b970f50
update staking hotekys maps
camfairchild Jul 13, 2024
ad57e2b
init
camfairchild Jul 13, 2024
1cc7d3c
comment out
camfairchild Jul 13, 2024
6dcd0a1
add admin swap
camfairchild Jul 13, 2024
f474112
fix swap
camfairchild Jul 13, 2024
b708c1d
..
camfairchild Jul 13, 2024
5b30256
hotkey staking maps fix
Jul 13, 2024
fc245f8
remove staking hotkeys
Jul 13, 2024
494796e
remove commented code
Jul 13, 2024
f041ed9
cargo fmt
sam0x17 Jul 13, 2024
54ec750
cargo fix --workspace
sam0x17 Jul 13, 2024
ca51109
bump spec_version to 165
sam0x17 Jul 13, 2024
4dafd88
swap hotkey benchmark removed
Jul 15, 2024
d95a7df
add migration and tests for total coldkey hotfix
Jul 15, 2024
5e6fc7e
adds new test for missing hotkey value
Jul 15, 2024
3c61aa8
bump migration values
Jul 15, 2024
ff23b6f
fmt
Jul 15, 2024
0c2ad41
Merge pull request #636 from opentensor/total_coldkey_migration
unconst Jul 15, 2024
b3fa487
feat: try runtime passing
Jul 16, 2024
8766c98
chore: remove commented code
Jul 16, 2024
92fc1f0
chore: make logs human readable
Jul 16, 2024
c255d92
chore: remove comments
Jul 16, 2024
0478596
Update pallets/subtensor/src/lib.rs
distributedstatemachine Jul 16, 2024
5adbbd9
Merge pull request #644 from opentensor/hotfix/storage_version_incons…
distributedstatemachine Jul 16, 2024
8f6e8d6
add test first
camfairchild Jul 16, 2024
f25bdda
clear map before rest of migration
camfairchild Jul 16, 2024
e009ff1
track weight for clear/removal
camfairchild Jul 16, 2024
480b1c5
add comment
camfairchild Jul 16, 2024
eb4a57c
rename test
camfairchild Jul 16, 2024
23f540c
add test for emission appends staking hotkeys map
camfairchild Jul 16, 2024
a2b8d70
Merge pull request #645 from opentensor/fix/total-coldkey-stake-migra…
distributedstatemachine Jul 16, 2024
07e46e3
initial
Jul 22, 2024
0432b53
add tests
Jul 22, 2024
7f938f7
tests pass
Jul 22, 2024
659b53c
clean the code
Jul 22, 2024
b8cfd6c
fix tests
Jul 22, 2024
6b6460d
clippy and fmt
Jul 22, 2024
d66cb46
Merge branch 'devnet-ready' into clean_hot_swap
unconst Jul 22, 2024
4ee6220
working
Jul 22, 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
39 changes: 19 additions & 20 deletions pallets/subtensor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ mod root;
mod serving;
mod staking;
mod swap;
mod swap_hotkey;
mod uids;
mod utils;
mod weights;
Expand Down Expand Up @@ -272,7 +273,7 @@ pub mod pallet {
}

#[pallet::storage]
pub(super) type SenateRequiredStakePercentage<T> =
pub type SenateRequiredStakePercentage<T> =
StorageValue<_, u64, ValueQuery, DefaultSenateRequiredStakePercentage<T>>;

/// ============================
Expand Down Expand Up @@ -367,7 +368,7 @@ pub mod pallet {
pub type TotalColdkeyStake<T: Config> =
StorageMap<_, Identity, T::AccountId, u64, ValueQuery, DefaultAccountTake<T>>;
#[pallet::storage]
/// MAP (hot, cold) --> stake | Returns a tuple (u64: stakes, u64: block_number)
/// MAP (hot, cold) --> u64, u64) | Returns a tuple (u64: stakes, u64: block_number)
pub type TotalHotkeyColdkeyStakesThisInterval<T: Config> = StorageDoubleMap<
_,
Identity,
Expand Down Expand Up @@ -796,15 +797,15 @@ pub mod pallet {
}

#[pallet::storage] // --- ITEM ( tx_rate_limit )
pub(super) type TxRateLimit<T> = StorageValue<_, u64, ValueQuery, DefaultTxRateLimit<T>>;
pub type TxRateLimit<T> = StorageValue<_, u64, ValueQuery, DefaultTxRateLimit<T>>;
#[pallet::storage] // --- ITEM ( tx_rate_limit )
pub(super) type TxDelegateTakeRateLimit<T> =
pub type TxDelegateTakeRateLimit<T> =
StorageValue<_, u64, ValueQuery, DefaultTxDelegateTakeRateLimit<T>>;
#[pallet::storage] // --- MAP ( key ) --> last_block
pub type LastTxBlock<T: Config> =
StorageMap<_, Identity, T::AccountId, u64, ValueQuery, DefaultLastTxBlock<T>>;
#[pallet::storage] // --- MAP ( key ) --> last_block
pub(super) type LastTxBlockDelegateTake<T: Config> =
pub type LastTxBlockDelegateTake<T: Config> =
StorageMap<_, Identity, T::AccountId, u64, ValueQuery, DefaultLastTxBlock<T>>;

/// Default value for serving rate limit.
Expand Down Expand Up @@ -1084,41 +1085,39 @@ pub mod pallet {
StorageMap<_, Identity, u16, Vec<(T::AccountId, u64, u64)>, OptionQuery>;

#[pallet::storage] // --- DMAP ( netuid ) --> active
pub(super) type Active<T: Config> =
pub type Active<T: Config> =
StorageMap<_, Identity, u16, Vec<bool>, ValueQuery, EmptyBoolVec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> rank
pub(super) type Rank<T: Config> =
StorageMap<_, Identity, u16, Vec<u16>, ValueQuery, EmptyU16Vec<T>>;
pub type Rank<T: Config> = StorageMap<_, Identity, u16, Vec<u16>, ValueQuery, EmptyU16Vec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> trust
pub(super) type Trust<T: Config> =
StorageMap<_, Identity, u16, Vec<u16>, ValueQuery, EmptyU16Vec<T>>;
pub type Trust<T: Config> = StorageMap<_, Identity, u16, Vec<u16>, ValueQuery, EmptyU16Vec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> consensus
pub(super) type Consensus<T: Config> =
pub type Consensus<T: Config> =
StorageMap<_, Identity, u16, Vec<u16>, ValueQuery, EmptyU16Vec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> incentive
pub(super) type Incentive<T: Config> =
pub type Incentive<T: Config> =
StorageMap<_, Identity, u16, Vec<u16>, ValueQuery, EmptyU16Vec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> dividends
pub(super) type Dividends<T: Config> =
pub type Dividends<T: Config> =
StorageMap<_, Identity, u16, Vec<u16>, ValueQuery, EmptyU16Vec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> emission
pub(super) type Emission<T: Config> =
pub type Emission<T: Config> =
StorageMap<_, Identity, u16, Vec<u64>, ValueQuery, EmptyU64Vec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> last_update
pub(super) type LastUpdate<T: Config> =
pub type LastUpdate<T: Config> =
StorageMap<_, Identity, u16, Vec<u64>, ValueQuery, EmptyU64Vec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> validator_trust
pub(super) type ValidatorTrust<T: Config> =
pub type ValidatorTrust<T: Config> =
StorageMap<_, Identity, u16, Vec<u16>, ValueQuery, EmptyU16Vec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> pruning_scores
pub(super) type PruningScores<T: Config> =
pub type PruningScores<T: Config> =
StorageMap<_, Identity, u16, Vec<u16>, ValueQuery, EmptyU16Vec<T>>;
#[pallet::storage] // --- DMAP ( netuid ) --> validator_permit
pub(super) type ValidatorPermit<T: Config> =
pub type ValidatorPermit<T: Config> =
StorageMap<_, Identity, u16, Vec<bool>, ValueQuery, EmptyBoolVec<T>>;

#[pallet::storage] // --- DMAP ( netuid, uid ) --> weights
pub(super) type Weights<T: Config> = StorageDoubleMap<
pub type Weights<T: Config> = StorageDoubleMap<
_,
Identity,
u16,
Expand All @@ -1129,7 +1128,7 @@ pub mod pallet {
DefaultWeights<T>,
>;
#[pallet::storage] // --- DMAP ( netuid, uid ) --> bonds
pub(super) type Bonds<T: Config> = StorageDoubleMap<
pub type Bonds<T: Config> = StorageDoubleMap<
_,
Identity,
u16,
Expand Down
Loading
Loading