Skip to content

Commit 14256d8

Browse files
author
Joshua Mir
committed
<revertable> remove txfees entirely
1 parent 08a7426 commit 14256d8

File tree

6 files changed

+3
-41
lines changed

6 files changed

+3
-41
lines changed

bin/node/cli/src/factory_impl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ impl<Number> FactoryState<Number> {
5656
frame_system::CheckEra::from(Era::mortal(256, phase)),
5757
frame_system::CheckNonce::from(index),
5858
frame_system::CheckWeight::new(),
59-
pallet_transaction_payment::ChargeTransactionPayment::from(0),
6059
)
6160
}
6261
}
@@ -121,7 +120,7 @@ impl RuntimeAdapter for FactoryState<Number> {
121120
(*amount).into()
122121
)
123122
)
124-
}, key, (version, genesis_hash.clone(), prior_block_hash.clone(), (), (), ()))
123+
}, key, (version, genesis_hash.clone(), prior_block_hash.clone(), (), ()))
125124
}
126125

127126
fn inherent_extrinsics(&self) -> InherentData {

bin/node/rpc/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ pub fn create_full<C, P, M, SC>(
8585
C: HeaderBackend<Block> + HeaderMetadata<Block, Error=BlockChainError> + 'static,
8686
C: Send + Sync + 'static,
8787
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
88-
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance, UncheckedExtrinsic>,
8988
C::Api: BabeApi<Block>,
9089
<C::Api as sp_api::ApiErrorExt>::Error: fmt::Debug,
9190
P: TransactionPool + 'static,
@@ -114,9 +113,6 @@ pub fn create_full<C, P, M, SC>(
114113
// Making synchronous calls in light client freezes the browser currently,
115114
// more context: https://github.com/paritytech/substrate/pull/3480
116115
// These RPCs should use an asynchronous caller instead.
117-
io.extend_with(
118-
TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))
119-
);
120116
io.extend_with(
121117
sc_consensus_babe_rpc::BabeApi::to_delegate(
122118
BabeRPCHandler::new(client, shared_epoch_changes, keystore, babe_config, select_chain)

bin/node/runtime/src/impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ mod tests {
118118
use super::*;
119119
use sp_runtime::assert_eq_error_rate;
120120
use crate::{MaximumBlockWeight, AvailableBlockRatio, Runtime};
121-
use crate::{constants::currency::*, TransactionPayment, TargetBlockFullness};
121+
use crate::{constants::currency::*, TargetBlockFullness};
122122
use frame_support::weights::Weight;
123123
use core::num::NonZeroI128;
124124

bin/node/runtime/src/lib.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ use pallet_grandpa::AuthorityList as GrandpaAuthorityList;
4848
use pallet_grandpa::fg_primitives;
4949
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
5050
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
51-
use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
52-
use pallet_contracts_rpc_runtime_api::ContractExecResult;
5351
use sp_inherents::{InherentData, CheckInherentsResult};
5452

5553
#[cfg(any(feature = "std", test))]
@@ -215,23 +213,6 @@ impl pallet_balances::Trait for Runtime {
215213
type AccountStore = frame_system::Module<Runtime>;
216214
}
217215

218-
parameter_types! {
219-
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
220-
// In the Substrate node, a weight of 10_000_000 (smallest non-zero weight)
221-
// is mapped to 10_000_000 units of fees, hence:
222-
pub const WeightFeeCoefficient: Balance = 1;
223-
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
224-
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
225-
}
226-
227-
impl pallet_transaction_payment::Trait for Runtime {
228-
type Currency = Balances;
229-
type OnTransactionPayment = DealWithFees;
230-
type TransactionByteFee = TransactionByteFee;
231-
type WeightToFee = LinearWeightToFee<WeightFeeCoefficient>;
232-
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness>;
233-
}
234-
235216
parameter_types! {
236217
pub const MinimumPeriod: Moment = SLOT_DURATION / 2;
237218
}
@@ -473,7 +454,6 @@ impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for R
473454
frame_system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
474455
frame_system::CheckNonce::<Runtime>::from(nonce),
475456
frame_system::CheckWeight::<Runtime>::new(),
476-
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
477457
);
478458
let raw_payload = SignedPayload::new(call, extra).map_err(|e| {
479459
debug::warn!("Unable to create signed payload: {:?}", e);
@@ -599,7 +579,6 @@ construct_runtime!(
599579
Authorship: pallet_authorship::{Module, Call, Storage, Inherent},
600580
Indices: pallet_indices::{Module, Call, Storage, Config<T>, Event<T>},
601581
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
602-
TransactionPayment: pallet_transaction_payment::{Module, Storage},
603582
Staking: pallet_staking::{Module, Call, Config<T>, Storage, Event<T>, ValidateUnsigned},
604583
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
605584
Democracy: pallet_democracy::{Module, Call, Storage, Config, Event<T>},
@@ -638,7 +617,6 @@ pub type SignedExtra = (
638617
frame_system::CheckEra<Runtime>,
639618
frame_system::CheckNonce<Runtime>,
640619
frame_system::CheckWeight<Runtime>,
641-
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
642620
);
643621
/// Unchecked extrinsic type as expected by this runtime.
644622
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
@@ -747,16 +725,6 @@ impl_runtime_apis! {
747725
}
748726
}
749727

750-
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
751-
Block,
752-
Balance,
753-
UncheckedExtrinsic,
754-
> for Runtime {
755-
fn query_info(uxt: UncheckedExtrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {
756-
TransactionPayment::query_info(uxt, len)
757-
}
758-
}
759-
760728
impl sp_session::SessionKeys<Block> for Runtime {
761729
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
762730
SessionKeys::generate(seed)

bin/utils/subkey/src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,6 @@ fn create_extrinsic<C: Crypto>(
707707
frame_system::CheckEra::<Runtime>::from(Era::Immortal),
708708
frame_system::CheckNonce::<Runtime>::from(i),
709709
frame_system::CheckWeight::<Runtime>::new(),
710-
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(f),
711710
)
712711
};
713712
let raw_payload = SignedPayload::from_raw(
@@ -719,7 +718,6 @@ fn create_extrinsic<C: Crypto>(
719718
genesis_hash,
720719
(),
721720
(),
722-
(),
723721
),
724722
);
725723
let signature = raw_payload.using_encoded(|payload| signer.sign(payload)).into_runtime();

pallet-datdot/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,7 @@ impl<T: Trait> Module<T> {
986986
_ => {
987987
let nonce : u64 = Self::unique_nonce();
988988
let mut random_select: Vec<u64> = Vec::new();
989+
// added challenge_index to seed in order to ensure challenges get unique randomness.
989990
let seed = (nonce, challenge_index, T::Randomness::random(b"dat_random_attestors"))
990991
.using_encoded(|b| <[u8; 32]>::decode(&mut TrailingZeroInput::new(b)))
991992
.expect("input is padded with zeroes; qed");

0 commit comments

Comments
 (0)