Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Weight Check signed extension. #3115

Merged
merged 7 commits into from
Jul 16, 2019

Conversation

kianenigma
Copy link
Contributor

To be mixed with #3102.

@kianenigma kianenigma added the A0-please_review Pull request needs code review. label Jul 14, 2019
node/runtime/src/lib.rs Outdated Show resolved Hide resolved

impl<T: Trait + Send + Sync> SignedExtension for CheckWeight<T> {
type AccountId = T::AccountId;
// TODO TODO: make sure that this has to be here and not in validate.
Copy link
Member

Choose a reason for hiding this comment

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

it should be in both; validate happens on the way from the txq into the authored block, pre_dispatch is when verifying an (already authored) block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will add it once the operational stuff is merged in.

@@ -435,12 +429,17 @@ mod tests {
}
}

type SignedExtra = (system::CheckNonce<Runtime>, balances::TakeFees<Runtime>);
type SignedExtra = node_runtime::SignedExtra<Runtime>;
Copy link
Member

Choose a reason for hiding this comment

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

this shouldn't be pulling in random types/configuration from node_runtime. it should formulate its own SignedExtra type as needed, just as it formulates its own config trait implementations.

@@ -51,6 +51,16 @@ pub struct FactoryState<N> {

type Number = <<node_primitives::Block as BlockT>::Header as HeaderT>::Number;

impl<Number> FactoryState<Number> {
fn build_extra(index: node_primitives::Index, phase: u64) -> node_runtime::SignedExtra<Runtime> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gavofyork how about this? The factory seems to be an attachment that only works with substrate node and it should be fine to borrow this type.

@kianenigma kianenigma changed the title Weight signed extension. Weight Check signed extension. Jul 16, 2019
@gavofyork gavofyork mentioned this pull request Jul 16, 2019
11 tasks
node/executor/src/lib.rs Outdated Show resolved Hide resolved
node/executor/src/lib.rs Outdated Show resolved Hide resolved
@gavofyork gavofyork merged commit a8789b9 into gav-extensble-transactions Jul 16, 2019
@gavofyork gavofyork deleted the kiz-port-weight-ext branch July 16, 2019 10:42
kianenigma pushed a commit that referenced this pull request Jul 22, 2019
* Make extrinsics extensible.

Also Remove old extrinsic types.

* Rest of mockup. Add tips.

* Fix some build issues

* Runtiem builds :)

* Substrate builds.

* Fix a doc test

* Compact encoding

* Extract out the era logic into an extension

* Weight Check signed extension. (#3115)

* Weight signed extension.

* Revert a bit + test for check era.

* Update Cargo.toml

* Update node/cli/src/factory_impl.rs

* Update node/executor/src/lib.rs

* Update node/executor/src/lib.rs

* Don't use len for weight - use data.

* Operational Transaction; second attempt (#3138)

* working poc added.

* some fixes.

* Update doc.

* Fix all tests + final logic.

* more refactoring.

* nits.

* System block limit in bytes.

* Silent the storage macro warnings.

* More logic more tests.

* Fix import.

* Refactor names.

* Fix build.

* Update srml/balances/src/lib.rs

* Final refactor.

* Bump transaction version

* Fix weight mult test.

* Fix more tests and improve doc.

* Bump.

* Make some tests work again.

* Fix subkey.

* Remove todos + bump.

* Ignore expensive test.

* Bump.
bkchr pushed a commit that referenced this pull request Jul 25, 2019
* Make extrinsics extensible.

Also Remove old extrinsic types.

* Rest of mockup. Add tips.

* Fix some build issues

* Runtiem builds :)

* Substrate builds.

* Fix a doc test

* Compact encoding

* Extract out the era logic into an extension

* Weight Check signed extension. (#3115)

* Weight signed extension.

* Revert a bit + test for check era.

* Update Cargo.toml

* Update node/cli/src/factory_impl.rs

* Update node/executor/src/lib.rs

* Update node/executor/src/lib.rs

* Don't use len for weight - use data.

* Operational Transaction; second attempt (#3138)

* working poc added.

* some fixes.

* Update doc.

* Fix all tests + final logic.

* more refactoring.

* nits.

* System block limit in bytes.

* Silent the storage macro warnings.

* More logic more tests.

* Fix import.

* Refactor names.

* Fix build.

* Update srml/balances/src/lib.rs

* Final refactor.

* Bump transaction version

* Fix weight mult test.

* Fix more tests and improve doc.

* Bump.

* Make some tests work again.

* Fix subkey.

* Remove todos + bump.

* First draft of annotating weights.

* Refactor weight to u64.

* More refactoring and tests.

* New convert for weight to fee

* more tests.

* remove merge redundancy.

* Fix system test.

* Bring back subkey stuff.

* a few stress tests.

* fix some of the grumbles.

* Final nits.

* Update srml/system/src/lib.rs

Co-Authored-By: DemiMarie-parity <[email protected]>

* Scale weights by 1000.

* Bump.

* Fix decl_storage test.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants