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

Deprecate precompile #1511

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Deprecate precompile #1511

merged 2 commits into from
Jun 6, 2024

Conversation

boundless-forest
Copy link
Member

Fix #1501

@boundless-forest boundless-forest changed the title Deprecated precompile Deprecate precompile Jun 5, 2024
Copy link

github-actions bot commented Jun 5, 2024

Check 0f1c571 crab-dev

Check runtime version

Check runtime storage

Copy link

github-actions bot commented Jun 5, 2024

Check 0f1c571 darwinia-dev

Check runtime version

Check runtime storage

Copy link

github-actions bot commented Jun 5, 2024

Check 0f1c571 koi-dev

Check runtime version

Check runtime storage

@AurevoirXavier AurevoirXavier added the C-Precompile [Component] Something about precompile label Jun 5, 2024
@@ -144,8 +144,7 @@ where
a if a == addr(0x602) =>
Some(<pallet_evm_precompile_conviction_voting::ConvictionVotingPrecompile<Runtime>>::execute(handle)),
// [0x800..) reserved for the experimental precompiles.
a if a == addr(0x800) =>
Some(<darwinia_precompile_bls12_381::BLS12381<Runtime>>::execute(handle)),
a if a == addr(0x800) => Some(Err(precompile_utils::prelude::revert("This precompile is no longer supported."))),
Copy link
Member

Choose a reason for hiding this comment

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

What if return None here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Returning None means that the precompile does not exist. But in our case, we want to remind the users that this is a deprecated precompile.

Copy link
Member

Choose a reason for hiding this comment

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

It indeed does not exist in Koi.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it doesn't exist on the testnet(mainnet) anymore, but some applications or developers may still rely on this precompile. We need to avoid the situation where an application uses this precompile(address) now, but the precompile to this address changes to a another one later. This will break the application's logic if it is not aware of the change.

The Koi is the testnet for other networks, we should keep it the same behaviour across all the networks, otherwise, some application will work on the testnet but not on the mainnet.

@AurevoirXavier AurevoirXavier merged commit 2dadcd4 into main Jun 6, 2024
11 checks passed
@AurevoirXavier AurevoirXavier deleted the bear-deprecated-precompile branch June 6, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Precompile [Component] Something about precompile
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Deprecated BLS precompile
2 participants