From bdd34b13619fa7ec50a9602a6c22c261beb61ec0 Mon Sep 17 00:00:00 2001 From: enitrat Date: Thu, 21 Nov 2024 19:03:28 +0800 Subject: [PATCH 1/2] load from katana-db --- Makefile | 4 ++-- kakarot_scripts/deployment/kakarot_deployment.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8df3988c1..ba905246e 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ build-sol: forge build --names --force run-katana: - katana --chain-id test --validate-max-steps 1000000 --invoke-max-steps 9000000 --eth-gas-price 0 --strk-gas-price 0 --disable-fee --seed 0 + katana --chain-id test --validate-max-steps 1000000 --invoke-max-steps 9000000 --eth-gas-price 0 --strk-gas-price 0 --disable-fee --seed 0 --db-dir ./katana-db run-anvil: anvil --block-base-fee-per-gas 1 @@ -101,4 +101,4 @@ run-anvil: run-nodes: @echo "Starting Anvil and Katana in messaging mode" @anvil --block-base-fee-per-gas 1 & - @katana --chain-id test --validate-max-steps 1000000 --invoke-max-steps 9000000 --eth-gas-price 0 --strk-gas-price 0 --disable-fee --messaging .katana/messaging_config.json --seed 0 + @katana --chain-id test --validate-max-steps 1000000 --invoke-max-steps 9000000 --eth-gas-price 0 --strk-gas-price 0 --disable-fee --messaging .katana/messaging_config.json --seed 0 --db-dir ./katana-db diff --git a/kakarot_scripts/deployment/kakarot_deployment.py b/kakarot_scripts/deployment/kakarot_deployment.py index ef8c20811..a80573a77 100644 --- a/kakarot_scripts/deployment/kakarot_deployment.py +++ b/kakarot_scripts/deployment/kakarot_deployment.py @@ -34,8 +34,18 @@ async def deploy_or_upgrade_kakarot(owner): class_hash = get_declarations() starknet_deployments = get_deployments() + if starknet_deployments.get("kakarot"): + try: + deployed_class_hash = await RPC_CLIENT.get_class_hash_at( + starknet_deployments["kakarot"] + ) + except Exception: + deployed_class_hash = None + else: + deployed_class_hash = None + # Deploy or upgrade Kakarot - if starknet_deployments.get("kakarot") and NETWORK["type"] is not NetworkType.DEV: + if deployed_class_hash: logger.info("ℹ️ Kakarot already deployed, checking version.") deployed_class_hash = await RPC_CLIENT.get_class_hash_at( starknet_deployments["kakarot"] From a32c3f8c1fe3ac3382c17e4bfc930eced165324f Mon Sep 17 00:00:00 2001 From: enitrat Date: Thu, 21 Nov 2024 19:06:00 +0800 Subject: [PATCH 2/2] Add Katana Files to Git LFS --- .gitattributes | 4 ++++ kakarot_scripts/deployment/kakarot_deployment.py | 1 - katana-db/db.version | 3 +++ katana-db/mdbx.dat | 3 +++ katana-db/mdbx.lck | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 katana-db/db.version create mode 100644 katana-db/mdbx.dat create mode 100644 katana-db/mdbx.lck diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..6e9a4cef4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +katana-db/ filter=lfs diff=lfs merge=lfs -text +katana-db/db.version filter=lfs diff=lfs merge=lfs -text +katana-db/mdbx.dat filter=lfs diff=lfs merge=lfs -text +katana-db/mdbx.lck filter=lfs diff=lfs merge=lfs -text diff --git a/kakarot_scripts/deployment/kakarot_deployment.py b/kakarot_scripts/deployment/kakarot_deployment.py index a80573a77..79944114f 100644 --- a/kakarot_scripts/deployment/kakarot_deployment.py +++ b/kakarot_scripts/deployment/kakarot_deployment.py @@ -10,7 +10,6 @@ EVM_ADDRESS, NETWORK, RPC_CLIENT, - NetworkType, ) from kakarot_scripts.utils.starknet import deploy as deploy_starknet from kakarot_scripts.utils.starknet import ( diff --git a/katana-db/db.version b/katana-db/db.version new file mode 100644 index 000000000..559be584b --- /dev/null +++ b/katana-db/db.version @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b40711a88c7039756fb8a73827eabe2c0fe5a0346ca7e0a104adc0fc764f528d +size 4 diff --git a/katana-db/mdbx.dat b/katana-db/mdbx.dat new file mode 100644 index 000000000..f04ed97a1 --- /dev/null +++ b/katana-db/mdbx.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71e8172d048b333594096bb94df215dbf8395e064c56a11585f9cf91dff3ffc9 +size 4294967296 diff --git a/katana-db/mdbx.lck b/katana-db/mdbx.lck new file mode 100644 index 000000000..a8983b8d1 --- /dev/null +++ b/katana-db/mdbx.lck @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0679e4ebe120eae7b043304ca2405d833eea627acbb40db86ea3ab5b2bd8a503 +size 1032192