-
Notifications
You must be signed in to change notification settings - Fork 837
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 v2 - Inbound Queue #6697
Closed
claravanstaden
wants to merge
76
commits into
paritytech:master
from
claravanstaden:inbound-queue-v2-clean
Closed
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
07808bd
inbound queue v2
claravanstaden 6f238eb
adds sparse bitmap
claravanstaden b0115cd
use sparse bitmap
claravanstaden c27def2
use payfees
claravanstaden 93b4516
Update bridges/snowbridge/pallets/inbound-queue-v2/src/lib.rs
claravanstaden 3a13134
Update bridges/snowbridge/pallets/inbound-queue-v2/src/lib.rs
claravanstaden 7e23462
rename NonceBitmap
claravanstaden 68f5a8e
config T::XcmPrologueFee: Balance
claravanstaden 02e8081
burn fees
claravanstaden ee0bc27
fix westend config
claravanstaden 4309272
use sendcontroller
claravanstaden de00eb6
runtime config for sendcontroller
claravanstaden 3653b7f
wip
claravanstaden 990bf47
tests
claravanstaden 9f7829c
xcm fee
claravanstaden 11839dc
adds comments
claravanstaden 8974696
revert sendcontroller
claravanstaden 75d3c06
adds test for xcm register command
claravanstaden c666d23
update test
claravanstaden 42d688a
runtime api
claravanstaden 92e3419
adds comment
claravanstaden 37ecd53
update test
claravanstaden 69a660b
update tests
claravanstaden 43f0d8d
Merge branch 'master' into inbound-queue-v2-clean
claravanstaden 71929f6
prdoc
claravanstaden 5735960
adds register token test
claravanstaden a935ff2
enable exchange asset on AH
claravanstaden 373d63a
fix transact
claravanstaden a61ceef
Fix for register token
yrong fae2947
Merge pull request #6 from yrong/ron/inbound-queue-v2-clean
claravanstaden 7e64403
add pool
claravanstaden d77a1ee
fix pool owner
claravanstaden f40cfd4
use weth for execution fees on AH
claravanstaden 9b8117b
cleanup test
claravanstaden c2804dc
fix aliasorigin
claravanstaden 02750d6
remove unnecessary alias origin
claravanstaden 40e85ea
separate inbound pallet index IDs for v1 and v2
claravanstaden d70ac6c
fix reentrancy bug
claravanstaden bc45bbd
send all assets in a single instruction
claravanstaden 9ffb3e1
use descend origin instead of alias origin
claravanstaden 85d355e
use claimer for refund surplus, otherwise relayer
claravanstaden 1168a16
Merge branch 'master' into inbound-queue-v2-clean
claravanstaden f1263e4
more tests
claravanstaden 2d3a834
Merge remote-tracking branch 'origin/inbound-queue-v2-clean' into inb…
claravanstaden 6af760b
allow invalid xcm
claravanstaden b368760
allow invalid claimer
claravanstaden 9939927
move claimer before assets
claravanstaden 028e0e8
Merge branch 'master' into inbound-queue-v2-clean
claravanstaden 8f11a76
apply weight at most change
claravanstaden 2484821
penpal test
claravanstaden 373c878
pna progress
claravanstaden 30d0cf4
finish integration tests
claravanstaden a35eee1
adds tests, changes message format
claravanstaden 6208dfd
fmt
claravanstaden d0624e2
fmt
claravanstaden c66fcb1
change fee asset from weth to eth
claravanstaden ddece3c
adds abi decoding
claravanstaden e93393f
Merge branch 'master' into inbound-queue-v2-clean
claravanstaden 3103970
apply merge damage changes
claravanstaden facc3c4
Merge branch 'master' into inbound-queue-v2-clean
claravanstaden 959c662
fixes
claravanstaden 61e2a28
fix encoding
claravanstaden 1d7ffa0
complete abi encoded payload
claravanstaden 1d3fb32
fix tests
claravanstaden 09dfe47
print register token values
claravanstaden c9f15ac
update gateway contract address and adds logs
claravanstaden 5432cbc
Merge branch 'master' into inbound-queue-v2-clean
franciscoaguirre 4e0fb26
Update from franciscoaguirre running command 'fmt'
github-actions[bot] cece49a
Update bridges/snowbridge/pallets/inbound-queue-v2/src/test.rs
claravanstaden 5b28126
Update bridges/snowbridge/primitives/router/src/inbound/v2.rs
claravanstaden bec9f2c
pr comments
claravanstaden 687e45e
replace operating mode
claravanstaden 70a9e42
Update bridges/snowbridge/pallets/inbound-queue-v2/runtime-api/src/li…
claravanstaden f7cdc2c
Update bridges/snowbridge/pallets/inbound-queue-v2/src/api.rs
claravanstaden fde022b
Update bridges/snowbridge/pallets/inbound-queue-v2/src/envelope.rs
claravanstaden 08f76d3
Update bridges/snowbridge/pallets/inbound-queue-v2/src/lib.rs
claravanstaden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
[package] | ||
name = "snowbridge-pallet-inbound-queue-v2" | ||
description = "Snowbridge Inbound Queue Pallet V2" | ||
version = "0.2.0" | ||
authors = ["Snowfork <[email protected]>"] | ||
edition.workspace = true | ||
repository.workspace = true | ||
license = "Apache-2.0" | ||
categories = ["cryptography::cryptocurrencies"] | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[dependencies] | ||
alloy-core = { workspace = true, features = ["sol-types"] } | ||
codec = { features = ["derive"], workspace = true } | ||
hex-literal = { optional = true, workspace = true, default-features = true } | ||
log = { workspace = true } | ||
scale-info = { features = ["derive"], workspace = true } | ||
serde = { optional = true, workspace = true, default-features = true } | ||
|
||
frame-benchmarking = { optional = true, workspace = true } | ||
frame-support = { workspace = true } | ||
frame-system = { workspace = true } | ||
pallet-balances = { workspace = true } | ||
sp-core = { workspace = true } | ||
sp-io = { workspace = true } | ||
sp-runtime = { workspace = true } | ||
sp-std = { workspace = true } | ||
|
||
xcm = { workspace = true } | ||
xcm-builder = { workspace = true } | ||
xcm-executor = { workspace = true } | ||
|
||
snowbridge-beacon-primitives = { workspace = true } | ||
snowbridge-core = { workspace = true } | ||
snowbridge-pallet-inbound-queue-fixtures-v2 = { optional = true, workspace = true } | ||
snowbridge-router-primitives = { workspace = true } | ||
|
||
[dev-dependencies] | ||
frame-benchmarking = { workspace = true, default-features = true } | ||
hex = { workspace = true, default-features = true } | ||
hex-literal = { workspace = true, default-features = true } | ||
snowbridge-pallet-ethereum-client = { workspace = true, default-features = true } | ||
sp-keyring = { workspace = true, default-features = true } | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"alloy-core/std", | ||
"codec/std", | ||
"frame-benchmarking/std", | ||
"frame-support/std", | ||
"frame-system/std", | ||
"log/std", | ||
"pallet-balances/std", | ||
"scale-info/std", | ||
"serde", | ||
"snowbridge-beacon-primitives/std", | ||
"snowbridge-core/std", | ||
"snowbridge-pallet-inbound-queue-fixtures-v2?/std", | ||
"snowbridge-router-primitives/std", | ||
"sp-core/std", | ||
"sp-io/std", | ||
"sp-runtime/std", | ||
"sp-std/std", | ||
"xcm-builder/std", | ||
"xcm-executor/std", | ||
"xcm/std", | ||
] | ||
runtime-benchmarks = [ | ||
"frame-benchmarking", | ||
"frame-benchmarking/runtime-benchmarks", | ||
"frame-support/runtime-benchmarks", | ||
"frame-system/runtime-benchmarks", | ||
"hex-literal", | ||
"pallet-balances/runtime-benchmarks", | ||
"snowbridge-core/runtime-benchmarks", | ||
"snowbridge-pallet-ethereum-client/runtime-benchmarks", | ||
"snowbridge-pallet-inbound-queue-fixtures-v2/runtime-benchmarks", | ||
"snowbridge-router-primitives/runtime-benchmarks", | ||
"sp-runtime/runtime-benchmarks", | ||
"xcm-executor/runtime-benchmarks", | ||
] | ||
try-runtime = [ | ||
"frame-support/try-runtime", | ||
"frame-system/try-runtime", | ||
"pallet-balances/try-runtime", | ||
"snowbridge-pallet-ethereum-client/try-runtime", | ||
"sp-runtime/try-runtime", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ethereum Inbound Queue | ||
|
||
Reads messages from Ethereum and sends it to intended destination on Polkadot, using XCM. | ||
34 changes: 34 additions & 0 deletions
34
bridges/snowbridge/pallets/inbound-queue-v2/fixtures/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[package] | ||
name = "snowbridge-pallet-inbound-queue-fixtures-v2" | ||
description = "Snowbridge Inbound Queue Test Fixtures V2" | ||
version = "0.10.0" | ||
authors = ["Snowfork <[email protected]>"] | ||
edition.workspace = true | ||
repository.workspace = true | ||
license = "Apache-2.0" | ||
categories = ["cryptography::cryptocurrencies"] | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[dependencies] | ||
hex-literal = { workspace = true, default-features = true } | ||
snowbridge-beacon-primitives = { workspace = true } | ||
snowbridge-core = { workspace = true } | ||
sp-core = { workspace = true } | ||
sp-std = { workspace = true } | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"snowbridge-beacon-primitives/std", | ||
"snowbridge-core/std", | ||
"sp-core/std", | ||
"sp-std/std", | ||
] | ||
runtime-benchmarks = [ | ||
"snowbridge-core/runtime-benchmarks", | ||
] |
7 changes: 7 additions & 0 deletions
7
bridges/snowbridge/pallets/inbound-queue-v2/fixtures/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
pub mod register_token; | ||
pub mod send_token; | ||
pub mod send_token_to_penpal; |
97 changes: 97 additions & 0 deletions
97
bridges/snowbridge/pallets/inbound-queue-v2/fixtures/src/register_token.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
// Generated, do not edit! | ||
// See ethereum client README.md for instructions to generate | ||
|
||
use hex_literal::hex; | ||
use snowbridge_beacon_primitives::{ | ||
types::deneb, AncestryProof, BeaconHeader, ExecutionProof, VersionedExecutionPayloadHeader, | ||
}; | ||
use snowbridge_core::inbound::{InboundQueueFixture, Log, Message, Proof}; | ||
use sp_core::U256; | ||
use sp_std::vec; | ||
|
||
pub fn make_register_token_message() -> InboundQueueFixture { | ||
InboundQueueFixture { | ||
message: Message { | ||
event_log: Log { | ||
address: hex!("eda338e4dc46038493b885327842fd3e301cab39").into(), | ||
topics: vec![ | ||
hex!("7153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84f").into(), | ||
hex!("c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539").into(), | ||
hex!("5f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0").into(), | ||
], | ||
data: hex!("00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e00a736aa00000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d00e40b54020000000000000000000000000000000000000000000000000000000000").into(), | ||
}, | ||
proof: Proof { | ||
receipt_proof: (vec![ | ||
hex!("dccdfceea05036f7b61dcdabadc937945d31e68a8d3dfd4dc85684457988c284").to_vec(), | ||
hex!("4a98e45a319168b0fc6005ce6b744ee9bf54338e2c0784b976a8578d241ced0f").to_vec(), | ||
], vec![ | ||
hex!("f851a09c01dd6d2d8de951c45af23d3ad00829ce021c04d6c8acbe1612d456ee320d4980808080808080a04a98e45a319168b0fc6005ce6b744ee9bf54338e2c0784b976a8578d241ced0f8080808080808080").to_vec(), | ||
hex!("f9028c30b9028802f90284018301d205b9010000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000080000000000000000000000000000004000000000080000000000000000000000000000000000010100000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000040004000000000000002000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000200000000000010f90179f85894eda338e4dc46038493b885327842fd3e301cab39e1a0f78bb28d4b1d7da699e5c0bc2be29c2b04b5aab6aacf6298fe5304f9db9c6d7ea000000000000000000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7df9011c94eda338e4dc46038493b885327842fd3e301cab39f863a07153f9357c8ea496bba60bf82e67143e27b64462b49041f8e689e1b05728f84fa0c173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539a05f7060e971b0dc81e63f0aa41831091847d97c1a4693ac450cc128c7214e65e0b8a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e00a736aa00000000000087d1f7fdfee7f651fabc8bfcb6e086c278b77a7d00e40b54020000000000000000000000000000000000000000000000000000000000").to_vec(), | ||
]), | ||
execution_proof: ExecutionProof { | ||
header: BeaconHeader { | ||
slot: 393, | ||
proposer_index: 4, | ||
parent_root: hex!("6545b47a614a1dd4cad042a0cdbbf5be347e8ffcdc02c6c64540d5153acebeef").into(), | ||
state_root: hex!("b62ac34a8cb82497be9542fe2114410c9f6021855b766015406101a1f3d86434").into(), | ||
body_root: hex!("04005fe231e11a5b7b1580cb73b177ae8b338bedd745497e6bb7122126a806db").into(), | ||
}, | ||
ancestry_proof: Some(AncestryProof { | ||
header_branch: vec![ | ||
hex!("6545b47a614a1dd4cad042a0cdbbf5be347e8ffcdc02c6c64540d5153acebeef").into(), | ||
hex!("fa84cc88ca53a72181599ff4eb07d8b444bce023fe2347c3b4f51004c43439d3").into(), | ||
hex!("cadc8ae211c6f2221c9138e829249adf902419c78eb4727a150baa4d9a02cc9d").into(), | ||
hex!("33a89962df08a35c52bd7e1d887cd71fa7803e68787d05c714036f6edf75947c").into(), | ||
hex!("2c9760fce5c2829ef3f25595a703c21eb22d0186ce223295556ed5da663a82cf").into(), | ||
hex!("e1aa87654db79c8a0ecd6c89726bb662fcb1684badaef5cd5256f479e3c622e1").into(), | ||
hex!("aa70d5f314e4a1fbb9c362f3db79b21bf68b328887248651fbd29fc501d0ca97").into(), | ||
hex!("160b6c235b3a1ed4ef5f80b03ee1c76f7bf3f591c92fca9d8663e9221b9f9f0f").into(), | ||
hex!("f68d7dcd6a07a18e9de7b5d2aa1980eb962e11d7dcb584c96e81a7635c8d2535").into(), | ||
hex!("1d5f912dfd6697110dd1ecb5cb8e77952eef57d85deb373572572df62bb157fc").into(), | ||
hex!("ffff0ad7e659772f9534c195c815efc4014ef1e1daed4404c06385d11192e92b").into(), | ||
hex!("6cf04127db05441cd833107a52be852868890e4317e6a02ab47683aa75964220").into(), | ||
hex!("b7d05f875f140027ef5118a2247bbb84ce8f2f0f1123623085daf7960c329f5f").into(), | ||
], | ||
finalized_block_root: hex!("751414cd97c0624f922b3e80285e9f776b08fa22fd5f87391f2ed7ef571a8d46").into(), | ||
}), | ||
execution_header: VersionedExecutionPayloadHeader::Deneb(deneb::ExecutionPayloadHeader { | ||
parent_hash: hex!("8092290aa21b7751576440f77edd02a94058429ce50e63a92d620951fb25eda2").into(), | ||
fee_recipient: hex!("0000000000000000000000000000000000000000").into(), | ||
state_root: hex!("96a83e9ddf745346fafcb0b03d57314623df669ed543c110662b21302a0fae8b").into(), | ||
receipts_root: hex!("dccdfceea05036f7b61dcdabadc937945d31e68a8d3dfd4dc85684457988c284").into(), | ||
logs_bloom: hex!("00000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000080000000400000000000000000000004000000000080000000000000000000000000000000000010100000000000000000000000000000000020000000000000000000000000000000000080000000000000000000000000000040004000000000000002002002000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000080000000000000000000000000000000000100000000000000000200000200000010").into(), | ||
prev_randao: hex!("62e309d4f5119d1f5c783abc20fc1a549efbab546d8d0b25ff1cfd58be524e67").into(), | ||
block_number: 393, | ||
gas_limit: 54492273, | ||
gas_used: 199644, | ||
timestamp: 1710552813, | ||
extra_data: hex!("d983010d0b846765746888676f312e32312e368664617277696e").into(), | ||
base_fee_per_gas: U256::from(7u64), | ||
block_hash: hex!("6a9810efb9581d30c1a5c9074f27c68ea779a8c1ae31c213241df16225f4e131").into(), | ||
transactions_root: hex!("2cfa6ed7327e8807c7973516c5c32a68ef2459e586e8067e113d081c3bd8c07d").into(), | ||
withdrawals_root: hex!("792930bbd5baac43bcc798ee49aa8185ef76bb3b44ba62b91d86ae569e4bb535").into(), | ||
blob_gas_used: 0, | ||
excess_blob_gas: 0, | ||
}), | ||
execution_branch: vec![ | ||
hex!("a6833fa629f3286b6916c6e50b8bf089fc9126bee6f64d0413b4e59c1265834d").into(), | ||
hex!("b46f0c01805fe212e15907981b757e6c496b0cb06664224655613dcec82505bb").into(), | ||
hex!("db56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71").into(), | ||
hex!("d3af7c05c516726be7505239e0b9c7cb53d24abce6b91cdb3b3995f0164a75da").into(), | ||
], | ||
} | ||
}, | ||
}, | ||
finalized_header: BeaconHeader { | ||
slot: 864, | ||
proposer_index: 4, | ||
parent_root: hex!("614e7672f991ac268cd841055973f55e1e42228831a211adef207bb7329be614").into(), | ||
state_root: hex!("5fa8dfca3d760e4242ab46d529144627aa85348a19173b6e081172c701197a4a").into(), | ||
body_root: hex!("0f34c083b1803666bb1ac5e73fa71582731a2cf37d279ff0a3b0cad5a2ff371e").into(), | ||
}, | ||
block_roots_root: hex!("b9aab9c388c4e4fcd899b71f62c498fc73406e38e8eb14aa440e9affa06f2a10").into(), | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
This could also use more details like architecture overview, APIs, usage patterns, etc.