pallet_domains

Type Alias Module

Source
pub type Module<T> = Pallet<T>;
👎Deprecated: use Pallet instead
Expand description

Type alias to Pallet, to be used by construct_runtime.

Generated by pallet attribute macro.

Aliased Type§

struct Module<T>(/* private fields */);

Implementations

Source§

impl<T: Config> Pallet<T>

Source

pub fn submit_bundle( origin: OriginFor<T>, opaque_bundle: OpaqueBundleOf<T>, ) -> DispatchResultWithPostInfo

Source

pub fn submit_fraud_proof( origin: OriginFor<T>, fraud_proof: Box<FraudProofFor<T>>, ) -> DispatchResultWithPostInfo

Source

pub fn register_domain_runtime( origin: OriginFor<T>, runtime_name: String, runtime_type: RuntimeType, raw_genesis_storage: Vec<u8>, ) -> DispatchResult

Source

pub fn upgrade_domain_runtime( origin: OriginFor<T>, runtime_id: RuntimeId, raw_genesis_storage: Vec<u8>, ) -> DispatchResult

Source

pub fn register_operator( origin: OriginFor<T>, domain_id: DomainId, amount: <T as Config>::Balance, config: OperatorConfig<<T as Config>::Balance>, ) -> DispatchResult

Source

pub fn nominate_operator( origin: OriginFor<T>, operator_id: OperatorId, amount: <T as Config>::Balance, ) -> DispatchResult

Source

pub fn instantiate_domain( origin: OriginFor<T>, domain_config_params: DomainConfigParams<T::AccountId, <T as Config>::Balance>, ) -> DispatchResult

Source

pub fn deregister_operator( origin: OriginFor<T>, operator_id: OperatorId, ) -> DispatchResult

Source

pub fn withdraw_stake( origin: OriginFor<T>, operator_id: OperatorId, to_withdraw: WithdrawStake<<T as Config>::Balance, T::Share>, ) -> DispatchResult

Source

pub fn unlock_funds( origin: OriginFor<T>, operator_id: OperatorId, ) -> DispatchResult

Unlocks the first withdrawal given the unlocking period is complete. Even if the rest of the withdrawals are out of the unlocking period, the nominator should call this extrinsic to unlock each withdrawal

Source

pub fn unlock_nominator( origin: OriginFor<T>, operator_id: OperatorId, ) -> DispatchResult

Unlocks the nominator under given operator given the unlocking period is complete. A nominator can initiate their unlock given operator is already deregistered.

Source

pub fn update_domain_operator_allow_list( origin: OriginFor<T>, domain_id: DomainId, operator_allow_list: OperatorAllowList<T::AccountId>, ) -> DispatchResult

Extrinsic to update domain’s operator allow list. Note:

  • If the previous allowed list is set to specific operators and new allow list is set to Anyone, then domain will become permissioned to open for all operators.
  • If the previous allowed list is set to Anyone or specific operators and the new allow list is set to specific operators, then all the registered not allowed operators will continue to operate until they de-register themselves.
Source

pub fn force_staking_epoch_transition( origin: OriginFor<T>, domain_id: DomainId, ) -> DispatchResultWithPostInfo

Force staking epoch transition for a given domain

Source

pub fn set_permissioned_action_allowed_by( origin: OriginFor<T>, permissioned_action_allowed_by: PermissionedActionAllowedBy<T::AccountId>, ) -> DispatchResult

Update permissioned action allowed by storage by Sudo.

Source

pub fn send_domain_sudo_call( origin: OriginFor<T>, domain_id: DomainId, call: Vec<u8>, ) -> DispatchResult

Submit a domain sudo call.

Source

pub fn freeze_domain( origin: OriginFor<T>, domain_id: DomainId, ) -> DispatchResult

Freezes a given domain. A frozen domain does not accept new bundles but accepts fraud proofs.

Source

pub fn unfreeze_domain( origin: OriginFor<T>, domain_id: DomainId, ) -> DispatchResult

Unfreezes a frozen domain.

Source

pub fn prune_domain_execution_receipt( origin: OriginFor<T>, domain_id: DomainId, bad_receipt_hash: ReceiptHashFor<T>, ) -> DispatchResultWithPostInfo

Prunes a given execution receipt for given frozen domain. This call assumes the execution receipt to be bad and implicitly trusts Sudo to do the necessary validation of the ER before dispatching this call.

Source

pub fn transfer_treasury_funds( origin: OriginFor<T>, account_id: T::AccountId, balance: <T as Config>::Balance, ) -> DispatchResult

Transfer funds from treasury to given account

Source

pub fn submit_receipt( origin: OriginFor<T>, singleton_receipt: SingletonReceiptOf<T>, ) -> DispatchResultWithPostInfo

Source

pub fn send_evm_domain_set_contract_creation_allowed_by_call( origin: OriginFor<T>, domain_id: DomainId, contract_creation_allowed_by: PermissionedActionAllowedBy<EthereumAccountId>, ) -> DispatchResult

Submit an EVM domain “set contract creation allowed by” call as domain owner or root.

Source§

impl<T: Config> Pallet<T>

Source

pub fn successful_bundles(domain_id: DomainId) -> Vec<H256>

Source

pub fn domain_runtime_code(domain_id: DomainId) -> Option<Vec<u8>>

Source

pub fn domain_best_number( domain_id: DomainId, ) -> Result<DomainBlockNumberFor<T>, BundleError>

Source

pub fn domain_registry_fallback( domain_id: DomainId, ) -> Option<DomainObject<BlockNumberFor<T>, ReceiptHashFor<T>, T::AccountId, <T as Config>::Balance>>

Fallback decoding for the domain registry v2 to v3 migration. Returns the domain registry entry for the supplied domain_id, if that domain exists. Tries the v3 storage format first, then falls back to the v2 format.

All reads that could possibly happen between the runtime upgrade and the storage migration must go through this function. (Writes are ok, because any v3 writes will look “corrupt” and get skipped by the migration.)

Source

pub fn runtime_id(domain_id: DomainId) -> Option<RuntimeId>

Returns the runtime ID for the supplied domain_id, if that domain exists.

Source

pub fn runtime_upgrades() -> Vec<RuntimeId>

Returns the list of runtime upgrades in the current block.

Source

pub fn domain_instance_data( domain_id: DomainId, ) -> Option<(DomainInstanceData, BlockNumberFor<T>)>

Source

pub fn genesis_state_root(domain_id: DomainId) -> Option<H256>

Source

pub fn domain_tx_range(domain_id: DomainId) -> U256

Returns the tx range for the domain.

Source

pub fn bundle_producer_election_params( domain_id: DomainId, ) -> Option<BundleProducerElectionParams<<T as Config>::Balance>>

Source

pub fn operator( operator_id: OperatorId, ) -> Option<(OperatorPublicKey, <T as Config>::Balance)>

Source

pub fn head_receipt_number(domain_id: DomainId) -> DomainBlockNumberFor<T>

Returns the best execution chain number.

Source

pub fn oldest_unconfirmed_receipt_number( domain_id: DomainId, ) -> Option<DomainBlockNumberFor<T>>

Returns the block number of the oldest existing unconfirmed execution receipt, return None means there is no unconfirmed ER exist or submitted yet.

Source

pub fn latest_confirmed_domain_block_number( domain_id: DomainId, ) -> DomainBlockNumberFor<T>

Returns the latest confirmed domain block number for a given domain Zero block is always a default confirmed block.

Source

pub fn latest_confirmed_domain_block( domain_id: DomainId, ) -> Option<(DomainBlockNumberFor<T>, T::DomainHash)>

Source

pub fn domain_bundle_limit( domain_id: DomainId, ) -> Result<Option<DomainBundleLimit>, DomainRegistryError>

Returns the domain bundle limit of the given domain

Source

pub fn non_empty_er_exists(domain_id: DomainId) -> bool

Returns if there are any ERs in the challenge period that have non empty extrinsics. Note that Genesis ER is also considered special and hence non empty

Source

pub fn extrinsics_shuffling_seed() -> T::Hash

The external function used to access the extrinsics shuffling seed stored in BlockInherentExtrinsicData.

Source

pub fn timestamp() -> Moment

The external function used to access the timestamp stored in BlockInherentExtrinsicData.

Source

pub fn consensus_transaction_byte_fee() -> Balance

The external function used to access the consensus transaction byte fee stored in BlockInherentExtrinsicData. This value is returned by the consensus_chain_byte_fee() runtime API

Source

pub fn execution_receipt( receipt_hash: ReceiptHashFor<T>, ) -> Option<ExecutionReceiptOf<T>>

Source

pub fn receipt_hash( domain_id: DomainId, domain_number: DomainBlockNumberFor<T>, ) -> Option<ReceiptHashFor<T>>

Source

pub fn confirmed_domain_block_storage_key(domain_id: DomainId) -> Vec<u8>

Source

pub fn is_bad_er_pending_to_prune( domain_id: DomainId, receipt_number: DomainBlockNumberFor<T>, ) -> bool

Source

pub fn is_operator_pending_to_slash( domain_id: DomainId, operator_id: OperatorId, ) -> bool

Source

pub fn max_submit_bundle_weight() -> Weight

Source

pub fn max_submit_receipt_weight() -> Weight

Source

pub fn max_staking_epoch_transition() -> Weight

Source

pub fn max_prune_domain_execution_receipt() -> Weight

Source

pub fn reward_domain_operators( domain_id: DomainId, source: OperatorRewardSource<BlockNumberFor<T>>, rewards: <T as Config>::Balance, )

Reward the active operators of this domain epoch.

Source

pub fn storage_fund_account_balance( operator_id: OperatorId, ) -> <T as Config>::Balance

Source

pub fn operator_highest_slot_from_previous_block( operator_id: OperatorId, pre_dispatch: bool, ) -> u64

Source

pub fn get_domain_runtime_code_for_receipt( domain_id: DomainId, receipt: &ExecutionReceiptOf<T>, maybe_domain_runtime_code_at: Option<DomainRuntimeCodeAt<BlockNumberFor<T>, T::Hash, T::MmrHash>>, ) -> Result<Vec<u8>, FraudProofError>

Source

pub fn is_domain_runtime_upgraded_since( domain_id: DomainId, at: BlockNumberFor<T>, ) -> Option<bool>

Source

pub fn verify_mmr_proof_and_extract_state_root( mmr_leaf_proof: ConsensusChainMmrLeafProof<BlockNumberFor<T>, T::Hash, T::MmrHash>, expected_block_number: BlockNumberFor<T>, ) -> Result<T::Hash, FraudProofError>

Source

pub fn is_domain_registered(domain_id: DomainId) -> bool

Returns true if the Domain is registered.

Source

pub fn domain_sudo_call(domain_id: DomainId) -> Option<Vec<u8>>

Returns domain’s sudo call, if any.

Source

pub fn receipt_gap( domain_id: DomainId, ) -> Result<DomainBlockNumberFor<T>, BundleError>

Source

pub fn is_evm_domain(domain_id: DomainId) -> bool

Returns true if this is an EVM domain.

Source

pub fn is_private_evm_domain(domain_id: DomainId) -> bool

Returns true if this is a private EVM domain.

Source

pub fn evm_domain_contract_creation_allowed_by_call( domain_id: DomainId, ) -> Option<PermissionedActionAllowedBy<EthereumAccountId>>

Returns EVM domain’s “set contract creation allowed by” call, if any.

Source§

impl<T> Pallet<T>
where T: Config + CreateUnsigned<Call<T>>,

Source

pub fn submit_bundle_unsigned(opaque_bundle: OpaqueBundleOf<T>)

Submits an unsigned extrinsic Call::submit_bundle.

Source

pub fn submit_receipt_unsigned(singleton_receipt: SingletonReceiptOf<T>)

Submits an unsigned extrinsic Call::submit_receipt.

Source

pub fn submit_fraud_proof_unsigned(fraud_proof: FraudProofFor<T>)

Submits an unsigned extrinsic Call::submit_fraud_proof.

Source§

impl<T: Config> Pallet<T>

Source

pub fn domain_staking_summary<KArg>( k: KArg, ) -> Option<StakingSummary<OperatorId, <T as Config>::Balance>>
where KArg: EncodeLike<DomainId>,

An auto-generated getter for DomainStakingSummary.

Source§

impl<T: Config> Pallet<T>

Source

pub fn next_domain_id() -> DomainId

An auto-generated getter for NextDomainId.

Source§

impl<T: Config> Pallet<T>

Source

pub fn consensus_block_info<KArg1, KArg2>( k1: KArg1, k2: KArg2, ) -> Option<T::Hash>
where KArg1: EncodeLike<DomainId>, KArg2: EncodeLike<BlockNumberFor<T>>,

An auto-generated getter for ConsensusBlockHash.

Source§

impl<T: Config> Pallet<T>

Source

pub fn latest_confirmed_domain_execution_receipt<KArg>( k: KArg, ) -> Option<ExecutionReceiptOf<T>>
where KArg: EncodeLike<DomainId>,

An auto-generated getter for LatestConfirmedDomainExecutionReceipt.

Source§

impl<T: Config> Pallet<T>

Source

pub fn latest_submitted_er<KArg>(k: KArg) -> DomainBlockNumberFor<T>
where KArg: EncodeLike<(DomainId, OperatorId)>,

An auto-generated getter for LatestSubmittedER.

Trait Implementations

Source§

impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>

Source§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
Source§

impl<T: Config> Callable<T> for Pallet<T>

Source§

impl<T> Clone for Pallet<T>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for Pallet<T>

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Config> DomainOwner<<T as Config>::AccountId> for Pallet<T>

Source§

fn is_domain_owner(domain_id: DomainId, acc: T::AccountId) -> bool

Returns true if the account is the domain owner.
Source§

impl<T: Config> GetStorageVersion for Pallet<T>

Source§

type InCodeStorageVersion = StorageVersion

This type is generated by the pallet macro. Read more
Source§

fn in_code_storage_version() -> Self::InCodeStorageVersion

Returns the in-code storage version as specified in the storage_version attribute, or [NoStorageVersionSet] if the attribute is missing.
Source§

fn on_chain_storage_version() -> StorageVersion

Returns the storage version of the pallet as last set in the actual on-chain storage.
§

fn current_storage_version() -> Self::InCodeStorageVersion

👎Deprecated: This method has been renamed to in_code_storage_version and will be removed after March 2024.
DEPRECATED: Use [Self::current_storage_version] instead. Read more
Source§

impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

Source§

fn on_initialize(block_number: BlockNumberFor<T>) -> Weight

Block initialization hook. This is called at the very beginning of block execution. Read more
Source§

fn on_finalize(_: BlockNumberFor<T>)

Block finalization hook. This is called at the very end of block execution. Read more
§

fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight

Hook to consume a block’s idle time. This will run when the block is being finalized (before [Hooks::on_finalize]). Read more
§

fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)

A hook to run logic after inherent application. Read more
§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME Executive pallet. Read more
§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a pallet allows you to perform long-running tasks that are dispatched as separate threads, and entirely independent of the main blockchain execution. Read more
§

fn integrity_test()

Check the integrity of this pallet’s configuration. Read more
Source§

impl<T: Config> IntegrityTest for Pallet<T>

Source§

fn integrity_test()

See [Hooks::integrity_test].
Source§

impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

Source§

fn offchain_worker(n: BlockNumberFor<T>)

This function is being called after every block import (when fully synced). Read more
Source§

impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

Source§

fn on_finalize(n: BlockNumberFor<T>)

See [Hooks::on_finalize].
Source§

impl<T: Config> OnGenesis for Pallet<T>

Source§

fn on_genesis()

Something that should happen at genesis.
Source§

impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

Source§

fn on_idle(n: BlockNumberFor<T>, remaining_weight: Weight) -> Weight

See [Hooks::on_idle].
Source§

impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

Source§

fn on_initialize(n: BlockNumberFor<T>) -> Weight

See [Hooks::on_initialize].
Source§

impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

Source§

fn on_poll(n: BlockNumberFor<T>, weight: &mut WeightMeter)

Code to execute every now and then at the beginning of the block after inherent application. Read more
Source§

impl<T: Config> OnRuntimeUpgrade for Pallet<T>

Source§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
Source§

impl<T: Config> PalletInfoAccess for Pallet<T>

Source§

fn index() -> usize

Index of the pallet as configured in the runtime.
Source§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
Source§

fn name_hash() -> [u8; 16]

Two128 hash of name.
Source§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
Source§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
Source§

impl<T: Config> PalletsInfoAccess for Pallet<T>

Source§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
Source§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
Source§

impl<T> PartialEq for Pallet<T>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Config> StorageInfoTrait for Pallet<T>

Source§

fn storage_info() -> Vec<StorageInfo>

Source§

impl<T: Config> WhitelistedStorageKeys for Pallet<T>

Source§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a Vec<TrackedStorageKey> indicating the storage keys that should be whitelisted during benchmarking. This means that those keys will be excluded from the benchmarking performance calculation.
Source§

impl<T> Eq for Pallet<T>