Skip to content

Commit

Permalink
Merge branch 'devnet-ready' into pos
Browse files Browse the repository at this point in the history
  • Loading branch information
orriin committed Jan 2, 2025
2 parents 5ac2a38 + 80150de commit a82df4d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
4 changes: 4 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ polkadot-rpc = { workspace = true }
pallet-drand = { workspace = true }
sp-crypto-ec-utils = { workspace = true }
sp-keystore = { workspace = true, default-features = false }
pallet-drand = { workspace = true }
sp-crypto-ec-utils = { workspace = true }
sp-keystore = { workspace = true, default-features = false }


# These dependencies are used for the subtensor's RPCs
jsonrpsee = { workspace = true, features = ["server"] }
Expand Down
3 changes: 2 additions & 1 deletion pallets/admin-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use frame_system::pallet_prelude::BlockNumberFor;
// - we could use a type parameter for `AuthorityId`, but there is
// no sense for this as GRANDPA's `AuthorityId` is not a parameter -- it's always the same
use sp_consensus_grandpa::AuthorityList;
use sp_runtime::DispatchResult;
use sp_runtime::{traits::Member, DispatchResult, RuntimeAppPublic};

mod benchmarking;

Expand All @@ -28,6 +28,7 @@ pub mod pallet {
use frame_support::traits::tokens::Balance;
use frame_system::pallet_prelude::*;
use pallet_evm_chain_id::{self, ChainId};
use sp_runtime::BoundedVec;

/// The main data structure of the module.
#[pallet::pallet]
Expand Down
24 changes: 24 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ impl pallet_drand::Config for Runtime {
type HttpFetchTimeout = ConstU64<1_000>;
}

impl frame_system::offchain::SigningTypes for Runtime {
type Public = <Signature as Verify>::Signer;
type Signature = Signature;
}

impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
where
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = RuntimeCall;
}

impl frame_system::offchain::CreateSignedTransaction<pallet_drand::Call<Runtime>> for Runtime {
fn create_transaction<S: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
call: RuntimeCall,
Expand Down Expand Up @@ -1544,6 +1557,17 @@ impl pallet_admin_utils::GrandpaInterface<Runtime> for GrandpaInterfaceImpl {
}
}

pub struct GrandpaInterfaceImpl;
impl pallet_admin_utils::GrandpaInterface<Runtime> for GrandpaInterfaceImpl {
fn schedule_change(
next_authorities: Vec<(pallet_grandpa::AuthorityId, u64)>,
in_blocks: BlockNumber,
forced: Option<BlockNumber>,
) -> sp_runtime::DispatchResult {
Grandpa::schedule_change(next_authorities, in_blocks, forced)
}
}

impl pallet_admin_utils::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Grandpa = GrandpaInterfaceImpl;
Expand Down
4 changes: 4 additions & 0 deletions scripts/localnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ echo "*** Chainspec built and output to $FULL_PATH"
$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/alice
$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/bob

# generate node keys
$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/alice
$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/bob

if [ $NO_PURGE -eq 1 ]; then
echo "*** Purging previous state skipped..."
else
Expand Down

0 comments on commit a82df4d

Please sign in to comment.