-
Notifications
You must be signed in to change notification settings - Fork 131
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
CheckBridgedBlockNumber signed extension to reject duplicate header-submit transactions #1352
CheckBridgedBlockNumber signed extension to reject duplicate header-submit transactions #1352
Conversation
…ubmit transactions
Merging with deferred review |
Related to:
We might be able to match the call with something like:
This example is for parachains but it can be adapted for the grandpa pallet. I will do some experiments these days to see if it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good and the comment related to reducing the number of macros has been addressed as part of #1519 . Marking the PR as reviewed.
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
related to #1162 (we'll need a couple of other extensions to close the issue)
Things to do:
BestBlockNumber
storage entry (or changing existingBestFinalized
to store both block hash and number) to the grandpa pallet. This would allow us to use single storage read instead of two when validating. This needs to be done carefully (in a separate PR), because it may break existing deployments, which will need an upgrade in this case. UPD: extracted to Store best finalized header id (hash + number) instead of just hash in bridge-grandpa pallet #1368;CheckBridgedBlockNumber<Runtime, WestendGrandpaInstance>
andCheckBridgedBlockNumber<Runtime, RialtoGrandpaInstance>
? That's because every extension has associatedIDENTIFIER
const, which has to be unique. The outcome of not being unique, iirc is invalid metadata. We could useadt_const_params
rust feature if we were on nightly, but we are not. So the only solution I see now, is to have this single, multi-instance extension that can only be created using macro (as I said before - worth exploring).Update related to last checkbox - I was thinking that possibly using
impl_for_tuples
would help. So something like:But I've found no way to match (and deconstruct) runtime call when you're at pallet level. So given runtime call, but no knowledge of runtime, I can't do match inside
FilterCall::is_valid
. So I see no other option, but to use macro for now.