aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
6k stars 3.61k forks source link

[Dev Portal] Bn254 algebra is not activated on testnet / mainnet #14017

Closed storojs72 closed 1 month ago

storojs72 commented 1 month ago

Issue description

This is more a question rather than issue, but let me please still ask it here.

When I'm trying to use any of cryptographic operations specific to bn254 algebra on Aptos testnet or mainnet (by running the Move script) I'm getting E_NOT_IMPLEMENTED exception. This is not the case for devnet, where bn254 operations are working.

I assume that according to AIP-86 the bn254 feature is enabled but not "activated" on testnet and mainnet. Can I ask, if there are plans to activate it and when this may happen?

Context for reproduction

Following script can be used to reproduce (on testnet / mainnet):

script {
    use aptos_std::crypto_algebra::{deserialize, serialize, one};
    use std::bn254_algebra::{FormatFrMsb, Fr};

    fun run_bn254_field_element_deserialisation<T1, T2>(
        _account: signer
    ) {
        let fr = one<Fr>();
        let fr_bytes = serialize<Fr, FormatFrMsb>(&fr);
        let _fr_deserialized = std::option::extract(&mut deserialize<Fr, FormatFrMsb>(&fr_bytes));
    }
}

either on testnet or mainnet:

{
  "Error": "Simulation failed with status: Move abort in 0x1::crypto_algebra: E_NOT_IMPLEMENTED(0xc0001): "
}
huitseeker commented 1 month ago

More specifically, we can read on the AIP: https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-86.md#suggested-deployment-timeline

This is already deployed on devnet.

Enabled on testnet in the v1.12 release.

Enabled on mainnet in the v1.14 release

As of today, mainnet ( cea6cf84416a651ffb458469b80da2da885fe1f5 ) is at v1.15.1: https://github.com/aptos-labs/aptos-core/tree/aptos-node-v1.15.1 Testnet ( 6d3beea4c174df3b42c1fa0188864b0e8fa9ed67 ) is at v1.16.0: https://github.com/aptos-labs/aptos-core/compare/aptos-release-v1.16

In other terms this issue is about clarification on BN254 precompiles having slipped from their release schedule.

alinush commented 1 month ago

Oops. Will correct soon & get back to you on when the feature will be enabled on mainnet.

zjma commented 1 month ago

@storojs72 @huitseeker we just enabled it on testnet yesterday, perhaps a few hours after you created this issue, could you try again?

storojs72 commented 1 month ago

thanks, @zjma! I can confirm it's working on testnet

alinush commented 1 month ago

Hey folks, just an update: there is currently a governance proposal out to enable BN254 on mainnet here.

alinush commented 1 month ago

This is now enabled on mainnet. Closing the issue, but please re-open if problems persist 👍