Repository: 0xSpaceShard/starknet-devnet (language: python)

Issue:
Adapt to cairo-lang/Starknet 0.11.2
Currently it's a pre-release 0.11.2a0: https://github.com/starkware-libs/cairo-lang/releases

Also visible on: https://pypi.org/project/cairo-lang/#history


Discussion / hints:

Fix patch:
diff --git a/page/docs/guide/cairo1-support.md b/page/docs/guide/cairo1-support.md
index 51c8ab8eb..64e91a3ba 100644
--- a/page/docs/guide/cairo1-support.md
+++ b/page/docs/guide/cairo1-support.md
@@ -6,7 +6,7 @@ sidebar_position: 18
 
 Declaring, deploying and interacting with Cairo 1 contracts is supported in the latest version of starknet-devnet. Declaration body only includes the [Sierra](https://docs.starknet.io/documentation/architecture_and_concepts/Contracts/cairo-1-and-sierra/) of your contract class, so Devnet needs to compile it to Casm.
 
-Make sure your Devnet is using the same compiler version that you used for the compilation of the contract class being declared. To successfully declare a contract compiled with Cairo v1.0.0-rc0, if on an x86 machine, you don't have to do anything. On another architecture, or if you want to specify a custom version of the Cairo 1 compiler, you need to specify your local compiler. Use one of:
+Make sure your Devnet is using the same compiler version that you used for the compilation of the contract class being declared. To successfully declare a contract compiled with Cairo v1.1.0, if on an x86 machine, you don't have to do anything. On another architecture, or if you want to specify a custom version of the Cairo 1 compiler, you need to specify your local compiler. Use one of:
 
 - `--cairo-compiler-manifest <PATH_TO_CARGO_TOML>`
 - `--sierra-compiler-path <PATH_TO_SIERRA_EXECUTABLE>`
diff --git a/poetry.lock b/poetry.lock
index 185991f8b..954580ad3 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand.
+# This file is automatically @generated by Poetry and should not be changed by hand.
 
 [[package]]
 name = "aiohttp"
@@ -346,13 +346,13 @@ files = [
 
 [[package]]
 name = "cairo-lang"
-version = "0.11.1.1"
+version = "0.11.2"
 description = "Compiler and runner for the Cairo language"
 category = "main"
 optional = false
 python-versions = ">=3.6"
 files = [
-    {file = "cairo-lang-0.11.1.1.zip", hash = "sha256:f61228867d3f4af41ff960e0750199250d7a1c63cac52edca8b1b61a6d391823"},
+    {file = "cairo-lang-0.11.2.zip", hash = "sha256:ca38376090caf45a3363c51ce4de767aea0fd38bdecbd9887dbe4a7c58ce229c"},
 ]
 
 [package.dependencies]
@@ -2748,4 +2748,4 @@ multidict = ">=4.0"
 [metadata]
 lock-version = "2.0"
 python-versions = ">=3.9,<3.10"
-content-hash = "7fc0fd0b3242eeaa3a8f09ef9f8ec83836f0352533af5141c319cc3385a6ba3b"
+content-hash = "6c2bdf754bb4af1d130be97d95d30b1527cee4df33da22d34e190f949f317ee9"
diff --git a/pyproject.toml b/pyproject.toml
index 29b8df01e..e51951dbc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -14,7 +14,7 @@ keywords = ["starknet", "cairo", "testnet", "local", "server"]
 python = ">=3.9,<3.10"
 Flask = {extras = ["async"], version = "~2.0.3"}
 flask-cors = "~3.0.10"
-cairo-lang = "0.11.1.1"
+cairo-lang = "0.11.2"
 Werkzeug = "~2.0.3"
 cloudpickle = "~2.1.0"
 crypto-cpp-py = "~1.4.0"
diff --git a/scripts/install_dev_tools.sh b/scripts/install_dev_tools.sh
index eed10bdb6..8c3f86ace 100755
--- a/scripts/install_dev_tools.sh
+++ b/scripts/install_dev_tools.sh
@@ -25,7 +25,7 @@ fi
 if [ -z "$CAIRO_1_COMPILER_MANIFEST" ]; then
     mkdir cairo-compiler
     git clone git@github.com:starkware-libs/cairo.git cairo-compiler \
-        --branch v1.0.0-rc0 \
+        --branch v1.1.0 \
         --single-branch
     CAIRO_1_COMPILER_MANIFEST="cairo-compiler/Cargo.toml"
 
diff --git a/starknet_devnet/constants.py b/starknet_devnet/constants.py
index d09db807b..d7170d275 100644
--- a/starknet_devnet/constants.py
+++ b/starknet_devnet/constants.py
@@ -32,7 +32,7 @@
 # poetry run python scripts/compute_compiled_class_hash.py \
 #   ~/.cache/pypoetry/virtualenvs/<YOUR_VENV>/lib/python3.9/site-packages/starkware/starknet/third_party/open_zeppelin/account.json
 STARKNET_CLI_ACCOUNT_CLASS_HASH = (
-    0x1D28D8D8874CEA14193F70EDCDF501F9AE137BE2A41E258A29CBD05558D8EB6
+    0x7AB95E820D92B974797C8F139AD72F8550ADAA068FEBE4E38DA9A4A9539A81D
 )
 
 # starkware.starknet.public.abi.get_selector_from_name("replace_class")


Test patch:
diff --git a/test/expected/deploy_function_invocation.json b/test/expected/deploy_function_invocation.json
index 0f360a6bc..04bfc99da 100644
--- a/test/expected/deploy_function_invocation.json
+++ b/test/expected/deploy_function_invocation.json
@@ -9,8 +9,8 @@
         "0x5"
     ],
     "caller_address": "0x0",
-    "class_hash": "0x4dd892c3bbcdbe25b6a4c77adb8363bfc02176c231f70f086970610bee84539",
-    "contract_address": "0x7c81e7744ed1745985c0d5947cf6c261a3d9fc95c309887649a975edd019945",
+    "class_hash": "0xe027aece4bb671db3fcc3599ab6917f7702f7b861d00ece651bece3046ac21",
+    "contract_address": "0x7e080260eaf2d224f7300ebf67e85703f9d644c8d3d06878713aaaf35398662",
     "entry_point_type": "CONSTRUCTOR",
     "events": [],
     "execution_resources": {
diff --git a/test/expected/invoke_function_invocation.json b/test/expected/invoke_function_invocation.json
index 64b2617ef..95913cf44 100644
--- a/test/expected/invoke_function_invocation.json
+++ b/test/expected/invoke_function_invocation.json
@@ -13,7 +13,7 @@
     "events": [],
     "calldata": [
         "0x1",
-        "0x7c81e7744ed1745985c0d5947cf6c261a3d9fc95c309887649a975edd019945",
+        "0x7e080260eaf2d224f7300ebf67e85703f9d644c8d3d06878713aaaf35398662",
         "0x362398bec32bc0ebb411203221a35a0301193a96f317ebe5e40be9f60d15320",
         "0x0",
         "0x2",
@@ -34,7 +34,7 @@
             },
             "messages": [],
             "call_type": "CALL",
-            "class_hash": "0x4dd892c3bbcdbe25b6a4c77adb8363bfc02176c231f70f086970610bee84539",
+            "class_hash": "0xe027aece4bb671db3fcc3599ab6917f7702f7b861d00ece651bece3046ac21",
             "result": [],
             "events": [],
             "calldata": [
@@ -44,7 +44,7 @@
             "caller_address": "0x347be35996a21f6bf0623e75dbce52baba918ad5ae8d83b6f416045ab22961a",
             "entry_point_type": "EXTERNAL",
             "selector": "0x362398bec32bc0ebb411203221a35a0301193a96f317ebe5e40be9f60d15320",
-            "contract_address": "0x7c81e7744ed1745985c0d5947cf6c261a3d9fc95c309887649a975edd019945",
+            "contract_address": "0x7e080260eaf2d224f7300ebf67e85703f9d644c8d3d06878713aaaf35398662",
             "internal_calls": []
         }
     ]
diff --git a/test/expected/invoke_receipt_account_event.json b/test/expected/invoke_receipt_account_event.json
index 95d5bb549..b0461a166 100644
--- a/test/expected/invoke_receipt_account_event.json
+++ b/test/expected/invoke_receipt_account_event.json
@@ -5,7 +5,7 @@
                 "0x0",
                 "0xa"
             ],
-            "from_address": "0x2d3c5f33198cf54a030e316ab2d9532e1c401d3c5a8b8a3962aeda6c1dcd260",
+            "from_address": "0x947c548e04a9bd033e085960f736e5a39f398f726dcb378340d19a15f44a9b",
             "keys": [
                 "0x3db3da4221c078e78bd987e54e1cc24570d89a7002cefa33e548d6c72c73f9d"
             ]
@@ -13,7 +13,7 @@
         {
             "data": [
                 "0x347be35996a21f6bf0623e75dbce52baba918ad5ae8d83b6f416045ab22961a",
-                "0x4035e7e01f09b8bc746a549fdf1bafa8d975bdbc53d25646635d0ab58425f30",
+                "0xedad892bb8c0cd384ff67c0cfabed06ccef6216a1a4ae553a260fb30b03826",
                 "0x569ced8800",
                 "0x0"
             ],
diff --git a/test/rpc/test_data/get_events.py b/test/rpc/test_data/get_events.py
index 75a51c633..08df4d7fd 100644
--- a/test/rpc/test_data/get_events.py
+++ b/test/rpc/test_data/get_events.py
@@ -77,7 +77,7 @@ def parse_block_delimiter_parameter(
 
 
 EVENT_FEE_ADDRESS = rpc_felt(
-    0x04035E7E01F09B8BC746A549FDF1BAFA8D975BDBC53D25646635D0AB58425F30
+    0xEDAD892BB8C0CD384FF67C0CFABED06CCEF6216A1A4AE553A260FB30B03826
 )
 INVOKE_1_FEE_CHARGING_EVENT = [
     rpc_felt(int(PREDEPLOYED_ACCOUNT_ADDRESS, 16)),
diff --git a/test/shared.py b/test/shared.py
index 014691122..8677305d7 100644
--- a/test/shared.py
+++ b/test/shared.py
@@ -38,12 +38,10 @@
     "916907772491729262376534102982219947830828984996257231353398618781993312401"
 )
 
-EXPECTED_CLASS_HASH = (
-    "0x4dd892c3bbcdbe25b6a4c77adb8363bfc02176c231f70f086970610bee84539"
-)
+EXPECTED_CLASS_HASH = "0xe027aece4bb671db3fcc3599ab6917f7702f7b861d00ece651bece3046ac21"
 # hash of contract at CONTRACT_1_PATH
 EXPECTED_CLASS_1_HASH = (
-    "0x21c6a99e1947cd3526da50ed29f66e46a41c8e9e31761326739c6f3f9c2c5f7"
+    "0x2dc84cbdfc63f980cc6f8b9054184d7e33f43fdc02b2baf40017ea88490212d"
 )
 
 NONEXISTENT_TX_HASH = "0x99"
diff --git a/test/test_fork_feeder_gateway.py b/test/test_fork_feeder_gateway.py
index b3df35ad8..5c4bc9a59 100644
--- a/test/test_fork_feeder_gateway.py
+++ b/test/test_fork_feeder_gateway.py
@@ -56,7 +56,7 @@
 
 DEPLOYMENT_INPUT = "10"
 EXPECTED_DEPLOYMENT_ADDRESS = (
-    "0x1377433bcc53c639d2203c164d2004ba2522c59f902eab2662199a2c78b8e3f"
+    "0x33dd92d6c43ba552eec47842e35d578012929ed4672a42aa5727f8a3a9471b6"
 )
 EXPECTED_INVOKE_HASH = (
     "0x26f966f10eb28d442650fb6f3829d3d9298812e00ef60583a496ece0bb45082"
diff --git a/test/test_general_workflow.py b/test/test_general_workflow.py
index 26a24809c..398542735 100644
--- a/test/test_general_workflow.py
+++ b/test/test_general_workflow.py
@@ -107,7 +107,7 @@ def test_salty_deploy():
     """Test deploying with salt"""
 
     expected_address = (
-        "0x2d3c5f33198cf54a030e316ab2d9532e1c401d3c5a8b8a3962aeda6c1dcd260"
+        "0x947c548e04a9bd033e085960f736e5a39f398f726dcb378340d19a15f44a9b"
     )
     contract_path = EVENTS_CONTRACT_PATH
     inputs = None