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

Domains: Fix inconsistency between Block body and Trace roots #2343

Merged
merged 4 commits into from
Dec 22, 2023

Conversation

vedhavyas
Copy link
Member

This PR fixes inconsistency in domain block body and trace roots when an extrinsic fails at pre/post dispatch from the context of domain block.

Notes:
I recommend looking at tests in the first commit to understand why there would be an inconsistency.

We did consider leaving it as is and fix the domain_extrinsic_root but unfortunately, proving such fraud proof is unbounded as we cannot know how many such invalid extrinsics per domain block context exists though these extrinsics are valid per bundle context.

Current approach reverts the extrinsic changes and notes the extrinsics into system to be consistent with trace roots. we also optimistacally charge extrinsic signer the storage fees for storing extrinsic and later would also need to charge storage fees for consensus chain. The latter is left as TODO and will be handled as part of Storage fee orcale PR.

Closes #2181

Code contributor checklist:

Copy link
Member

@NingLin-P NingLin-P left a comment

Choose a reason for hiding this comment

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

Make sense in general, have some questions and nits.

domains/client/domain-operator/src/tests.rs Outdated Show resolved Hide resolved
domains/client/domain-operator/src/tests.rs Outdated Show resolved Hide resolved
domains/client/domain-operator/src/tests.rs Outdated Show resolved Hide resolved
domains/client/domain-operator/src/tests.rs Show resolved Hide resolved
domains/pallets/executive/src/lib.rs Outdated Show resolved Hide resolved
domains/pallets/executive/src/lib.rs Show resolved Hide resolved
domains/pallets/executive/src/lib.rs Show resolved Hide resolved
@vedhavyas vedhavyas requested a review from NingLin-P December 21, 2023 11:19
@vedhavyas vedhavyas added this pull request to the merge queue Dec 22, 2023
Merged via the queue into main with commit e43e11f Dec 22, 2023
10 checks passed
@vedhavyas vedhavyas deleted the failed_extrinsic_derivation branch December 22, 2023 13:02
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.

Inconsistency of domain block body and extrinsics root
2 participants