Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PassKey]: invoke post_dispatch for weight check #2063

Open
1 task done
aramikm opened this issue Jul 8, 2024 · 0 comments
Open
1 task done

[PassKey]: invoke post_dispatch for weight check #2063

aramikm opened this issue Jul 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@aramikm
Copy link
Collaborator

aramikm commented Jul 8, 2024

Feature Description

It looks like that having the post_disptach constraints is not compatible with the constraints on the pallet extrinsic. There might be a way to accomplish this by pulling all checks outside of the pallet and into the runtime and just call them from Config.

Details

CheckWeight implement post_dispatch which needs to be executed on passkey proxy call

some related code

	/// Post dispatch call
	/// WARNING: It is dangerous to return an error here. To do so will fundamentally invalidate the
	/// transaction and any block that it is included in, causing the block author to not be
	/// compensated for their work in validating the transaction or producing the block so far.
	pub fn post_dispatch(
		payload: &PasskeyPayload<T>,
		post_info: &PostDispatchInfoOf<<T as frame_system::Config>::RuntimeCall>,
	) -> Result<(), TransactionValidityError> {
		let some_call: Box<<T as Config>::RuntimeCall> = payload.clone().passkey_call.call;
		// we are only using the dispatch info for the inner call since the overhead would always be
		// the same, and we don't need to include it here
		let info = &some_call.get_dispatch_info();
		CheckWeight::<T>::post_dispatch(None, &info, post_info, 0, &DispatchResult::Ok(()))
	}

Searched for Related Issues

  • I have done a search for related issues and either found none, or noted them
@aramikm aramikm mentioned this issue Jul 8, 2024
3 tasks
aramikm added a commit that referenced this issue Jul 10, 2024
# Goal
The goal of this PR is <!-- insert goal here -->

Related to #2032 

# Discussion
- Checks the blocks limits
- The `post_dispatch` is not added to the extrinsic yet due to
constraint complications but it will be done a different PR related
ticket #2063

# Checklist
- [x] Chain spec updated
- [x] Tests added
- [x] Weights updated
@aramikm aramikm added enhancement New feature or request discussion Topic for Discussion at a Community Call labels Jul 10, 2024
@wilwade wilwade removed the discussion Topic for Discussion at a Community Call label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants