@@ -31,7 +31,6 @@ use primitives::v1::{
31
31
InboundDownwardMessage , InboundHrmpMessage , SessionInfo ,
32
32
} ;
33
33
use runtime_common:: {
34
- mmr as mmr_common,
35
34
SlowAdjustingFeeUpdate , CurrencyToVote ,
36
35
impls:: ToAuthor ,
37
36
BlockHashCount , BlockWeights , BlockLength , RocksDbWeight ,
@@ -43,7 +42,7 @@ use sp_runtime::{
43
42
ApplyExtrinsicResult , KeyTypeId , Perbill , curve:: PiecewiseLinear ,
44
43
transaction_validity:: { TransactionValidity , TransactionSource , TransactionPriority } ,
45
44
traits:: {
46
- Keccak256 , BlakeTwo256 , Block as BlockT , OpaqueKeys , ConvertInto , AccountIdLookup ,
45
+ BlakeTwo256 , Block as BlockT , OpaqueKeys , ConvertInto , AccountIdLookup ,
47
46
Extrinsic as ExtrinsicT , SaturatedConversion , Verify ,
48
47
} ,
49
48
} ;
@@ -91,7 +90,6 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
91
90
spec_name : create_runtime_str ! ( "westend" ) ,
92
91
impl_name : create_runtime_str ! ( "parity-westend" ) ,
93
92
authoring_version : 2 ,
94
- // NOTE: see https://github.com/paritytech/polkadot/wiki/Westend
95
93
spec_version : 51 ,
96
94
impl_version : 0 ,
97
95
#[ cfg( not( feature = "disable-runtime-api" ) ) ]
@@ -269,18 +267,6 @@ parameter_types! {
269
267
pub const Offset : BlockNumber = 0 ;
270
268
}
271
269
272
- // TODO [ToDr] Remove while BEEFY runtime upgrade is done.
273
- impl_opaque_keys ! {
274
- pub struct OldSessionKeys {
275
- pub grandpa: Grandpa ,
276
- pub babe: Babe ,
277
- pub im_online: ImOnline ,
278
- pub para_validator: ParachainSessionKeyPlaceholder <Runtime >,
279
- pub para_assignment: AssignmentSessionKeyPlaceholder <Runtime >,
280
- pub authority_discovery: AuthorityDiscovery ,
281
- }
282
- }
283
-
284
270
impl_opaque_keys ! {
285
271
pub struct SessionKeys {
286
272
pub grandpa: Grandpa ,
@@ -289,28 +275,6 @@ impl_opaque_keys! {
289
275
pub para_validator: ParachainSessionKeyPlaceholder <Runtime >,
290
276
pub para_assignment: AssignmentSessionKeyPlaceholder <Runtime >,
291
277
pub authority_discovery: AuthorityDiscovery ,
292
- pub beefy: Beefy ,
293
- }
294
- }
295
-
296
- fn transform_session_keys ( v : AccountId , old : OldSessionKeys ) -> SessionKeys {
297
- SessionKeys {
298
- grandpa : old. grandpa ,
299
- babe : old. babe ,
300
- im_online : old. im_online ,
301
- para_validator : old. para_validator ,
302
- para_assignment : old. para_assignment ,
303
- authority_discovery : old. authority_discovery ,
304
- beefy : runtime_common:: dummy_beefy_id_from_account_id ( v) ,
305
- }
306
- }
307
-
308
- // When this is removed, should also remove `OldSessionKeys`.
309
- pub struct UpgradeSessionKeys ;
310
- impl frame_support:: traits:: OnRuntimeUpgrade for UpgradeSessionKeys {
311
- fn on_runtime_upgrade ( ) -> frame_support:: weights:: Weight {
312
- Session :: upgrade_keys :: < OldSessionKeys , _ > ( transform_session_keys) ;
313
- Perbill :: from_percent ( 50 ) * BlockWeights :: get ( ) . max_block
314
278
}
315
279
}
316
280
@@ -622,24 +586,6 @@ impl pallet_sudo::Config for Runtime {
622
586
type Call = Call ;
623
587
}
624
588
625
- impl pallet_beefy:: Config for Runtime {
626
- type AuthorityId = BeefyId ;
627
- }
628
-
629
- impl pallet_mmr:: Config for Runtime {
630
- const INDEXING_PREFIX : & ' static [ u8 ] = b"mmr" ;
631
- type Hashing = Keccak256 ;
632
- type Hash = <Keccak256 as sp_runtime:: traits:: Hash >:: Output ;
633
- type OnNewRoot = mmr_common:: DepositBeefyDigest < Runtime > ;
634
- type WeightInfo = ( ) ;
635
- type LeafData = mmr_common:: Pallet < Runtime > ;
636
- }
637
-
638
- impl mmr_common:: Config for Runtime {
639
- type BeefyAuthorityToMerkleLeaf = mmr_common:: UncompressBeefyEcdsaKeys ;
640
- type ParachainHeads = ( ) ;
641
- }
642
-
643
589
parameter_types ! {
644
590
// One storage item; key size 32, value size 8; .
645
591
pub const ProxyDepositBase : Balance = deposit( 1 , 8 ) ;
@@ -798,11 +744,6 @@ construct_runtime! {
798
744
799
745
// Election pallet. Only works with staking, but placed here to maintain indices.
800
746
ElectionProviderMultiPhase : pallet_election_provider_multi_phase:: { Pallet , Call , Storage , Event <T >, ValidateUnsigned } = 24 ,
801
-
802
- // Bridges support.
803
- Mmr : pallet_mmr:: { Pallet , Call , Storage } = 28 ,
804
- Beefy : pallet_beefy:: { Pallet , Config <T >, Storage } = 29 ,
805
- MmrLeaf : mmr_common:: { Pallet , Storage } = 30 ,
806
747
}
807
748
}
808
749
@@ -841,7 +782,7 @@ pub type Executive = frame_executive::Executive<
841
782
frame_system:: ChainContext < Runtime > ,
842
783
Runtime ,
843
784
AllPallets ,
844
- UpgradeSessionKeys ,
785
+ ( ) ,
845
786
> ;
846
787
/// The payload being signed in transactions.
847
788
pub type SignedPayload = generic:: SignedPayload < Call , SignedExtra > ;
@@ -976,40 +917,33 @@ sp_api::impl_runtime_apis! {
976
917
977
918
impl beefy_primitives:: BeefyApi <Block , BeefyId > for Runtime {
978
919
fn validator_set( ) -> beefy_primitives:: ValidatorSet <BeefyId > {
979
- Beefy :: validator_set( )
920
+ // dummy implementation due to lack of BEEFY pallet.
921
+ beefy_primitives:: ValidatorSet { validators: Vec :: new( ) , id: 0 }
980
922
}
981
923
}
982
924
983
925
impl pallet_mmr_primitives:: MmrApi <Block , Hash > for Runtime {
984
- fn generate_proof( leaf_index : u64 )
926
+ fn generate_proof( _leaf_index : u64 )
985
927
-> Result <( mmr:: EncodableOpaqueLeaf , mmr:: Proof <Hash >) , mmr:: Error >
986
928
{
987
- Mmr :: generate_proof ( leaf_index )
988
- . map ( | ( leaf , proof ) | ( mmr:: EncodableOpaqueLeaf :: from_leaf ( & leaf ) , proof ) )
929
+ // dummy implementation due to lack of MMR pallet.
930
+ Err ( mmr:: Error :: GenerateProof )
989
931
}
990
932
991
- fn verify_proof( leaf : mmr:: EncodableOpaqueLeaf , proof : mmr:: Proof <Hash >)
933
+ fn verify_proof( _leaf : mmr:: EncodableOpaqueLeaf , _proof : mmr:: Proof <Hash >)
992
934
-> Result <( ) , mmr:: Error >
993
935
{
994
- pub type Leaf = <
995
- <Runtime as pallet_mmr:: Config >:: LeafData as mmr:: LeafDataProvider
996
- >:: LeafData ;
997
-
998
- let leaf: Leaf = leaf
999
- . into_opaque_leaf( )
1000
- . try_decode( )
1001
- . ok_or( mmr:: Error :: Verify ) ?;
1002
- Mmr :: verify_leaf( leaf, proof)
936
+ // dummy implementation due to lack of MMR pallet.
937
+ Err ( mmr:: Error :: Verify )
1003
938
}
1004
939
1005
940
fn verify_proof_stateless(
1006
- root : Hash ,
1007
- leaf : mmr:: EncodableOpaqueLeaf ,
1008
- proof : mmr:: Proof <Hash >
941
+ _root : Hash ,
942
+ _leaf : mmr:: EncodableOpaqueLeaf ,
943
+ _proof : mmr:: Proof <Hash >
1009
944
) -> Result <( ) , mmr:: Error > {
1010
- type MmrHashing = <Runtime as pallet_mmr:: Config >:: Hashing ;
1011
- let node = mmr:: DataOrHash :: Data ( leaf. into_opaque_leaf( ) ) ;
1012
- pallet_mmr:: verify_leaf_proof:: <MmrHashing , _>( root, node, proof)
945
+ // dummy implementation due to lack of MMR pallet.
946
+ Err ( mmr:: Error :: Verify )
1013
947
}
1014
948
}
1015
949
0 commit comments