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

Make TransactionExtension tuple of tuple transparent for implication #7028

Merged
merged 11 commits into from
Jan 4, 2025

Conversation

gui1117
Copy link
Contributor

@gui1117 gui1117 commented Jan 2, 2025

Currently (A, B, C) and ((A, B), C) change the order of implications in the transaction extension pipeline. This order is not accessible in the metadata, because the metadata is just a vector of transaction extension, the nested structure is not visible.

This PR make the implementation for tuple of TransactionExtension better for tuple of tuple. (A, B, C) and ((A, B), C) don't change the implication for the validation A.

This is a breaking change but only when using the trait TransactionExtension the code implementing the trait is not breaking (surprising rust behavior but fine).

@gui1117
Copy link
Contributor Author

gui1117 commented Jan 2, 2025

/cmd prdoc --audience runtime_dev runtime_user

@gui1117 gui1117 added the T17-primitives Changes to primitives that are not covered by any other label. label Jan 2, 2025
@gui1117 gui1117 changed the title [draft] Make TransactionExtension tuple of tuple transparent for implication Make TransactionExtension tuple of tuple transparent for implication Jan 2, 2025
@gui1117 gui1117 marked this pull request as ready for review January 2, 2025 10:48
@gui1117 gui1117 requested a review from a team as a code owner January 2, 2025 10:48
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/12581249774
Failed job name: cargo-clippy

&ImplicationParts {
base: implication_parts.base,
explicit: (&following_explicit_implications, implication_parts.explicit),
implicit: (&following_implicit_implications, implication_parts.implicit),
Copy link
Member

Choose a reason for hiding this comment

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

This keeps the order correct as
((Base1, Base2..), (Explicit1, Explicit2..), (Implicit1, Implicit2..)) instead of
((Base1, Explicit1, Implicit1), (Base2, Explicit2, Implicit2)...)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On master the order is:

  • For the pipeline (A, B, C, D) the implication in the validation of A is (Base, ExpB, ExpC, ExpD, ImpB, ImpC, ImpD).
  • For the pipeline ((A, B), C, D) the implication in the validation of A is ((Base, ExpC, ExpD, ImpC, ImpD), ExpB, ImpB). Because when calling the validation of the inner tuple, the outer give the whole (Base, ExpC, ExpD, ImpC, ImpD) as inherited implication, and the inner tuple can't destructure and restructure it.

With this PR the order is in both case (Base, ExpB, ExpC, ExpD, ImpB, ImpC, ImpD).

@paritytech-review-bot paritytech-review-bot bot requested a review from a team January 3, 2025 01:54
Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

Nice work!

@gui1117 gui1117 enabled auto-merge January 4, 2025 01:08
@gui1117 gui1117 added this pull request to the merge queue Jan 4, 2025
Merged via the queue into master with commit b5a5ac4 Jan 4, 2025
198 of 201 checks passed
@gui1117 gui1117 deleted the gui-pipeline-v2 branch January 4, 2025 02:38
dudo50 pushed a commit to paraspell-research/polkadot-sdk that referenced this pull request Jan 4, 2025
paritytech#7028)

Currently `(A, B, C)` and `((A, B), C)` change the order of implications
in the transaction extension pipeline. This order is not accessible in
the metadata, because the metadata is just a vector of transaction
extension, the nested structure is not visible.

This PR make the implementation for tuple of `TransactionExtension`
better for tuple of tuple. `(A, B, C)` and `((A, B), C)` don't change
the implication for the validation A.

This is a breaking change but only when using the trait
`TransactionExtension` the code implementing the trait is not breaking
(surprising rust behavior but fine).

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <[email protected]>
@gui1117 gui1117 added the A4-needs-backport Pull request must be backported to all maintained releases. label Jan 7, 2025
@paritytech-cmd-bot-polkadot-sdk

Created backport PR for stable2407:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-7028-to-stable2407
git worktree add --checkout .worktree/backport-7028-to-stable2407 backport-7028-to-stable2407
cd .worktree/backport-7028-to-stable2407
git reset --hard HEAD^
git cherry-pick -x b5a5ac4487890046d226bedb0238eaccb423ae42
git push --force-with-lease

@paritytech-cmd-bot-polkadot-sdk

Created backport PR for stable2409:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-7028-to-stable2409
git worktree add --checkout .worktree/backport-7028-to-stable2409 backport-7028-to-stable2409
cd .worktree/backport-7028-to-stable2409
git reset --hard HEAD^
git cherry-pick -x b5a5ac4487890046d226bedb0238eaccb423ae42
git push --force-with-lease

github-actions bot pushed a commit that referenced this pull request Jan 7, 2025
#7028)

Currently `(A, B, C)` and `((A, B), C)` change the order of implications
in the transaction extension pipeline. This order is not accessible in
the metadata, because the metadata is just a vector of transaction
extension, the nested structure is not visible.

This PR make the implementation for tuple of `TransactionExtension`
better for tuple of tuple. `(A, B, C)` and `((A, B), C)` don't change
the implication for the validation A.

This is a breaking change but only when using the trait
`TransactionExtension` the code implementing the trait is not breaking
(surprising rust behavior but fine).

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <[email protected]>
(cherry picked from commit b5a5ac4)
@paritytech-cmd-bot-polkadot-sdk

Successfully created backport PR for stable2412:

@gui1117 gui1117 had a problem deploying to subsystem-benchmarks January 7, 2025 03:55 — with GitHub Actions Failure
ordian added a commit that referenced this pull request Jan 7, 2025
* master: (256 commits)
  fix chunk fetching network compatibility zombienet test (#6988)
  chore: delete repeat words (#7034)
  Print taplo version in CI (#7041)
  Implement cumulus StorageWeightReclaim as wrapping transaction extension + frame system ReclaimWeight (#6140)
  Make `TransactionExtension` tuple of tuple transparent for implication (#7028)
  Replace duplicated whitelist with whitelisted_storage_keys (#7024)
  [WIP] Fix networking-benchmarks (#7036)
  [docs] Fix release naming (#7032)
  migrate pallet-mixnet to umbrella crate (#6986)
  Improve remote externalities logging (#7021)
  Fix polkadot sdk doc. (#7022)
  Remove warning log from frame-omni-bencher CLI (#7020)
  [pallet-revive] fix file case (#6981)
  Add workflow for networking benchmarks (#7029)
  [CI] Skip SemVer on R0-silent and update docs (#6285)
  correct path in cumulus README (#7001)
  sync: Send already connected peers to new subscribers (#7011)
  Excluding chainlink domain for link checker CI (#6524)
  pallet-bounties: Fix benchmarks for 0 ED (#7013)
  Log peerset set ID -> protocol name mapping (#7005)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A4-needs-backport Pull request must be backported to all maintained releases. T17-primitives Changes to primitives that are not covered by any other label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants