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

Feature/batch call filter #2

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

Conversation

bugrazoid
Copy link

@bugrazoid bugrazoid commented Mar 1, 2023

Description

Adding CallFilter to pallet-utility.

Motivation

The current form of the pallet uses frame_system::Config::BaseCallFilter, which does not allow to disable calls that should not be used in this particular pallet.

Behavior

This PR adds call filtering at the pallet level. Filtering rules are similar to frame_system::Config::BaseCallFilter:

}

Err(DispatchErrorWithPostInfo {
post_info: None::<frame_support::pallet_prelude::Weight>.into(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я не совсем так понимал структуру кода в утреннем разговоре
В данном случае у нас post_info: None говорит о том, что предсказанная цена соответствует итоговой, что в данном случае не правда, т.к вместо вызова мы лишь применили фильтр
В таком случае тут по идее должен быть Some(Weight::default())

Также мне кажется что стоит этот метод назвать dispatch_filtered, и чтобы он принимал Origin и Call, выполнял все проверки (В т.ч вычислял is_root, что дёшево, т.к Origin это просто enum), и выполнял вызов

В текущем виде дублирование проверки is_root выглядит странно

PraetorP pushed a commit that referenced this pull request Jul 14, 2023
* Cherry pick all crypto related changes from pull-request paritytech#13311
applied to master's head

* Import some stuff just if 'full_crypto' is on

* Remove copyright year

* Cleanup

* First generic BLS draft

* Finalize generic implementation

* Restore tests

* Fix rust docs

* Fix after master merge

* Fix after master merge

* Use double bls with G1 as signature group and verify individual signatures using DLEQ proof.

* Fix inclusions and types used within substrate

* Remove unused cruft

* Restore usage of upstream crates

* Fix test

* Reduce the diff by aligning Cargo.lock to master

* Application-crypto provides bls381

* Implement bls381 for local keystore

* Use new generic keystore features

* import DoublePublickey[Scheme] from the bls-like root to be less confusing.

* fix compilation

* Apply suggestions from code review

Co-authored-by: Robert Hambrock <[email protected]>

* Clean leftovers

* - update bls test vector after applying spec change recommendation.
- send message as ref.

* Different hard junction ids for different bls12 types

* update to new bls-like

* bls-like → w3f-bls

* Make clippy happy

* update test vector after replacing hash and crop with hash to field.

* cargo fmt

* account for paritytech#13972

* hide BLS behind "bls_non_production" feature flag

* Remove Cargo.lock entries duplicated in merge

* add bls377 to primitives/keystore and client/keystore
add bls377 to primitives/application-crypto/
add bls_non_production to primitives/keystore and client/keystore
bump up w3f-bls version

* rename feature `bls_non_production` to `bls-experimental`

---------

Co-authored-by: Davide Galassi <[email protected]>
Co-authored-by: André Silva <[email protected]>
Co-authored-by: Robert Hambrock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants