-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add Bridge Header Sync to Rococo Runtime #2983
Add Bridge Header Sync to Rococo Runtime #2983
Conversation
I think "Not Live" is the right audit status for this, but let me know if that's wrong |
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 have some concerns with the new dependencies introduced.
Also, what was the point of having it as a subtree again? The history doesn't seem to be preserved
https://github.com/paritytech/polkadot/commits/master/bridges, or at least I don't see how.
I was a bit hasty in adding the bridges code to the Polkadot workspace, there was no need for this. Good catch.
You can get a little bit of context here, but there were a few reasons. One was that since some of our components (notably the code in Another reason was that it was easier to keep Substrate dependencies in sync. If a breaking change was introduced in Substrate, you'd need a companion PR for the bridges repo and the Polkadot repo - which would add complexity to making changes to Substrate. By having it be part of the Polkadot repo one companion would be needed, and the bridges repo could be updated independently at a later date. Maybe @tomusdrw can also add some other reasons that I forgot to list here. |
I guess my question was rather why do we need to merge it instead of squash-merge?
The history of commits will not be accurate in both cases, your example showed a commit message, not history, also you can't even see it with git blame which defeats (have to follow another parent commit) the purpose of such history. BTW, github allows you to edit commit message if you click on squash and merge button manually. |
In this case since we're not updating the subtree (e.g
So I'm not too worried about this history within the
Yeah, I guess that's a good point, but we don't expect people to be checking the history of changes from the bridges repo from the Polkadot repo. We need to go back to the motivation of adding this subtree. It is not meant as a collaboration tool in the sense the development is shared between the two repos. Instead it is the best way we found to keep Substrate dependencies aligned between different repos given the fast pace of development.
Yeah I guess, I think Git would still retain knowledge of the "actual" updates and we might end up with a case where we update the entire Subtree every update, which is not what we want. |
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 runtime changes look good, but we should be using real private keys and avoid modifying any of the bridges
code.
@@ -0,0 +1,24 @@ | |||
#!/bin/bash |
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 suppose these changes don't come via subtree
update, IMHO we shouldn't be mixing adding bridges
code and polkadot
code in one PR. The point of bridges
code being part of the repository is to make it easy for polkadot devs to fix any substrate inconsistencies, not to add features.
node/service/src/chain_spec.rs
Outdated
owner: Some(get_account_id_from_seed::<sr25519::Public>("Dave")), | ||
..Default::default() | ||
}, | ||
pallet_bridge_grandpa_Instance1: rococo_runtime::BridgeWococoGrandpaConfig { | ||
owner: Some(get_account_id_from_seed::<sr25519::Public>("Eve")), |
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.
Woah, please use real accounts, that's rococo staging.
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 the problem is what accounts do we use? I figured it would be best to use dev accounts, and then talk to the DevOps team to see what "real" accounts to use.
We'd need to talk to them anyways before this would be deployed to Rococo anyways
node/service/src/chain_spec.rs
Outdated
pallet_bridge_grandpa: rococo_runtime::BridgeRococoGrandpaConfig { | ||
owner: Some(get_account_id_from_seed::<sr25519::Public>("Dave")), | ||
..Default::default() | ||
}, | ||
pallet_bridge_grandpa_Instance1: rococo_runtime::BridgeWococoGrandpaConfig { | ||
owner: Some(get_account_id_from_seed::<sr25519::Public>("Eve")), | ||
..Default::default() |
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.
pallet_bridge_grandpa: rococo_runtime::BridgeRococoGrandpaConfig { | |
owner: Some(get_account_id_from_seed::<sr25519::Public>("Dave")), | |
..Default::default() | |
}, | |
pallet_bridge_grandpa_Instance1: rococo_runtime::BridgeWococoGrandpaConfig { | |
owner: Some(get_account_id_from_seed::<sr25519::Public>("Eve")), | |
..Default::default() | |
pallet_bridge_grandpa: rococo_runtime::BridgeRococoGrandpaConfig { | |
owner: Some(root_key), | |
..Default::default() | |
}, | |
pallet_bridge_grandpa_Instance1: rococo_runtime::BridgeWococoGrandpaConfig { | |
owner: Some(root_key), | |
..Default::default() |
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 guess root
is reasonable to start
runtime/rococo/src/lib.rs
Outdated
// | ||
// Note that once this is hit the pallet will essentially throttle incoming requests down to one | ||
// call per block. | ||
pub const MaxRequests: u32 = 50; |
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.
pub const MaxRequests: u32 = 50; | |
pub const MaxRequests: u32 = 4 * HOURS as u32; |
Can we do something like that instead? This will allow us to catch-up immediately in case of 4 hours downtime.
Re @ordian
Modifying squash-merge commit message is a cool suggestion, we can try that. I'm a bit skeptical though, because it seem that every subtree update is actually two commits (squashed changes & merge commit).
Well you can't |
Thanks for the explanations! It makes sense, but would be cool if we could use the same merge strategy for all PRs.
I've quickly tested it by doing
|
Hmm, but that's not necessarily equivalent of squash-merging a PR, is it? Like |
If applied from a branch it would flatten the tree, having the same effect as
to
I don't really know why it failed before, maybe someone has made some commits to the bridges subtree that were not present in upstream? |
Disregard what I said, git seems to treat the branch with |
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.
lgtm!
BridgeRococoGrandpa: pallet_bridge_grandpa::{Pallet, Call, Storage, Config<T>} = 40, | ||
BridgeWococoGrandpa: pallet_bridge_grandpa::<Instance1>::{Pallet, Call, Storage, Config<T>} = 41, |
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 an explanatory comment would be nice here, cause we are adding Rococo
bridge pallet to Rococo
runtime. It's only because Rococo and Wococo have exactly the same runtime, but the intention is to use BridgeWococoGrandpa
pallet on Rococo and BridgeRococoGrandpa
pallet on Wococo. The other pallet will always be uninitialized/halted.
This is a bit excessive and confusing, but I think it's acceptable for the matter of simplicity (no runtime duplication).
bot merge |
Waiting for commit status. |
Merge aborted: Checks failed for d998df1 |
bot merge |
Waiting for commit status. |
This PR adds support for syncing headers between the Rococo and Wococo networks.
Before this can be deployed on the live Rococo and Wococo networks we need to change the
pallet owners from
Dave
andEve
to non-dev accounts.