From d0cc915cf71aa7aaefe9b0efd3a9a2e5e498b6f3 Mon Sep 17 00:00:00 2001 From: C H Date: Tue, 28 May 2024 15:00:23 +0800 Subject: [PATCH] Updated default networks size --- src/contract.rs | 26 +++----------------------- src/root.rs | 6 +++--- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 0b25b87..2e53e88 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -79,6 +79,7 @@ pub fn instantiate( NETWORK_LAST_LOCK_COST.save(deps.storage, &10_000_000_000)?; NETWORK_MIN_LOCK_COST.save(deps.storage, &10_000_000_000)?; NETWORK_LOCK_REDUCTION_INTERVAL.save(deps.storage, &(7 * 14400))?; + TOTAL_REWARDS.save(deps.storage, &0)?; // -- Root network initialization -- let root_netuid: u16 = 0; @@ -155,8 +156,8 @@ pub fn instantiate( REGISTRATIONS_THIS_INTERVAL.save(deps.storage, netuid, &0)?; POW_REGISTRATIONS_THIS_INTERVAL.save(deps.storage, netuid, &0)?; BURN_REGISTRATIONS_THIS_INTERVAL.save(deps.storage, netuid, &0)?; - MAX_ALLOWED_VALIDATORS.save(deps.storage, netuid, &64)?; - MAX_ALLOWED_UIDS.save(deps.storage, netuid, &256)?; + MAX_ALLOWED_VALIDATORS.save(deps.storage, netuid, &32)?; + MAX_ALLOWED_UIDS.save(deps.storage, netuid, &128)?; WEIGHTS_VERSION_KEY.save(deps.storage, netuid, &0)?; WEIGHTS_SET_RATE_LIMIT.save(deps.storage, netuid, &100)?; @@ -1012,26 +1013,5 @@ pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result>(); - - for item in metadata_old { - // let (uid, particle) = item.unwrap(); - let metadata = Metadata { - name: "empty".to_string(), - particle: item.1.to_string(), - description: "".to_string(), - logo: "".to_string(), - types: "".to_string(), - extra: "".to_string(), - }; - NETWORKS_METADATA.save(deps.storage, item.0, &metadata)?; - } - Ok(Response::new().add_attribute("action", "migrate")) } diff --git a/src/root.rs b/src/root.rs index 6a5fd5e..4e62371 100644 --- a/src/root.rs +++ b/src/root.rs @@ -582,7 +582,7 @@ pub fn do_root_register( // --- 13. Force all members on root to become a delegate. if !hotkey_is_delegate(deps.storage, &hotkey) { - delegate_hotkey(deps.storage, &hotkey, 11796); + delegate_hotkey(deps.storage, &hotkey, 13107); } // --- 14. Update the registration counters for both the block and interval. @@ -782,8 +782,8 @@ pub fn init_new_network( // --- 6. Set all default values **explicitly**. NETWORK_REGISTRATION_ALLOWED.save(store, netuid, &true)?; - MAX_ALLOWED_UIDS.save(store, netuid, &256)?; - MAX_ALLOWED_VALIDATORS.save(store, netuid, &64)?; + MAX_ALLOWED_UIDS.save(store, netuid, &128)?; + MAX_ALLOWED_VALIDATORS.save(store, netuid, &32)?; MIN_ALLOWED_WEIGHTS.save(store, netuid, &1)?; MAX_WEIGHTS_LIMIT.save(store, netuid, &u16::MAX)?; ADJUSTMENT_INTERVAL.save(store, netuid, &360)?;