Skip to content

Commit

Permalink
mainnet and alphanet final (#311)
Browse files Browse the repository at this point in the history
* mainnet and alphanet final

* update gitmodules
  • Loading branch information
Immanuel-john authored Sep 14, 2023
1 parent 522b733 commit d4f3371
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 144 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "ternoa-pallets"]
path = ternoa-pallets
url = https://github.com/capsule-corp-ternoa/ternoa-pallets
branch = tee-staking
2 changes: 1 addition & 1 deletion runtime/alphanet/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
/// Version of the runtime specification. A full-node will not attempt to use its native
/// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`,
/// `spec_version` and `authoring_version` are the same between Wasm and native.
spec_version: 16,
spec_version: 20,

/// Version of the implementation of the specification. Nodes are free to ignore this; it
/// serves only as an indication that the code is different; as long as the other two versions
Expand Down
182 changes: 112 additions & 70 deletions runtime/alphanet/src/weights/ternoa_tee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,149 +31,191 @@ use sp_std::marker::PhantomData;
/// Weight functions for `ternoa_tee`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> ternoa_tee::WeightInfo for WeightInfo<T> {
// Storage: TEE EnclaveRegistrations (r:1 w:1)
// Storage: TEE EnclaveRegistrations (r:1 w:1)
// Storage: TEE EnclaveData (r:1 w:0)
// Storage: TEE EnclaveAccountOperator (r:1 w:0)
// Storage: TEE StakingAmount (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: TEE StakingLedger (r:0 w:1)
fn register_enclave() -> Weight {
Weight::from_ref_time(82_930_000 as u64)
fn register_enclave() -> Weight {
Weight::from_ref_time(86_901_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: TEE StakingAmount (r:1 w:0)
// Storage: TEE EnclaveData (r:1 w:0)
// Storage: TEE StakingLedger (r:0 w:1)
// Storage: TEE EnclaveUnregistrations (r:1 w:1)
// Storage: TEE StakingLedger (r:1 w:1)
fn unregister_enclave() -> Weight {
Weight::from_ref_time(107_941_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
Weight::from_ref_time(57_690_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: TEE EnclaveData (r:1 w:0)
// Storage: TEE EnclaveUpdates (r:1 w:1)
// Storage: TEE EnclaveAccountOperator (r:1 w:0)
fn update_enclave() -> Weight {
Weight::from_ref_time(65_591_000 as u64)
Weight::from_ref_time(50_160_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE EnclaveUpdates (r:1 w:1)
fn cancel_update() -> Weight {
Weight::from_ref_time(50_530_000 as u64)
Weight::from_ref_time(38_901_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE EnclaveRegistrations (r:1 w:1)
// Storage: TEE ClusterData (r:1 w:1)
// Storage: TEE EnclaveAccountOperator (r:1 w:1)
// Storage: TEE EnclaveData (r:1 w:1)
// Storage: Staking ActiveEra (r:1 w:0)
// Storage: TEE OperatorAssignedEra (r:0 w:1)
// Storage: TEE EnclaveClusterId (r:0 w:1)
fn assign_enclave() -> Weight {
Weight::from_ref_time(135_892_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: TEE EnclaveRegistrations (r:1 w:1)
fn remove_registration() -> Weight {
Weight::from_ref_time(80_101_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE EnclaveUpdates (r:1 w:1)
fn remove_update() -> Weight {
Weight::from_ref_time(49_860_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
Weight::from_ref_time(67_690_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: TEE EnclaveRegistrations (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn remove_registration() -> Weight {
Weight::from_ref_time(64_001_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: TEE EnclaveUpdates (r:1 w:1)
fn reject_update() -> Weight {
Weight::from_ref_time(37_450_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE EnclaveData (r:1 w:1)
// Storage: TEE EnclaveAccountOperator (r:1 w:1)
// Storage: TEE EnclaveClusterId (r:1 w:1)
// Storage: TEE ClusterData (r:1 w:1)
// Storage: TEE EnclaveUpdates (r:1 w:1)
fn remove_enclave() -> Weight {
Weight::from_ref_time(80_180_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: TEE EnclaveData (r:1 w:1)
// Storage: TEE EnclaveAccountOperator (r:1 w:1)
// Storage: TEE EnclaveUpdates (r:1 w:1)
fn force_update_enclave() -> Weight {
Weight::from_ref_time(50_281_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: TEE NextClusterId (r:1 w:1)
// Storage: TEE ClusterData (r:0 w:1)
fn create_cluster() -> Weight {
Weight::from_ref_time(29_040_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: TEE ClusterData (r:1 w:1)
fn update_cluster() -> Weight {
Weight::from_ref_time(29_500_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE ClusterData (r:1 w:1)
fn remove_cluster() -> Weight {
Weight::from_ref_time(29_070_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE StakingLedger (r:1 w:1)
fn force_remove_enclave() -> Weight {
Weight::from_ref_time(183_441_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(8 as u64))
}
// Storage: TEE EnclaveData (r:1 w:1)
// Storage: TEE EnclaveAccountOperator (r:1 w:1)
// Storage: TEE EnclaveUpdates (r:1 w:1)
fn force_update_enclave() -> Weight {
Weight::from_ref_time(75_411_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: TEE NextClusterId (r:1 w:1)
// Storage: TEE ClusterData (r:0 w:1)
fn create_cluster() -> Weight {
Weight::from_ref_time(41_310_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: TEE ClusterData (r:1 w:1)
fn update_cluster() -> Weight {
Weight::from_ref_time(30_350_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE ClusterData (r:1 w:1)
fn remove_cluster() -> Weight {
Weight::from_ref_time(29_691_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE StakingLedger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: TEE StakingAmount (r:1 w:0)
fn withdraw_unbonded() -> Weight {
Weight::from_ref_time(131_891_000 as u64)
Weight::from_ref_time(59_530_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: TEE MetricsServers (r:1 w:1)
fn register_metrics_server() -> Weight {
Weight::from_ref_time(69_001_000 as u64)
Weight::from_ref_time(30_801_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE MetricsServers (r:1 w:1)
fn unregister_metrics_server() -> Weight {
Weight::from_ref_time(36_381_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE MetricsServers (r:1 w:1)
fn force_update_metrics_server_type() -> Weight {
Weight::from_ref_time(36_470_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE MetricsServers (r:1 w:0)
// Storage: TEE EnclaveData (r:1 w:0)
// Storage: Staking ActiveEra (r:1 w:0)
// Storage: TEE MetricsReports (r:1 w:1)
fn submit_metrics_server_report() -> Weight {
Weight::from_ref_time(70_251_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
Weight::from_ref_time(58_101_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE ReportParamsWeightages (r:0 w:1)
fn set_report_params_weightage() -> Weight {
Weight::from_ref_time(31_831_000 as u64)
Weight::from_ref_time(32_190_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE StakingAmount (r:0 w:1)
fn set_staking_amount() -> Weight {
Weight::from_ref_time(31_430_000 as u64)
Weight::from_ref_time(32_220_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE DailyRewardPool (r:0 w:1)
fn set_daily_reward_pool() -> Weight {
Weight::from_ref_time(31_501_000 as u64)
Weight::from_ref_time(32_201_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE ClaimedRewards (r:1 w:1)
// Storage: Staking ActiveEra (r:1 w:0)
// Storage: TEE OperatorAssignedEra (r:1 w:0)
// Storage: TEE EnclaveData (r:2 w:0)
// Storage: TEE DailyRewardPool (r:1 w:0)
// Storage: TEE MetricsReports (r:1 w:0)
// Storage: System Account (r:2 w:2)
// Storage: TEE ClaimedRewards (r:0 w:1)
fn claim_rewards() -> Weight {
Weight::from_ref_time(102_370_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
Weight::from_ref_time(154_782_000 as u64)
.saturating_add(T::DbWeight::get().reads(9 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
fn unregister_metrics_server() -> Weight { todo!() }
fn force_update_metrics_server_type() -> Weight { todo!() }
// Storage: TEE OperatorAssignedEra (r:1 w:1)
fn update_operator_assigned_era() -> Weight {
Weight::from_ref_time(37_040_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: TEE StakingAmount (r:1 w:0)
// Storage: TEE StakingLedger (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn bond_extra() -> Weight {
Weight::from_ref_time(73_730_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: TEE StakingAmount (r:1 w:0)
// Storage: TEE StakingLedger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn refund_excess() -> Weight {
Weight::from_ref_time(68_810_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}

}

2 changes: 1 addition & 1 deletion runtime/mainnet/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
/// Version of the runtime specification. A full-node will not attempt to use its native
/// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`,
/// `spec_version` and `authoring_version` are the same between Wasm and native.
spec_version: 16,
spec_version: 20,

/// Version of the implementation of the specification. Nodes are free to ignore this; it
/// serves only as an indication that the code is different; as long as the other two versions
Expand Down
Loading

0 comments on commit d4f3371

Please sign in to comment.