Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Offchain Phragmén BREAKING. #4517

Merged
merged 144 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
46ecd58
Initial skeleton for offchain phragmen
kianenigma Jan 2, 2020
a830ec9
Basic compact encoding decoding for results
kianenigma Jan 6, 2020
8448ee9
add compact files
kianenigma Jan 6, 2020
5e26a68
Bring back Self::ensure_storage_upgraded();
kianenigma Jan 6, 2020
65b2df6
Make staking use compact stuff.
kianenigma Jan 7, 2020
85b726c
First seemingly working version of reduce, full of todos
kianenigma Jan 13, 2020
bf053c2
Master.into()
kianenigma Jan 13, 2020
ca68e24
Everything phragmen related works again.
kianenigma Jan 13, 2020
62e61db
Signing made easier, still issues.
kianenigma Jan 14, 2020
c4a77ac
Signing from offchain compile fine 😎
kianenigma Jan 15, 2020
31b699a
make compact work with staked asssignment
kianenigma Jan 15, 2020
c5d8c51
Evaluation basics are in place.
kianenigma Jan 15, 2020
6d4494e
Master.into()
kianenigma Jan 15, 2020
35a7872
Move reduce into crate. Document stuff
kianenigma Jan 15, 2020
0540646
move reduce into no_std
kianenigma Jan 16, 2020
da66da2
Add files
kianenigma Jan 16, 2020
d95010d
Remove other std deps. Runtime compiles
kianenigma Jan 16, 2020
3f23367
Seemingly it is al stable; cycle implemented but not integrated.
kianenigma Jan 20, 2020
3cb47fb
Add fuzzing code.
kianenigma Jan 21, 2020
a21e90b
Cleanup reduce a bit more.
kianenigma Jan 21, 2020
df7676b
a metric ton of tests for staking; wip 🔨
kianenigma Jan 22, 2020
6f4a2fe
Master.into()
kianenigma Jan 22, 2020
889b18c
Implement a lot more of the tests.
kianenigma Jan 23, 2020
50f5399
wip getting the unsigned stuff to work
kianenigma Jan 23, 2020
2bbdec4
A bit gleanup for unsigned debug
kianenigma Jan 24, 2020
c9cfcb8
Clean and finalize compact code.
kianenigma Jan 24, 2020
3633a77
Document reduce.
kianenigma Jan 27, 2020
686d263
Still problems with signing
kianenigma Jan 27, 2020
295cdd7
We officaly duct taped the transaction submission stuff. 🤓
kianenigma Jan 27, 2020
57b2b4e
Deadlock with keys again
kianenigma Jan 28, 2020
6a33fc1
Runtime builds
kianenigma Jan 28, 2020
4e951af
Unsigned test works 🙌
kianenigma Jan 28, 2020
5ab3cf0
Some cleanups
kianenigma Jan 28, 2020
c88df34
Master.into()
kianenigma Jan 28, 2020
31fd60e
Make all the tests compile and stuff
kianenigma Jan 29, 2020
2623d98
Minor cleanup
kianenigma Feb 3, 2020
c911a87
Master.into()
kianenigma Feb 3, 2020
2ed0a1d
fix more merge stuff
kianenigma Feb 3, 2020
6bef2d9
Most tests work again.
kianenigma Feb 5, 2020
201c11c
a very nasty bug in reduce
kianenigma Feb 6, 2020
eef09e5
Fix all integrations
kianenigma Feb 6, 2020
51fc865
Fix more todos
kianenigma Feb 6, 2020
aa6186c
Revamp everything and everything
kianenigma Feb 11, 2020
596bc77
Master.into()
kianenigma Feb 11, 2020
084a355
Remove bogus test
kianenigma Feb 11, 2020
817f8aa
Some review grumbles.
kianenigma Feb 11, 2020
d1e290f
Make it work with custom key type
kianenigma Feb 12, 2020
02c4e3b
Some fixes
kianenigma Feb 12, 2020
aea7ad2
Fix doc test
kianenigma Feb 12, 2020
e2210cc
loop for submission
kianenigma Feb 13, 2020
ca20033
Fix cli, keyring etc.
kianenigma Feb 13, 2020
b2c4416
Merged with the generic phragmen -- maybe not perfectly but works
kianenigma Feb 13, 2020
10e97e3
some cleanup
kianenigma Feb 14, 2020
19cf777
Master.into()
kianenigma Feb 14, 2020
54a5a35
Fix staking tests again
kianenigma Feb 14, 2020
d746fd4
fix per-things; bring patches from benchmarking
kianenigma Feb 18, 2020
2f75ea7
better score prediction
kianenigma Feb 18, 2020
2fa064b
Add fuzzer, more patches.
kianenigma Feb 19, 2020
0afbde3
Some fixes
kianenigma Feb 19, 2020
16d8c64
Fix tests
kianenigma Feb 19, 2020
b8efef4
More docs
kianenigma Feb 20, 2020
e72d642
Remove unused generics
kianenigma Feb 20, 2020
9f227f9
Remove max-nominator footgun
kianenigma Feb 20, 2020
9116285
Better fuzzer
kianenigma Feb 21, 2020
36bbf4b
Master.into()
kianenigma Feb 21, 2020
44c0a6b
Disable it ❌
kianenigma Feb 21, 2020
c3769fa
Master.into()
kianenigma Feb 21, 2020
f21df59
Bump.
kianenigma Feb 21, 2020
f9f92c4
Another round of self-review
kianenigma Feb 26, 2020
4df9ed4
Master.into()
kianenigma Feb 26, 2020
037057c
Refactor a lot
kianenigma Feb 27, 2020
2b89c0e
More major fixes in perThing
kianenigma Feb 28, 2020
4e44501
Add new fuzz file
kianenigma Feb 28, 2020
5c3fc6c
Master.into()
kianenigma Feb 28, 2020
7287c2b
Update lock
kianenigma Feb 28, 2020
ac6ce78
fix fuzzing code.
kianenigma Feb 28, 2020
7be2268
Fix nominator retain test
kianenigma Mar 2, 2020
1bd7850
Add slashing check
kianenigma Mar 2, 2020
5f9844d
Update frame/staking/src/tests.rs
kianenigma Mar 2, 2020
555007f
Some formatting nits
kianenigma Mar 2, 2020
c16ad73
Merge branch 'kiz-offchain-phragmen-4' of github.com:paritytech/subst…
kianenigma Mar 2, 2020
c8cc72f
Review comments.
kianenigma Mar 3, 2020
ceef0e6
Merge branch 'master' of github.com:paritytech/substrate into kiz-off…
kianenigma Mar 3, 2020
62d4f5e
Fix cargo file
kianenigma Mar 3, 2020
fd9816a
Master.into()
kianenigma Mar 4, 2020
85f1aa4
Almost all tests work again
kianenigma Mar 4, 2020
9b8af93
Update frame/staking/src/tests.rs
kianenigma Mar 4, 2020
58fcf27
Fix review comments
kianenigma Mar 4, 2020
7f47696
Merge branch 'kiz-offchain-phragmen-4' of github.com:paritytech/subst…
kianenigma Mar 4, 2020
ef7eab2
More review stuff
kianenigma Mar 4, 2020
5f70434
Some nits
kianenigma Mar 4, 2020
4d82b4d
Merge branch 'master' of github.com:paritytech/substrate into kiz-off…
kianenigma Mar 4, 2020
58267dc
Fix new staking / session / babe relation
kianenigma Mar 5, 2020
bee2f5d
Update primitives/phragmen/src/lib.rs
kianenigma Mar 5, 2020
3def57b
Update primitives/phragmen/src/lib.rs
kianenigma Mar 5, 2020
9590986
Update primitives/phragmen/compact/src/lib.rs
kianenigma Mar 5, 2020
6566d81
Some doc updates to slashing
kianenigma Mar 5, 2020
b01000e
Merge branch 'kiz-offchain-phragmen-4' of github.com:paritytech/subst…
kianenigma Mar 5, 2020
1667f6e
Fix derive
kianenigma Mar 5, 2020
155e9a3
Master.into()
kianenigma Mar 5, 2020
e25c103
Remove imports
kianenigma Mar 5, 2020
81ddd48
Remove unimplemented tests
kianenigma Mar 6, 2020
87bb4d1
Master.into()
kianenigma Mar 9, 2020
eda82ae
nits
kianenigma Mar 9, 2020
56d1f5e
Remove dbg
kianenigma Mar 9, 2020
0c9c20f
Better fuzzing params
kianenigma Mar 9, 2020
f308817
Master.into()
kianenigma Mar 9, 2020
f014e2c
Remove unused pref map
kianenigma Mar 9, 2020
26d9329
Deferred Slashing/Offence for offchain Phragmen (#5151)
kianenigma Mar 10, 2020
ecd042e
Fix build
kianenigma Mar 10, 2020
63eb8c4
review comments
kianenigma Mar 12, 2020
3cd2c55
fix more
kianenigma Mar 12, 2020
1e4291c
Merge branch 'master' of github.com:paritytech/substrate into kiz-off…
kianenigma Mar 12, 2020
918e58e
fix build
kianenigma Mar 12, 2020
537d6ee
Some cleanups and self-reviews
kianenigma Mar 13, 2020
98f9c1b
More minor self reviews
kianenigma Mar 13, 2020
b553cf5
Master.into()
kianenigma Mar 13, 2020
199d8fb
Final nits
kianenigma Mar 13, 2020
a424a94
Merge branch 'master' of github.com:paritytech/substrate into kiz-off…
kianenigma Mar 13, 2020
42dbf06
A holy darn big upstream merge.
kianenigma Mar 19, 2020
202db20
Some merge fixes.
kianenigma Mar 19, 2020
8372453
opt comment
kianenigma Mar 20, 2020
db50363
Master.into()
kianenigma Mar 20, 2020
2692605
Fix build
kianenigma Mar 20, 2020
2cf090c
Fix build again.
kianenigma Mar 20, 2020
ffda508
Merge branch 'master' into kiz-offchain-phragmen-4
gavofyork Mar 21, 2020
4c56e36
Master.into()
kianenigma Mar 21, 2020
18558af
Update frame/staking/fuzz/fuzz_targets/submit_solution.rs
kianenigma Mar 22, 2020
6f9a2c5
Update frame/staking/src/slashing.rs
kianenigma Mar 23, 2020
cd3df80
Update frame/staking/src/offchain_election.rs
kianenigma Mar 23, 2020
1153084
Fix review comments
kianenigma Mar 23, 2020
4c274ab
Merge branch 'kiz-offchain-phragmen-4' of github.com:paritytech/subst…
kianenigma Mar 23, 2020
c75f441
Master.into()
kianenigma Mar 23, 2020
34e3d7b
fix test
kianenigma Mar 23, 2020
ee3c4cb
=== 🔑 Revamp without staking key.
kianenigma Mar 24, 2020
3c5dd95
Master.into()
kianenigma Mar 24, 2020
5a1aa2f
Master.into()
kianenigma Mar 25, 2020
03bb2a9
final round of changes.
kianenigma Mar 26, 2020
8dd2564
Master.into()
kianenigma Mar 26, 2020
4514432
Fix cargo-deny
kianenigma Mar 26, 2020
ce2ff51
Merge branch 'master' into kiz-offchain-phragmen-4
gavofyork Mar 26, 2020
9c0f42c
Master.into()
kianenigma Mar 26, 2020
94efcff
Master.into()
kianenigma Mar 26, 2020
8182947
Update frame/staking/src/lib.rs
kianenigma Mar 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 124 additions & 116 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ members = [
"primitives/offchain",
"primitives/panic-handler",
"primitives/phragmen",
"primitives/phragmen/compact",
"primitives/rpc",
"primitives/runtime-interface",
"primitives/runtime-interface/proc-macro",
Expand Down
1 change: 1 addition & 0 deletions bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ pallet-transaction-payment = { version = "2.0.0-alpha.5", path = "../../../frame
frame-support = { version = "2.0.0-alpha.5", default-features = false, path = "../../../frame/support" }
pallet-im-online = { version = "2.0.0-alpha.5", default-features = false, path = "../../../frame/im-online" }
pallet-authority-discovery = { version = "2.0.0-alpha.5", path = "../../../frame/authority-discovery" }
pallet-staking = { version = "2.0.0-alpha.5", path = "../../../frame/staking" }

# node-specific dependencies
node-runtime = { version = "2.0.0-alpha.5", path = "../runtime" }
Expand Down
16 changes: 14 additions & 2 deletions bin/node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,14 @@ pub fn get_authority_keys_from_seed(seed: &str) -> (

/// Helper function to create GenesisConfig for testing
pub fn testnet_genesis(
initial_authorities: Vec<(AccountId, AccountId, GrandpaId, BabeId, ImOnlineId, AuthorityDiscoveryId)>,
initial_authorities: Vec<(
AccountId,
AccountId,
GrandpaId,
BabeId,
ImOnlineId,
AuthorityDiscoveryId,
)>,
root_key: AccountId,
endowed_accounts: Option<Vec<AccountId>>,
enable_println: bool,
Expand Down Expand Up @@ -244,7 +251,12 @@ pub fn testnet_genesis(
}),
pallet_session: Some(SessionConfig {
keys: initial_authorities.iter().map(|x| {
(x.0.clone(), x.0.clone(), session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone()))
(x.0.clone(), x.0.clone(), session_keys(
x.2.clone(),
x.3.clone(),
x.4.clone(),
x.5.clone(),
))
}).collect::<Vec<_>>(),
}),
pallet_staking: Some(StakingConfig {
Expand Down
3 changes: 2 additions & 1 deletion bin/node/cli/src/factory_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl<Number> FactoryState<Number> {
frame_system::CheckWeight::new(),
pallet_transaction_payment::ChargeTransactionPayment::from(0),
Default::default(),
Default::default(),
)
}
}
Expand Down Expand Up @@ -122,7 +123,7 @@ impl RuntimeAdapter for FactoryState<Number> {
(*amount).into()
)
)
}, key, (version, genesis_hash.clone(), prior_block_hash.clone(), (), (), (), ()))
}, key, (version, genesis_hash.clone(), prior_block_hash.clone(), (), (), (), (), ()))
}

fn inherent_extrinsics(&self) -> InherentData {
Expand Down
3 changes: 2 additions & 1 deletion bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,11 +624,12 @@ mod tests {
check_weight,
payment,
Default::default(),
Default::default(),
);
let raw_payload = SignedPayload::from_raw(
function,
extra,
(version, genesis_hash, genesis_hash, (), (), (), ())
(version, genesis_hash, genesis_hash, (), (), (), (), ())
);
let signature = raw_payload.using_encoded(|payload| {
signer.sign(payload)
Expand Down
4 changes: 3 additions & 1 deletion bin/node/executor/tests/submit_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

use node_runtime::{
Call, Executive, Indices, Runtime, SubmitTransaction, UncheckedExtrinsic,
Call, Executive, Indices, Runtime, TransactionSubmitterOf, UncheckedExtrinsic,
};
use sp_application_crypto::AppKey;
use sp_core::testing::KeyStore;
Expand All @@ -31,6 +31,8 @@ use codec::Decode;
pub mod common;
use self::common::*;

type SubmitTransaction = TransactionSubmitterOf<pallet_im_online::sr25519::AuthorityId>;

#[test]
fn should_submit_unsigned_transaction() {
let mut t = new_test_ext(COMPACT_CODE, false);
Expand Down
106 changes: 58 additions & 48 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub use pallet_timestamp::Call as TimestampCall;
pub use pallet_balances::Call as BalancesCall;
pub use pallet_contracts::Gas;
pub use frame_support::StorageValue;
pub use pallet_staking::StakerStatus;
pub use pallet_staking::{StakerStatus, LockStakingStatus};

/// Implementations of some helper traits passed into runtime modules as associated types.
pub mod impls;
Expand All @@ -73,6 +73,52 @@ use constants::{time::*, currency::*};
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

/// A transaction submitter with the given key type.
pub type TransactionSubmitterOf<KeyType> = TransactionSubmitter<KeyType, Runtime, UncheckedExtrinsic>;
kianenigma marked this conversation as resolved.
Show resolved Hide resolved

/// Submits transaction with the node's public and signature type. Adheres to the signed extension
/// format of the chain.
impl frame_system::offchain::CreateTransaction<Runtime, UncheckedExtrinsic> for Runtime {
type Public = <Signature as traits::Verify>::Signer;
type Signature = Signature;

fn create_transaction<TSigner: frame_system::offchain::Signer<Self::Public, Self::Signature>>(
call: Call,
public: Self::Public,
account: AccountId,
index: Index,
) -> Option<(Call, <UncheckedExtrinsic as traits::Extrinsic>::SignaturePayload)> {
// take the biggest period possible.
let period = BlockHashCount::get()
.checked_next_power_of_two()
.map(|c| c / 2)
.unwrap_or(2) as u64;
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
let current_block = System::block_number()
.saturated_into::<u64>()
// The `System::block_number` is initialized with `n+1`,
// so the actual block number is `n`.
.saturating_sub(1);
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
let tip = 0;
let extra: SignedExtra = (
frame_system::CheckVersion::<Runtime>::new(),
frame_system::CheckGenesis::<Runtime>::new(),
frame_system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
frame_system::CheckNonce::<Runtime>::from(index),
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
Default::default(),
Default::default(),
);
let raw_payload = SignedPayload::new(call, extra).map_err(|e| {
debug::warn!("Unable to create signed payload: {:?}", e);
}).ok()?;
let signature = TSigner::sign(public, &raw_payload)?;
let address = Indices::unlookup(account);
let (call, extra, _) = raw_payload.deconstruct();
Some((call, (address, signature, extra)))
}
}

/// Runtime version.
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("node"),
Expand Down Expand Up @@ -255,6 +301,7 @@ impl pallet_session::Trait for Runtime {
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type NextSessionRotation = Babe;
}

impl pallet_session::historical::Trait for Runtime {
Expand All @@ -278,6 +325,7 @@ parameter_types! {
pub const BondingDuration: pallet_staking::EraIndex = 24 * 28;
pub const SlashDeferDuration: pallet_staking::EraIndex = 24 * 7; // 1/4 the bonding duration.
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
pub const ElectionLookahead: BlockNumber = 25; // 10 minutes per session => 100 block.
pub const MaxNominatorRewardedPerValidator: u32 = 64;
}

Expand All @@ -296,6 +344,10 @@ impl pallet_staking::Trait for Runtime {
type SlashCancelOrigin = pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>;
type SessionInterface = Self;
type RewardCurve = RewardCurve;
type NextNewSession = Session;
type ElectionLookahead = ElectionLookahead;
type Call = Call;
type SubmitTransaction = TransactionSubmitterOf<()>;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
}

Expand Down Expand Up @@ -470,9 +522,6 @@ impl pallet_sudo::Trait for Runtime {
type Call = Call;
}

/// A runtime transaction submitter.
pub type SubmitTransaction = TransactionSubmitter<ImOnlineId, Runtime, UncheckedExtrinsic>;

parameter_types! {
pub const SessionDuration: BlockNumber = EPOCH_DURATION_IN_SLOTS as _;
}
Expand All @@ -481,7 +530,7 @@ impl pallet_im_online::Trait for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type Call = Call;
type SubmitTransaction = SubmitTransaction;
type SubmitTransaction = TransactionSubmitterOf<Self::AuthorityId>;
type SessionDuration = SessionDuration;
type ReportUnresponsiveness = Offences;
}
Expand Down Expand Up @@ -530,46 +579,6 @@ impl pallet_identity::Trait for Runtime {
type RegistrarOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
}

impl frame_system::offchain::CreateTransaction<Runtime, UncheckedExtrinsic> for Runtime {
type Public = <Signature as traits::Verify>::Signer;
type Signature = Signature;

fn create_transaction<TSigner: frame_system::offchain::Signer<Self::Public, Self::Signature>>(
call: Call,
public: Self::Public,
account: AccountId,
index: Index,
) -> Option<(Call, <UncheckedExtrinsic as traits::Extrinsic>::SignaturePayload)> {
// take the biggest period possible.
let period = BlockHashCount::get()
.checked_next_power_of_two()
.map(|c| c / 2)
.unwrap_or(2) as u64;
let current_block = System::block_number()
.saturated_into::<u64>()
// The `System::block_number` is initialized with `n+1`,
// so the actual block number is `n`.
.saturating_sub(1);
let tip = 0;
let extra: SignedExtra = (
frame_system::CheckVersion::<Runtime>::new(),
frame_system::CheckGenesis::<Runtime>::new(),
frame_system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
frame_system::CheckNonce::<Runtime>::from(index),
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
Default::default(),
);
let raw_payload = SignedPayload::new(call, extra).map_err(|e| {
debug::warn!("Unable to create signed payload: {:?}", e);
}).ok()?;
let signature = TSigner::sign(public, &raw_payload)?;
let address = Indices::unlookup(account);
let (call, extra, _) = raw_payload.deconstruct();
Some((call, (address, signature, extra)))
}
}

parameter_types! {
pub const ConfigDepositBase: Balance = 5 * DOLLARS;
pub const FriendDepositFactor: Balance = 50 * CENTS;
Expand Down Expand Up @@ -638,7 +647,7 @@ construct_runtime!(
Indices: pallet_indices::{Module, Call, Storage, Config<T>, Event<T>},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
Staking: pallet_staking::{Module, Call, Config<T>, Storage, Event<T>},
Staking: pallet_staking::{Module, Call, Config<T>, Storage, Event<T>, ValidateUnsigned},
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
Democracy: pallet_democracy::{Module, Call, Storage, Config, Event<T>},
Council: pallet_collective::<Instance1>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>},
Expand Down Expand Up @@ -680,6 +689,7 @@ pub type SignedExtra = (
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
pallet_contracts::CheckBlockGasLimit<Runtime>,
pallet_staking::LockStakingStatus<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
Expand Down Expand Up @@ -965,7 +975,7 @@ mod tests {
>,
{}

is_submit_signed_transaction::<SubmitTransaction>();
is_sign_and_submit_transaction::<SubmitTransaction>();
is_submit_signed_transaction::<TransactionSubmitterOf<ImOnlineId>>();
is_sign_and_submit_transaction::<TransactionSubmitterOf<ImOnlineId>>();
}
}
1 change: 1 addition & 0 deletions bin/node/testing/src/keyring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub fn signed_extra(nonce: Index, extra_fee: Balance) -> SignedExtra {
frame_system::CheckWeight::new(),
pallet_transaction_payment::ChargeTransactionPayment::from(extra_fee),
Default::default(),
Default::default(),
)
}

Expand Down
2 changes: 2 additions & 0 deletions bin/utils/subkey/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ fn create_extrinsic<C: Crypto>(
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(f),
Default::default(),
Default::default(),
)
};
let raw_payload = SignedPayload::from_raw(
Expand All @@ -696,6 +697,7 @@ fn create_extrinsic<C: Crypto>(
(),
(),
(),
(),
),
);
let signature = raw_payload.using_encoded(|payload| signer.sign(payload)).into_runtime();
Expand Down
1 change: 1 addition & 0 deletions frame/authority-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ mod tests {
type ValidatorId = AuthorityId;
type ValidatorIdOf = ConvertInto;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
}

impl pallet_session::historical::Trait for Test {
Expand Down
5 changes: 0 additions & 5 deletions frame/babe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ repository = "https://github.com/paritytech/substrate/"
description = "Consensus extension module for BABE consensus. Collects on-chain randomness from VRF outputs and manages epoch transitions."

[dependencies]
hex-literal = "0.2.1"
codec = { package = "parity-scale-codec", version = "1.2.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true }
sp-inherents = { version = "2.0.0-alpha.5", default-features = false, path = "../../primitives/inherents" }
Expand All @@ -26,11 +25,7 @@ sp-consensus-vrf = { version = "0.8.0-alpha.5", default-features = false, path =
sp-io = { path = "../../primitives/io", default-features = false , version = "2.0.0-alpha.5"}

[dev-dependencies]
lazy_static = "1.4.0"
parking_lot = "0.10.0"
sp-version = { version = "2.0.0-alpha.5", default-features = false, path = "../../primitives/version" }
sp-core = { version = "2.0.0-alpha.5", path = "../../primitives/core" }
substrate-test-runtime = { version = "2.0.0-dev", path = "../../test-utils/runtime" }

[features]
default = ["std"]
Expand Down
Loading