diff --git a/kakarot_scripts/deployment/kakarot_deployment.py b/kakarot_scripts/deployment/kakarot_deployment.py index ef8c20811..cf1f727c4 100644 --- a/kakarot_scripts/deployment/kakarot_deployment.py +++ b/kakarot_scripts/deployment/kakarot_deployment.py @@ -12,6 +12,7 @@ RPC_CLIENT, NetworkType, ) +from kakarot_scripts.utils.kakarot import eth_chain_id from kakarot_scripts.utils.starknet import deploy as deploy_starknet from kakarot_scripts.utils.starknet import ( dump_deployments, @@ -52,6 +53,11 @@ async def deploy_or_upgrade_kakarot(owner): "set_cairo1_helpers_class_hash", class_hash["Cairo1Helpers"], ) + + # Initialize the chain_id if it's value is not set + if await eth_chain_id() == 0: + await invoke("kakarot", "initialize_chain_id", NETWORK["chain_id"]) + else: logger.info("✅ Kakarot already up to date.") else: diff --git a/kakarot_scripts/utils/kakarot.py b/kakarot_scripts/utils/kakarot.py index 09bd80d15..8f8af0c9f 100644 --- a/kakarot_scripts/utils/kakarot.py +++ b/kakarot_scripts/utils/kakarot.py @@ -700,7 +700,7 @@ async def eth_send_transaction( payload = { "type": 0x1, - "chainId": await eth_chain_id(), + "chainId": NETWORK["chain_id"], "nonce": nonce, "gas": gas, "gasPrice": gas_price,