From caba294d82eeeccc3d86a158adb8ba209bf2d8fc Mon Sep 17 00:00:00 2001 From: Lior Goldberg Date: Tue, 12 Dec 2023 12:45:25 +0200 Subject: [PATCH] Cairo v0.13.0. --- WORKSPACE | 2 +- src/starkware/cairo/lang/VERSION | 2 +- src/starkware/cairo/sharp/BUILD | 3 ++- src/starkware/cairo/sharp/config.json | 2 +- src/starkware/cairo/sharp/sharp_client.py | 4 ++-- src/starkware/starknet/definitions/constants.py | 2 +- .../starknet/definitions/general_config.py | 16 ++++++++-------- .../starknet/definitions/general_config.yml | 2 +- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index f934043f..fe297dc6 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -52,7 +52,7 @@ http_archive( "//src/starkware/starknet/compiler/v1:BUILD." + CAIRO_COMPILER_ARCHIVE, ), strip_prefix = "cairo", - url = "https://github.com/starkware-libs/cairo/releases/download/v2.4.0-rc6/release-x86_64-unknown-linux-musl.tar.gz", + url = "https://github.com/starkware-libs/cairo/releases/download/v2.4.0/release-x86_64-unknown-linux-musl.tar.gz", ) http_archive( diff --git a/src/starkware/cairo/lang/VERSION b/src/starkware/cairo/lang/VERSION index 13002bf7..54d1a4f2 100644 --- a/src/starkware/cairo/lang/VERSION +++ b/src/starkware/cairo/lang/VERSION @@ -1 +1 @@ -0.13.0a3 +0.13.0 diff --git a/src/starkware/cairo/sharp/BUILD b/src/starkware/cairo/sharp/BUILD index 1fed2f62..9941bdef 100644 --- a/src/starkware/cairo/sharp/BUILD +++ b/src/starkware/cairo/sharp/BUILD @@ -49,9 +49,10 @@ py_library( ], visibility = ["//visibility:public"], deps = [ - "fact_checker_lib", + ":fact_checker_lib", "//src/starkware/cairo/bootloaders:cairo_bootloader_generate_fact_lib", "//src/starkware/cairo/bootloaders:cairo_hash_program_lib", + "//src/starkware/cairo/lang/compiler:cairo_compile_lib", "//src/starkware/cairo/lang/vm:cairo_vm_crypto_lib", "//src/starkware/cairo/lang/vm:cairo_vm_lib", requirement("urllib3"), diff --git a/src/starkware/cairo/sharp/config.json b/src/starkware/cairo/sharp/config.json index 9585a014..e53811d5 100644 --- a/src/starkware/cairo/sharp/config.json +++ b/src/starkware/cairo/sharp/config.json @@ -1,5 +1,5 @@ { "prover_url": "https://testnet.provingservice.io", - "verifier_address": "0x8f97970aC5a9aa8D130d35146F5b59c4aef57963", + "verifier_address": "0x07ec0D28e50322Eb0C159B9090ecF3aeA8346DFe", "steps_limit": 1000000 } diff --git a/src/starkware/cairo/sharp/sharp_client.py b/src/starkware/cairo/sharp/sharp_client.py index 96ca719c..3c4708f9 100755 --- a/src/starkware/cairo/sharp/sharp_client.py +++ b/src/starkware/cairo/sharp/sharp_client.py @@ -221,7 +221,7 @@ def submit(args, command_args): def get_job_status(args, command_args): - parser = argparse.ArgumentParser(description="Retreive the status of a SHARP Cairo job.") + parser = argparse.ArgumentParser(description="Retrieve the status of a SHARP Cairo job.") parser.add_argument("job_key", type=str, help="The key identifying the job.") parser.parse_args(command_args, namespace=args) @@ -242,7 +242,7 @@ def is_verified(args, command_args): ) parser.add_argument("fact", type=str, help="The fact to verify if registered.") parser.add_argument( - "--node_url", required=True, type=str, help="URL for a Goerli Ethereum node RPC API." + "--node_url", required=True, type=str, help="URL for a Sepolia Ethereum node RPC API." ) parser.parse_args(command_args, namespace=args) diff --git a/src/starkware/starknet/definitions/constants.py b/src/starkware/starknet/definitions/constants.py index 52cbf773..4c56a749 100644 --- a/src/starkware/starknet/definitions/constants.py +++ b/src/starkware/starknet/definitions/constants.py @@ -121,7 +121,7 @@ CONSUMED_MSG_TO_L2_ENCODED_DATA_SIZE = (L1_TO_L2_MSG_HEADER_SIZE + 1) - CONSUMED_MSG_TO_L2_N_TOPICS # The (empirical) L1 gas cost of each Cairo step. -N_STEPS_FEE_WEIGHT = 0.01 +N_STEPS_FEE_WEIGHT = 0.005 # Expected return values of a 'validate' entry point. VALIDATE_RETDATA = [from_bytes(b"VALID")] diff --git a/src/starkware/starknet/definitions/general_config.py b/src/starkware/starknet/definitions/general_config.py index 88f922f9..0789b6f8 100644 --- a/src/starkware/starknet/definitions/general_config.py +++ b/src/starkware/starknet/definitions/general_config.py @@ -75,15 +75,15 @@ # Given in units of wei. DEFAULT_DEPRECATED_L1_GAS_PRICE = 10**11 DEFAULT_CAIRO_RESOURCE_FEE_WEIGHTS = { - N_STEPS_RESOURCE: 0.01, + N_STEPS_RESOURCE: 0.005, **{builtin: 0.0 for builtin in ALL_BUILTINS.with_suffix()}, - with_suffix(PEDERSEN_BUILTIN): 0.32, - with_suffix(RANGE_CHECK_BUILTIN): 0.16, - with_suffix(ECDSA_BUILTIN): 20.48, - with_suffix(KECCAK_BUILTIN): 20.48, - with_suffix(BITWISE_BUILTIN): 0.64, - with_suffix(EC_OP_BUILTIN): 10.24, - with_suffix(POSEIDON_BUILTIN): 0.32, + with_suffix(PEDERSEN_BUILTIN): 0.16, + with_suffix(RANGE_CHECK_BUILTIN): 0.08, + with_suffix(ECDSA_BUILTIN): 10.24, + with_suffix(KECCAK_BUILTIN): 10.24, + with_suffix(BITWISE_BUILTIN): 0.32, + with_suffix(EC_OP_BUILTIN): 5.12, + with_suffix(POSEIDON_BUILTIN): 0.16, } DEFAULT_ETH_IN_STRK_WEI = 10**21 diff --git a/src/starkware/starknet/definitions/general_config.yml b/src/starkware/starknet/definitions/general_config.yml index 5c5a3304..1f52682c 100644 --- a/src/starkware/starknet/definitions/general_config.yml +++ b/src/starkware/starknet/definitions/general_config.yml @@ -1,5 +1,5 @@ cairo_resource_fee_weights: - n_steps: 0.01 + n_steps: 0.005 compiled_class_hash_commitment_tree_height: 251 constant_gas_price: false contract_storage_commitment_tree_height: 251