-
Notifications
You must be signed in to change notification settings - Fork 1
Transact from eth to sub #114
base: bridge-next-gen
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## bridge-next-gen #114 +/- ##
==================================================
Coverage ? 40.92%
==================================================
Files ? 52
Lines ? 3372
Branches ? 0
==================================================
Hits ? 1380
Misses ? 1992
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
...arachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
Outdated
Show resolved
Hide resolved
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.
Looks great! The penpal changes just need to made generic, otherwise awesome!
...arachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
Outdated
Show resolved
Hide resolved
|
||
parameter_types! { | ||
pub const RelayLocation: Location = Location::parent(); | ||
pub const RelayNetwork: Option<NetworkId> = None; | ||
pub const RelayNetwork: NetworkId = Rococo; |
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.
We cannot make this change because the polkadot-fellows/runtimes#130 uses this parachain for testing as well. Perhaps we can set the Relay chain more generically?
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.
As you may notice, with more bridge features like Transact added to penpal, we do need several configurations Network/Ethereum binding, basically the same as the configuration on AssetHub.
In above commit I've made them as Storage
which can be changed for network like Polkadot or Ethereum mainnet, but maybe it's better to be more specific to add separate runtimes for different networks(e.g. penpal-kusama&penpal-polkadot)?
WDYT?
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.
Perhaps, yes. But since this code belongs to Parity maybe it would be better to ask someone like @bkontur.
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.
Or I can use another template chain for the integration.
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.
previously we used hack like:
pub storage RelayNetwork: Option<NetworkId> = None;
but there is also new parameters pallet, so I would suggest to go configurable way instead of hard-code Rococo to penpal, because we use it for fellows also
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.
well, Adrian already changed that to storage
stuff with default to Rococo: https://github.com/paritytech/polkadot-sdk/pull/3695/files#diff-37d844ab36f3c061d846240105ddb24c0832ca0f7da21a89ea3e051c6d978b3bR64 (will be merged soon)
pub SiblingBridgeHubWithEthereumInboundQueueInstance: Location = Location::new( | ||
1, | ||
[ | ||
Parachain(bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID), |
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.
Same here, these values need to configurable so that we can set them from any runtime. Here's an example of how the Ethereum network ID was made configurable in Penpal: paritytech#3564
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.
5077bf6
to
cd7a64a
Compare
// Forward message id | ||
SetTopic(message_id.into()), | ||
]; | ||
(message.into(), fee.into()) |
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 would return 0
as a fee here. The returned fee is meant to be burnt.
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.
payload: Vec<u8>, | ||
) -> (Xcm<()>, Balance) { | ||
// Fee in native token of destination chain | ||
let xcm_fee: Asset = (Location::here(), fee).into(); |
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.
We need to use native or DOT based on whether its a system parachain or not. But in future we may want to configure this per channel.
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.
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.
5a22972 configure per channel.
WithdrawAsset(xcm_fee.clone().into()), | ||
// Pay for execution. | ||
BuyExecution { fees: xcm_fee, weight_limit: Unlimited }, | ||
Transact { origin_kind, require_weight_at_most: weight_at_most, call: payload.into() }, |
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.
We need to RefundSurplus
execution left over from the Transact and DepositAsset
any left over fees back into the prefunded account.
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.
Good catch!
ee6bdc5
## [0.5.0] - 2023-05-24 This is a small patch release that makes the `FindNode` command a bit more robst: - The `FindNode` command now retains the K (replication factor) best results. - The `FindNode` command has been updated to handle errors and unexpected states without panicking. ### Changed - kad: Refactor FindNode query, keep K best results and add tests ([#114](paritytech/litep2p#114)) --------- Signed-off-by: Alexandru Vasile <[email protected]>
No description provided.