Skip to content

Unstuck Snowbridge#313

Merged
fellowship-merge-bot[bot] merged 28 commits intopolkadot-fellows:mainfrom
Snowfork:unstuck-snowbridge
May 19, 2024
Merged

Unstuck Snowbridge#313
fellowship-merge-bot[bot] merged 28 commits intopolkadot-fellows:mainfrom
Snowfork:unstuck-snowbridge

Conversation

@claravanstaden
Copy link
Copy Markdown
Contributor

@claravanstaden claravanstaden commented May 17, 2024

Upgrades Snowbridge with an Ethereum client fixes:

Adds a migration to reset the Ethereum checkpoint. Will be reset again to the moment recent checkpoint before merged.

TODO:

  • Check migration works
  • Check converting Sync Committee to prepared keys is OK for a migration

@claravanstaden claravanstaden mentioned this pull request May 17, 2024
10 tasks

pub struct UnstuckSnowbridge;

impl OnRuntimeUpgrade for UnstuckSnowbridge {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to add it to the list of migrations (example)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder! b13f7a9

@claravanstaden
Copy link
Copy Markdown
Contributor Author

@acatangiu the migration is roughly doing the same as the force_checkpoint extrinsic. It looks like an expensive operation compared to the P<>K bridge migration - the weight is Weight::from_parts(101_492_831_000, 0). Do you think this will be a problem? We'll test of course but just wanted to also ask your opinion.

}

fn is_bridge_stuck() -> bool {
LatestFinalizedBlockRoot::<Runtime>::get() == LAST_IMPORTED_BEACON_HEADER.into()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We expect that this LAST_IMPORTED_BEACON_HEADER will not be reimported, yes?

(I guess the checkpoint is from a block newer than that)

@acatangiu
Copy link
Copy Markdown
Contributor

@acatangiu the migration is roughly doing the same as the force_checkpoint extrinsic. It looks like an expensive operation compared to the P<>K bridge migration - the weight is Weight::from_parts(101_492_831_000, 0). Do you think this will be a problem? We'll test of course but just wanted to also ask your opinion.

Should be ok as long as it fits a block.

claravanstaden and others added 6 commits May 17, 2024 16:23
…o_ethereum_unstuck.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>
…o_ethereum_unstuck.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>
…o_ethereum_unstuck.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>
@vgeddes
Copy link
Copy Markdown
Contributor

vgeddes commented May 17, 2024

@acatangiu the migration is roughly doing the same as the force_checkpoint extrinsic. It looks like an expensive operation compared to the P<>K bridge migration - the weight is Weight::from_parts(101_492_831_000, 0). Do you think this will be a problem? We'll test of course but just wanted to also ask your opinion.

Should be ok as long as it fits a block.

Yeah this is fine, is well below the block limit. And we know it works because our initial governance proposal already executed a force_checkpoint successfully on BridgeHub.

@claravanstaden claravanstaden marked this pull request as ready for review May 17, 2024 17:23
Copy link
Copy Markdown
Contributor

@vgeddes vgeddes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Copy Markdown
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migration code looks good, also validated that the new checkpoint leads to https://beaconscan.com/slot/9094528.

@joepetrowski
Copy link
Copy Markdown
Contributor

/merge

@fellowship-merge-bot fellowship-merge-bot bot merged commit 2f8a10e into polkadot-fellows:main May 19, 2024
@fellowship-merge-bot
Copy link
Copy Markdown
Contributor

Enabled auto-merge in Pull Request

Available commands
  • /merge: Enables auto-merge for Pull Request
  • /merge cancel: Cancels auto-merge for Pull Request
  • /merge help: Shows this menu

For more information see the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants