Skip to content
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

impl ed25519 backward compatibility #1982

Merged
merged 2 commits into from
Dec 6, 2022
Merged

Conversation

librelois
Copy link
Collaborator

What does it do?

The host function ed25519_verify has changed its behavior in the substrate history, because of the change from lib ed25519-dalek to lib ed25519-zebra, which handles certain cases differently (at least the "zeroed" case).

moon* networks have old blocks that are not compatible with ed25519-zebra, this PR introduce a backward compatibility mechanism that allow to use the old lib (ed25519-dalek) to synchronize old blocks.

To be able to do that, we use the new extension UseDalekExt: paritytech/substrate#12661

What important points reviewers should know?

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

@librelois librelois added B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit labels Dec 1, 2022
@librelois librelois mentioned this pull request Dec 1, 2022
14 tasks
#[cfg(feature = "moonbeam-native")]
impl ExecutorT for MoonbeamExecutor {
fn first_block_number_compatible_with_ed25519_zebra() -> Option<u32> {
Some(2_000_000)
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand correctly, this block numbers are meant to indicate the height at which a substrate version changing ed25519 library was introduced in each runtime. Just to verify, are this block numbers (2_000_000, 3_000_000) correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this block numbers are meant to indicate the height at which a substrate version changing ed25519 library was introduced in each runtime

No, this block number indicates from which block the behavior of the host function should change, knowing that this only applies when synchronizing past blocks. Normally our runtimes are "compatible" with the new behavior since runtime 1100, but for safety we take a more recent block.

@librelois librelois merged commit 7e0e865 into master Dec 6, 2022
@librelois librelois deleted the elois-ed25519-compatibility branch December 6, 2022 15:26
imstar15 pushed a commit to AvaProtocol/moonbeam that referenced this pull request May 16, 2023
* update substrate fork

* impl backward ed25519 compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants