Skip to content

Commit e1de749

Browse files
committed
Merge remote-tracking branch 'origin/main' into pot-avx512f+vaes
# Conflicts: # crates/subspace-proof-of-time/src/aes/x86_64.rs
2 parents 7a1ed14 + 20ce4d9 commit e1de749

File tree

391 files changed

+2740
-2803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+2740
-2803
lines changed

Cargo.lock

Lines changed: 6 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[workspace.package]
2+
edition = "2024"
3+
14
[workspace]
25
resolver = "2"
36
members = [
@@ -33,7 +36,7 @@ base58 = "0.2.0"
3336
bip39 = "2.0.0"
3437
bitvec = "1.0.1"
3538
blake2 = { version = "0.10.6", default-features = false }
36-
blake3 = { version = "1.5.4", default-features = false }
39+
blake3 = { version = "1.8.2", default-features = false }
3740
blst = "0.3.13"
3841
bytes = { version = "1.7.2", default-features = false }
3942
bytesize = "1.3.0"
@@ -88,7 +91,6 @@ futures-timer = "3.0.3"
8891
hash-db = { version = "0.16.0", default-features = false }
8992
hex = { version = "0.4.3", default-features = false }
9093
hex-literal = "0.4.1"
91-
hexlit = "0.5.5"
9294
hwlocality = "1.0.0-alpha.6"
9395
jsonrpsee = "0.24.5"
9496
kzg = { git = "https://github.com/grandinetech/rust-kzg", rev = "6c8fcc623df3d7e8c0f30951a49bfea764f90bf4", default-features = false }

crates/pallet-domains/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "pallet-domains"
33
version = "0.1.0"
44
authors = ["Subspace Labs <https://subspace.network>"]
5-
edition = "2021"
5+
edition.workspace = true
66
license = "0BSD"
77
homepage = "https://subspace.network"
88
repository = "https://github.com/autonomys/subspace"
@@ -17,7 +17,6 @@ domain-runtime-primitives.workspace = true
1717
frame-benchmarking = { workspace = true, optional = true }
1818
frame-support.workspace = true
1919
frame-system.workspace = true
20-
hexlit.workspace = true
2120
hex-literal = { workspace = true, optional = true }
2221
log.workspace = true
2322
pallet-balances.workspace = true

crates/pallet-domains/src/benchmarking.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,49 @@
33
extern crate alloc;
44

55
use super::*;
6-
use crate::block_tree::{prune_receipt, BlockTreeNode};
6+
use crate::block_tree::{BlockTreeNode, prune_receipt};
77
use crate::bundle_storage_fund::refund_storage_fee;
8-
use crate::domain_registry::{into_domain_config, DomainConfigParams};
8+
use crate::domain_registry::{DomainConfigParams, into_domain_config};
99
use crate::runtime_registry::DomainRuntimeUpgradeEntry;
1010
use crate::staking::{
11-
do_convert_previous_epoch_withdrawal, do_mark_operators_as_slashed, do_reward_operators,
1211
Error as StakingError, OperatorConfig, OperatorStatus, WithdrawStake,
12+
do_convert_previous_epoch_withdrawal, do_mark_operators_as_slashed, do_reward_operators,
1313
};
1414
use crate::staking_epoch::{
1515
do_finalize_domain_current_epoch, do_finalize_domain_epoch_staking, do_slash_operator,
1616
operator_take_reward_tax_and_stake,
1717
};
1818
use crate::{
19-
DomainBlockNumberFor, ExecutionReceiptOf, Pallet as Domains, RawOrigin as DomainOrigin,
20-
MAX_NOMINATORS_TO_SLASH,
19+
DomainBlockNumberFor, ExecutionReceiptOf, MAX_NOMINATORS_TO_SLASH, Pallet as Domains,
20+
RawOrigin as DomainOrigin,
2121
};
2222
#[cfg(not(feature = "std"))]
2323
use alloc::borrow::ToOwned;
2424
#[cfg(not(feature = "std"))]
2525
use alloc::vec::Vec;
2626
use frame_benchmarking::v2::*;
2727
use frame_support::assert_ok;
28-
use frame_support::traits::fungible::{Inspect, Mutate};
2928
use frame_support::traits::Hooks;
29+
use frame_support::traits::fungible::{Inspect, Mutate};
3030
use frame_system::{Pallet as System, RawOrigin};
3131
use hex_literal::hex;
3232
use pallet_subspace::BlockRandomness;
3333
use sp_consensus_slots::Slot;
34+
use sp_core::H256;
3435
use sp_core::crypto::{Ss58Codec, UncheckedFrom};
3536
use sp_core::sr25519::vrf::{VrfPreOutput, VrfProof, VrfSignature};
36-
use sp_core::H256;
3737
use sp_domains::merkle_tree::MerkleTree;
3838
use sp_domains::{
39-
dummy_opaque_bundle, BundleHeader, DomainId, ExecutionReceipt, OpaqueBundle, OperatorAllowList,
40-
OperatorId, OperatorPublicKey, OperatorRewardSource, OperatorSignature,
39+
BundleHeader, DomainId, EMPTY_EXTRINSIC_ROOT, ExecutionReceipt, OpaqueBundle,
40+
OperatorAllowList, OperatorId, OperatorPublicKey, OperatorRewardSource, OperatorSignature,
4141
PermissionedActionAllowedBy, ProofOfElection, RuntimeType, SealedBundleHeader,
42-
SealedSingletonReceipt, SingletonReceipt, EMPTY_EXTRINSIC_ROOT,
42+
SealedSingletonReceipt, SingletonReceipt, dummy_opaque_bundle,
4343
};
4444
use sp_domains_fraud_proof::fraud_proof::FraudProof;
4545
use sp_runtime::traits::{CheckedAdd, One, Zero};
4646
use sp_std::collections::btree_set::BTreeSet;
47-
use subspace_core_primitives::pot::PotOutput;
4847
use subspace_core_primitives::Randomness;
48+
use subspace_core_primitives::pot::PotOutput;
4949

5050
const SEED: u32 = 0;
5151
const MAX_NOMINATORS_TO_SLASH_WITHOUT_OPERATOR: u32 = MAX_NOMINATORS_TO_SLASH - 1;

crates/pallet-domains/src/block_tree.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212
};
1313
#[cfg(not(feature = "std"))]
1414
use alloc::vec::Vec;
15-
use frame_support::{ensure, PalletError};
15+
use frame_support::{PalletError, ensure};
1616
use frame_system::pallet_prelude::BlockNumberFor;
1717
use parity_scale_codec::{Decode, Encode};
1818
use scale_info::TypeInfo;
@@ -629,9 +629,10 @@ pub(crate) fn prune_receipt<T: Config>(
629629
mod tests {
630630
use super::*;
631631
use crate::tests::{
632-
create_dummy_bundle_with_receipts, create_dummy_receipt, extend_block_tree,
633-
extend_block_tree_from_zero, get_block_tree_node_at, new_test_ext_with_extensions,
634-
register_genesis_domain, run_to_block, BlockTreePruningDepth, Domains, Test,
632+
BlockTreePruningDepth, Domains, Test, create_dummy_bundle_with_receipts,
633+
create_dummy_receipt, extend_block_tree, extend_block_tree_from_zero,
634+
get_block_tree_node_at, new_test_ext_with_extensions, register_genesis_domain,
635+
run_to_block,
635636
};
636637
use crate::{FrozenDomains, RawOrigin as DomainOrigin};
637638
use frame_support::dispatch::RawOrigin;
@@ -781,11 +782,10 @@ mod tests {
781782
verify_execution_receipt::<Test>(domain_id, &pruned_receipt),
782783
Error::PrunedReceipt
783784
);
784-
assert!(ConsensusBlockHash::<Test>::get(
785-
domain_id,
786-
pruned_receipt.consensus_block_number,
787-
)
788-
.is_none());
785+
assert!(
786+
ConsensusBlockHash::<Test>::get(domain_id, pruned_receipt.consensus_block_number,)
787+
.is_none()
788+
);
789789
});
790790
}
791791

@@ -1091,11 +1091,13 @@ mod tests {
10911091
let mut invalid_execution_trace_receipt = next_receipt;
10921092

10931093
// Receipt with only one element in execution trace vector
1094-
invalid_execution_trace_receipt.execution_trace = vec![invalid_execution_trace_receipt
1095-
.execution_trace
1096-
.first()
1097-
.cloned()
1098-
.expect("First element should be there; qed")];
1094+
invalid_execution_trace_receipt.execution_trace = vec![
1095+
invalid_execution_trace_receipt
1096+
.execution_trace
1097+
.first()
1098+
.cloned()
1099+
.expect("First element should be there; qed"),
1100+
];
10991101
assert_err!(
11001102
verify_execution_receipt::<Test>(domain_id, &invalid_execution_trace_receipt),
11011103
Error::InvalidExecutionTrace

crates/pallet-domains/src/bundle_storage_fund.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
use crate::staking::NewDeposit;
44
use crate::staking_epoch::mint_into_treasury;
55
use crate::{BalanceOf, Config, Event, HoldIdentifier, Operators, Pallet};
6+
use frame_support::PalletError;
7+
use frame_support::traits::Get;
68
use frame_support::traits::fungible::{Inspect, Mutate, MutateHold};
79
use frame_support::traits::tokens::{Fortitude, Precision, Preservation};
8-
use frame_support::traits::Get;
9-
use frame_support::PalletError;
1010
use parity_scale_codec::{Decode, Encode};
1111
use scale_info::TypeInfo;
1212
use sp_domains::OperatorId;
13-
use sp_runtime::traits::{AccountIdConversion, CheckedSub, Zero};
1413
use sp_runtime::Perbill;
14+
use sp_runtime::traits::{AccountIdConversion, CheckedSub, Zero};
1515
use sp_std::collections::btree_map::BTreeMap;
1616
use subspace_runtime_primitives::StorageFee;
1717

@@ -86,7 +86,6 @@ pub fn charge_bundle_storage_fee<T: Config>(
8686
) {
8787
let total_balance = total_balance::<T>(operator_id);
8888
log::debug!(
89-
target: "runtime::domains",
9089
"Operator {operator_id:?} unable to pay for the bundle storage fee {storage_fee:?}, storage fund total balance {total_balance:?}, err {err:?}",
9190
);
9291
return Err(Error::BundleStorageFeePayment);

crates/pallet-domains/src/domain_registry.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::pallet::{DomainStakingSummary, NextEVMChainId};
88
use crate::runtime_registry::DomainRuntimeInfo;
99
use crate::staking::StakingSummary;
1010
use crate::{
11-
into_complete_raw_genesis, BalanceOf, Config, DomainHashingFor, DomainRegistry,
12-
DomainSudoCalls, ExecutionReceiptOf, HoldIdentifier, NextDomainId, RuntimeRegistry,
11+
BalanceOf, Config, DomainHashingFor, DomainRegistry, DomainSudoCalls, ExecutionReceiptOf,
12+
HoldIdentifier, NextDomainId, RuntimeRegistry, into_complete_raw_genesis,
1313
};
1414
#[cfg(not(feature = "std"))]
1515
use alloc::string::String;
@@ -19,18 +19,18 @@ use domain_runtime_primitives::MultiAccountId;
1919
use frame_support::traits::fungible::{Inspect, Mutate, MutateHold};
2020
use frame_support::traits::tokens::{Fortitude, Precision, Preservation};
2121
use frame_support::weights::Weight;
22-
use frame_support::{ensure, PalletError};
22+
use frame_support::{PalletError, ensure};
2323
use frame_system::pallet_prelude::*;
2424
use parity_scale_codec::{Decode, Encode};
2525
use scale_info::TypeInfo;
2626
use sp_core::Get;
2727
use sp_domains::{
28-
calculate_max_bundle_weight_and_size, derive_domain_block_hash, DomainBundleLimit, DomainId,
29-
DomainRuntimeConfig, DomainSudoCall, DomainsDigestItem, DomainsTransfersTracker,
30-
OnDomainInstantiated, OperatorAllowList, RuntimeId, RuntimeType,
28+
DomainBundleLimit, DomainId, DomainRuntimeConfig, DomainSudoCall, DomainsDigestItem,
29+
DomainsTransfersTracker, OnDomainInstantiated, OperatorAllowList, RuntimeId, RuntimeType,
30+
calculate_max_bundle_weight_and_size, derive_domain_block_hash,
3131
};
32-
use sp_runtime::traits::{CheckedAdd, Zero};
3332
use sp_runtime::DigestItem;
33+
use sp_runtime::traits::{CheckedAdd, Zero};
3434
use sp_std::collections::btree_map::BTreeMap;
3535
use sp_std::collections::btree_set::BTreeSet;
3636

@@ -384,7 +384,7 @@ pub(crate) fn do_update_domain_allow_list<T: Config>(
384384
#[cfg(test)]
385385
mod tests {
386386
use super::*;
387-
use crate::tests::{new_test_ext, Test};
387+
use crate::tests::{TEST_RUNTIME_APIS, Test, new_test_ext};
388388
use domain_runtime_primitives::{AccountId20, AccountId20Converter};
389389
use frame_support::traits::Currency;
390390
use frame_support::{assert_err, assert_ok};
@@ -393,7 +393,7 @@ mod tests {
393393
use sp_domains::{EvmDomainRuntimeConfig, EvmType, PermissionedActionAllowedBy, RuntimeObject};
394394
use sp_runtime::traits::Convert;
395395
use sp_std::vec;
396-
use sp_version::RuntimeVersion;
396+
use sp_version::{RuntimeVersion, create_apis_vec};
397397
use subspace_runtime_primitives::SSC;
398398

399399
type Balances = pallet_balances::Pallet<Test>;
@@ -470,6 +470,7 @@ mod tests {
470470
spec_version: 1,
471471
impl_version: 1,
472472
transaction_version: 1,
473+
apis: create_apis_vec!(TEST_RUNTIME_APIS),
473474
..Default::default()
474475
},
475476
created_at: Default::default(),
@@ -591,6 +592,7 @@ mod tests {
591592
spec_version: 1,
592593
impl_version: 1,
593594
transaction_version: 1,
595+
apis: create_apis_vec!(TEST_RUNTIME_APIS),
594596
..Default::default()
595597
},
596598
created_at: Default::default(),
@@ -763,6 +765,7 @@ mod tests {
763765
spec_version: 1,
764766
impl_version: 1,
765767
transaction_version: 1,
768+
apis: create_apis_vec!(TEST_RUNTIME_APIS),
766769
..Default::default()
767770
},
768771
created_at: Default::default(),

crates/pallet-domains/src/extensions.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use frame_support::weights::Weight;
88
use frame_system::pallet_prelude::RuntimeCallFor;
99
use parity_scale_codec::{Decode, Encode};
1010
use scale_info::prelude::fmt;
11-
use sp_domains_fraud_proof::weights::fraud_proof_verification_weights;
1211
use sp_domains_fraud_proof::InvalidTransactionCode;
12+
use sp_domains_fraud_proof::weights::fraud_proof_verification_weights;
1313
use sp_runtime::impl_tx_ext_default;
1414
use sp_runtime::traits::{
1515
AsSystemOriginSigner, DispatchInfoOf, DispatchOriginOf, Dispatchable, Get, Implication,
@@ -109,10 +109,7 @@ where
109109
} else {
110110
let (tag, priority) = match Domains::<Runtime>::validate_fraud_proof(fraud_proof) {
111111
Err(e) => {
112-
log::warn!(
113-
target: "runtime::domains",
114-
"Bad fraud proof {fraud_proof:?}, error: {e:?}",
115-
);
112+
log::warn!("Bad fraud proof {fraud_proof:?}, error: {e:?}",);
116113
return InvalidTransactionCode::FraudProof.into();
117114
}
118115
Ok(tp) => tp,

0 commit comments

Comments
 (0)