Skip to content

Commit fbb64d3

Browse files
authored
0.7.4 pre (#248)
* feat: treasury transfer * refactor: some parameter adjustments * refactor: replace testnet chain spec
1 parent 0c1b261 commit fbb64d3

File tree

7 files changed

+123
-89
lines changed

7 files changed

+123
-89
lines changed

c-pallets/audit/src/constants.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// miner cpu use 50%.
22
pub(super) const SERVICE_PROVE_RATE: u128 = 25_165_824;
33
// miner cpu use 50%.
4-
pub(super) const IDLE_PROVE_RATE: u128 = 71_582_788;
4+
pub(super) const IDLE_PROVE_RATE: u128 = 572_662_304;
55

66
pub(super) const IDLE_VERIFY_RATE: u128 = 2_147_483_648;
77

c-pallets/audit/src/lib.rs

-15
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,6 @@ pub mod pallet {
339339
#[pallet::storage]
340340
#[pallet::getter(fn verify_slip)]
341341
pub(super) type VerifySlip<T: Config> = StorageDoubleMap<_, Blake2_128Concat, BlockNumberOf<T>, Blake2_128Concat, AccountOf<T>, bool>;
342-
// FOR TEST
343-
#[pallet::storage]
344-
#[pallet::getter(fn test_option_storage)]
345-
pub(super) type TestOptionStorageV3<T: Config> = StorageMap<_, Blake2_128Concat, u32, ProveInfoV2<T>>;
346342

347343
#[pallet::pallet]
348344
#[pallet::storage_version(STORAGE_VERSION)]
@@ -680,17 +676,6 @@ pub mod pallet {
680676
Ok(())
681677
}
682678
// FOR TEST
683-
#[pallet::call_index(8)]
684-
#[transactional]
685-
#[pallet::weight(Weight::zero())]
686-
pub fn test_insert_option(origin: OriginFor<T>, key: u32, value: ProveInfoV2<T> ) -> DispatchResult {
687-
let _sender = ensure_signed(origin)?;
688-
689-
TestOptionStorageV3::insert(key, value);
690-
691-
Ok(())
692-
}
693-
// FOR TEST
694679
#[pallet::call_index(9)]
695680
#[transactional]
696681
#[pallet::weight(Weight::zero())]

c-pallets/cess-treasury/src/lib.rs

+34
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,40 @@ pub mod pallet {
146146

147147
Ok(())
148148
}
149+
150+
#[pallet::call_index(4)]
151+
// FIX ME!
152+
#[pallet::weight(Weight::zero())]
153+
pub fn pid_send_funds(
154+
origin: OriginFor<T>,
155+
acc: AccountOf<T>,
156+
funds: BalanceOf<T>,
157+
) -> DispatchResult {
158+
let _ = ensure_root(origin)?;
159+
160+
let pid = T::PunishTreasuryId::get().into_account_truncating();
161+
162+
<T as pallet::Config>::Currency::transfer(&pid, &acc, funds, KeepAlive)?;
163+
164+
Ok(())
165+
}
166+
167+
#[pallet::call_index(5)]
168+
// FIX ME!
169+
#[pallet::weight(Weight::zero())]
170+
pub fn sid_send_funds(
171+
origin: OriginFor<T>,
172+
acc: AccountOf<T>,
173+
funds: BalanceOf<T>,
174+
) -> DispatchResult {
175+
let _ = ensure_root(origin)?;
176+
177+
let sid = T::SpaceTreasuryId::get().into_account_truncating();
178+
179+
<T as pallet::Config>::Currency::transfer(&sid, &acc, funds, KeepAlive)?;
180+
181+
Ok(())
182+
}
149183
}
150184
}
151185

c-pallets/file-bank/src/constants.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// The average number of bytes that a storage node can transmit within each block
2-
pub(super) const TRANSFER_RATE: u128 = 4_089_446;
2+
pub(super) const TRANSFER_RATE: u128 = 2_089_446;
33

4-
pub(super) const CALCULATE_RATE: u128 = 67_108_864;
4+
pub(super) const CALCULATE_RATE: u128 = 651_088;

c-pallets/file-bank/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ pub mod pallet {
671671
let max_needed_cal_space = (max_task_count as u32).checked_mul(FRAGMENT_SIZE as u32).ok_or(Error::<T>::Overflow)?;
672672
let mut life: u32 = (max_needed_cal_space / TRANSFER_RATE as u32).checked_add(11).ok_or(Error::<T>::Overflow)?;
673673
life = (max_needed_cal_space / CALCULATE_RATE as u32)
674-
.checked_add(10).ok_or(Error::<T>::Overflow)?
674+
.checked_add(30).ok_or(Error::<T>::Overflow)?
675675
.checked_add(life).ok_or(Error::<T>::Overflow)?;
676676
Self::start_second_task(deal_hash.0.to_vec(), deal_hash, life)?;
677677
if <Bucket<T>>::contains_key(&deal_info.user.user, &deal_info.user.bucket_name) {

node/ccg/cess-testnet-spec-raw.json

+83-68
Large diffs are not rendered by default.

node/src/chain_spec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use cess_node_runtime::{
44
BalancesConfig, Block, CouncilConfig, GenesisConfig, GrandpaConfig, ImOnlineConfig,
55
IndicesConfig, MaxNominations, BabeConfig, SessionConfig, Signature, StakerStatus,
66
StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig, DOLLARS,
7-
StorageHandlerConfig, SminerConfig,
7+
StorageHandlerConfig, SminerConfig, EVMChainIdConfig,
88
};
99

1010
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
@@ -579,6 +579,6 @@ fn testnet_genesis(
579579
ethereum: Default::default(),
580580
dynamic_fee: Default::default(),
581581
base_fee: Default::default(),
582-
evm_chain_id: Default::default(),
582+
evm_chain_id: EVMChainIdConfig { chain_id: 11330 },
583583
}
584584
}

0 commit comments

Comments
 (0)