Skip to content

Commit

Permalink
Fix mainnet pre genesis (#359)
Browse files Browse the repository at this point in the history
* Disallow calls properly

* Use dns for bootnodes
  • Loading branch information
liuchengxu authored Nov 18, 2020
1 parent 983421a commit dc10dd5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,9 @@ pub fn mainnet_pre_config() -> Result<ChainSpec, String> {
ChainType::Live,
constructor,
bootnodes![
"/ip4/47.99.179.60/tcp/20222/p2p/12D3KooWMMGD6eyLDgoTPnmGrawn9gkjtsZGLACJXqVCUbe6R6bD",
"/ip4/116.62.46.8/tcp/20222/p2p/12D3KooWC1tFLBFVw47S2nfD7Nzhg5hBMUvsnz4nqpr82zfTYWaH",
"/ip4/47.110.34.31/tcp/20222/p2p/12D3KooWPthFY8xDDyM5X9PWZwNfioqP5EShiTKyVv5899H22WBT",
"/dns/p2p.1.chainx.org/tcp/20222/p2p/12D3KooWMMGD6eyLDgoTPnmGrawn9gkjtsZGLACJXqVCUbe6R6bD",
"/dns/p2p.2.chainx.org/tcp/20222/p2p/12D3KooWC1tFLBFVw47S2nfD7Nzhg5hBMUvsnz4nqpr82zfTYWaH",
"/dns/p2p.3.chainx.org/tcp/20222/p2p/12D3KooWPthFY8xDDyM5X9PWZwNfioqP5EShiTKyVv5899H22WBT",
],
Some(
TelemetryEndpoints::new(vec![
Expand Down
27 changes: 20 additions & 7 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,32 @@ pub fn native_version() -> NativeVersion {
#[derive(Debug, Clone, Eq, PartialEq, codec::Encode, codec::Decode)]
pub struct BaseFilter;
impl Filter<Call> for BaseFilter {
fn filter(_call: &Call) -> bool {
// At the beginning of mainnet, no call is allowed.
false
/*
fn filter(call: &Call) -> bool {
use frame_support::dispatch::GetCallMetadata;
// At the beginning of mainnet, no call is allowed.
match call {
Call::Currencies(_) => return false, // forbidden Currencies call now
_ => {
}
Call::Democracy(_)
| Call::Council(_)
| Call::TechnicalCommittee(_)
| Call::TechnicalMembership(_)
| Call::Treasury(_)
| Call::Indices(_)
| Call::Balances(_)
| Call::Utility(_)
| Call::Identity(_)
| Call::Multisig(_) => return false,
Call::XStaking(_)
| Call::XAssets(_)
| Call::XAssetsRegistrar(_)
| Call::XMiningAsset(_)
| Call::XGatewayBitcoin(_)
| Call::XGatewayCommon(_)
| Call::XGatewayRecords(_) => return false,
_ => {}
}
let metadata = call.get_call_metadata();
!XSystem::is_paused(metadata)
*/
}
}
pub struct IsCallable;
Expand Down

0 comments on commit dc10dd5

Please sign in to comment.