Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Snowbridge]: Ensure source always from AH for exported message #6838
base: master
Are you sure you want to change the base?
[Snowbridge]: Ensure source always from AH for exported message #6838
Changes from 23 commits
8a88a8b
53ee95e
525e6a6
c3b8b88
a7cb93d
277d51b
c2a8ba9
7192a5a
f7b6f3a
62f629b
eff2ef2
f84cc0a
df1e673
11f8d57
2bf5bb1
73961f4
b5d4369
0a51fec
e2e0228
7102219
7f529ed
ccf9a28
5226eed
e779308
3a66cdb
5f9ea7f
15ae2b3
e792f7d
d0027ea
fcadbd7
4b51b60
6701841
efa5114
f53964b
421b4ef
ef72cdf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
please, do not test other barriers here:
But definitely, I would be very happy if you move this test for
DenyThenTry
andDenyReserveTransferToRelayChain
to the https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-builder/src/tests/barriers.rs where we have tests for other barriers defined in xcm-builder.But please do this as a separate PR/issue, because I have a feeling that
DenyThenTry
does not work forDeny
tuple, does it? That's why you used chaining ofDenyThenTry
instead of tuple?So for example one test should be dedicated just for
DenyThenTry
to check all branches, e.g ifDenyCase1
returnsOk()
does it also checksDenyCase2
andDenyCase3
?If there is such a problem with
DenyThenTry
, we should at least update documentation (that forDeny
you cannot use tuple, but just chaining) and/or find better fix and/or deprecatedDenyThenTry
. Alternatively, we could go with some dedicatedAllow
filtering wrapper barrier withEverythingBut
like behavior.I am worried here about:
/// Deny executing the XCM if it matches any of the Deny filter regardless of anything else.
,if it passes (does not match/ignore XCM case)
DenyCase1
which returnsOk(())
then the tuplereturn Ok(())
, but does not checkDenyCase2
andDenyCase3
, which could cause a potential problem.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.
@yrong actually, let me prepare that issue
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.
#7148
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.
Exactly, the tuple does not work as expected. That's why I added the tests for the
DenyThenTry
here.I will address it in a separate PR.
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.
@bkontur Though I revert the change in
EthereumBlobExporter
with 0a51fec#diff-0bd5b75b88aee6992e3ddba0de8bd08d2ab07ecd38fc745c7d76daff56bba52Do you think it may be better to keep? so we have the double-check first in Barrier and then in
EthereumBlobExporter
.This PR is mainly for addressing one security issue recently found and I feel a bit more secure with both of that.
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.
I think it is fine as it is, just please remove this test
deny_with_reserve_transfer_to_relay_chain
from here as a part of that #7148, it is not important here.The test covering the security issue is more important at the runtime level (not the primitives level). If you want to be sure, simply write a unit test directly in the BridgeHubWestend runtime - e.g. trigger the xcm-executor with a malicious XCM program (
ExportMessage(Eth)
and origin other than AssetHubLocation), where the runtime uses the realtype Barrier
.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.
3a66cdb