-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add inbound queue #750
base: master
Are you sure you want to change the base?
Add inbound queue #750
Conversation
WASM runtime size check:Compared to target branchdancebox runtime: 1424 KB (no changes) ✅ flashbox runtime: 820 KB (no changes) ✅ dancelight runtime: 2104 KB (+2104 KB) container chain template simple runtime: 1124 KB (-4296 KB) ✅ container chain template frontier runtime: 1400 KB (-5152 KB) ✅ |
529100a
to
77d47fb
Compare
solo-chains/runtime/dancelight/src/bridge_to_ethereum_config.rs
Outdated
Show resolved
Hide resolved
solo-chains/runtime/dancelight/src/symbiotic_message_processor.rs
Outdated
Show resolved
Hide resolved
solo-chains/runtime/dancelight/src/tests/inbound_queue_tests/mock.rs
Outdated
Show resolved
Hide resolved
Coverage Report@@ Coverage Diff @@
## master add-inbound-queue +/- ##
====================================================
Coverage 64.57% 64.57% 0.00%
+ Files 317 320 +3
+ Lines 55357 55407 +50
====================================================
+ Hits 35745 35777 +32
+ Misses 19612 19630 +18
|
fff9fdc
to
3eba4a5
Compare
d2b0917
to
33b0d32
Compare
33b0d32
to
cb35524
Compare
}; | ||
|
||
// Ethereum Bridge | ||
parameter_types! { | ||
pub storage EthereumGatewayAddress: H160 = H160(hex_literal::hex!("EDa338E4dC46038493b885327842fD3E301CaB39")); |
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.
What is this storage modifier? It means that this is stored in storage and can be modified by root?
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.
it's the first time that I see it too
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 storage modifier means following:
- From name of the variable a key is derived. Formula for derivation is:
twox_128(":" ++ NAME ++ ":")
- If there is a value under the key, it is returned in response to
get()
- If not, value specified in the assignment
H160(hex_literal::hex!("EDa338E4dC46038493b885327842fD3E301CaB39"))
is returned.
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.
Also, yes since only root can write to arbitrary key, this is modified by root.
} | ||
|
||
#[derive(Encode, Decode)] | ||
pub enum Message<T> |
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.
Add docs that this is the message that comes from ethereum
Cargo.toml
Outdated
@@ -259,12 +259,18 @@ xcm-runtime-apis = { git = "https://github.com/moondance-labs/polkadot-sdk", bra | |||
|
|||
|
|||
# Bridges (wasm) | |||
alloy-primitives = { version = "0.4.2", default-features = false } |
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.
alloy-primitives = { version = "0.4.2", default-features = false } |
I believe this is unused
let message = if let Ok(payload) = decode_result { | ||
payload.message | ||
} else { | ||
return Err(DispatchError::Other("unable to parse the payload")); |
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.
return Err(DispatchError::Other("unable to parse the payload")); | |
return Err(DispatchError::Other("unable to parse the envelope payload")); |
} | ||
|
||
#[derive(Encode, Decode)] | ||
pub enum Command<T> |
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.
shal we call this InboundCommand? reason is we have a different est of outbound commands right?
@@ -140,16 +153,23 @@ impl snowbridge_pallet_system::Config for Runtime { | |||
#[cfg(feature = "runtime-benchmarks")] | |||
type Helper = benchmark_helper::EthSystemBenchHelper; | |||
type DefaultPricingParameters = Parameters; | |||
type InboundDeliveryCost = (); | |||
//type InboundDeliveryCost = EthereumInboundQueue; | |||
type InboundDeliveryCost = EthereumInboundQueue; |
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.
what are the implicatrions of this? are we going to charge for the validators payload?
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.
from what I can see it is the price that we can communicate to the SC, so I think its correct, but plz confirm
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.
Yes. And we only communicate in case root calls the extrinsic on system pallet. So, I think it is okay.
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.
Approved but I have an important question and minor comments. Specially in the inbound delivery cost
Description
This PR adds inbound queue to starlight and include tests for the same.
It adds message processor called
SymbioticMessageProcessor
which upon receiving new validators, callsExternalValidators
pallet to set the validators.What is remaining?
Note
The base of the PR is at tomasz-generic-aggregate-message-origin since this PR is dependent upon code introduced there.Base changed to master after PR merge.