2

In our case, validators are providing multiple different services and I want to restrict them from un-staking or making unbound calls until they have completed the job.

I can set a BaseCall filter to restrict extrinsic calls but Is there a way to conditionally filter accounts that can make extrinsic calls?

let is_stake_unbound_call = matches!(call, RuntimeCall::Staking(pallet_staking::Call::unbond { value }));
        
if is_stake_unbound_call {
    let has_job = pallet_job::PendingJob::contains_key(account_id)?;
    // return true if all jobs are completed else false
    
}

Other possible Approach:

  • Block un-bound call and let job-pallet make unbound (internally calling pallet-staking::unbound).

Is there a better way to handle such cases? Any help or advice is much appreciated

1 Answer 1

2

In short, use a SignedExtension if there is no configurable origin for a pallet. See How does one block specific accounts from calling extrinsics for a substrate pallet?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.