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

Extensible transactions (and tips) #3102

Merged
merged 27 commits into from
Jul 22, 2019
Merged

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented Jul 11, 2019

This removes a lot of logic from the executive into the modules, which is good because it should never have been there in the first place. I also added tips to the payment mechanism, which is trivial now.

I removed the historical variants of UncheckedExtrinsic and MakePayment.

This changes the transaction format; for now it is:

  • Address
  • Signature
  • Era
  • Nonce
  • Tip (Balance)
  • Call

The signature payload is:

  • Call
  • Era
  • Nonce
  • Tip (Balance)
  • Checkpoint hash (or genesis hash for immortal transactions)

TODO

Maybe a different PR, maybe not.

Maybe do, maybe don't:

  • Consider moving all the signing stuff into an extensibility trait (won't do - signing is too intrinsic to a transaction).
  • Consider moving the era stuff into an extensibility trait (done).
  • Consider moving the validate-unsigned stuff into an extensibility trait (won't do - validate-unsigned is a per-module thing, which doesn't work with an attribute-system like SignedExtension).

@gavofyork gavofyork added the A3-in_progress Pull request is in progress. No review needed at this stage. label Jul 11, 2019
@gavofyork
Copy link
Member Author

CC @kianenigma

@gavofyork gavofyork changed the title Extensble transactions (and tips) Extensible transactions (and tips) Jul 11, 2019
@kianenigma kianenigma mentioned this pull request Jul 11, 2019
3 tasks
srml/system/src/lib.rs Outdated Show resolved Hide resolved
kianenigma and others added 3 commits July 16, 2019 19:42
* 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
gavofyork and others added 5 commits July 19, 2019 17:04
* 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.
@kianenigma kianenigma marked this pull request as ready for review July 19, 2019 15:37
@kianenigma
Copy link
Contributor

I put some leftover tasks/todos/thoughts there myself. Except for the last one about removing x / 4 the rest looks okay.

@kianenigma kianenigma added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Jul 19, 2019
@gavofyork
Copy link
Member Author

@kianenigma don't forget the issue for the TODO. then once it's reviewed by a third person is can be merged.

Copy link
Contributor

@jacogr jacogr left a comment

Choose a reason for hiding this comment

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

Cannot review the code, however did e2e testing with the polkadot-js API against the v2 format and this branch (and also pulled it into the apps UI), and it def. works as expected. Immortals, mortals, payloads, all ok and verifies as expected. (And all aligned with the specification as detailed in the first comment)

@kianenigma
Copy link
Contributor

Merging by the end of today if no one else reacts.

@kianenigma kianenigma self-requested a review July 22, 2019 17:03
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.

5 participants