From c861fab825239a899d418cb805c64a77b7b7054f Mon Sep 17 00:00:00 2001 From: Gregory Edison Date: Thu, 24 Oct 2024 09:46:56 +0200 Subject: [PATCH] fix script + karnot config Signed-off-by: Gregory Edison --- deployments/karnot/deployment-config.yaml | 4 +- scripts/e2e_pipeline.sh | 48 ++++++++++++++--------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/deployments/karnot/deployment-config.yaml b/deployments/karnot/deployment-config.yaml index 27a3cd0e7..b953ad4f7 100644 --- a/deployments/karnot/deployment-config.yaml +++ b/deployments/karnot/deployment-config.yaml @@ -1,5 +1,5 @@ environments: - - project: "sepolia prod" + - project: "sepolia" id: b429998b-67d1-4866-927e-bc0d432d59d7 repos: kakarot-rpc: @@ -25,7 +25,7 @@ environments: MONGO_REPLACE_DATA_INSIDE_TRANSACTION: "true" STARTING_BLOCK: "0" - - project: "sepolia staging" + - project: "sepolia" id: 4912672c-533c-4198-9834-a8999c0b2db0 repos: kakarot-rpc: diff --git a/scripts/e2e_pipeline.sh b/scripts/e2e_pipeline.sh index 75d02b621..1884fa1a0 100644 --- a/scripts/e2e_pipeline.sh +++ b/scripts/e2e_pipeline.sh @@ -32,12 +32,12 @@ for arg in "$@"; do deploy) run_deploy=true ;; - --staging) - ENV="kakarot-staging" - ;; --sepolia) ENV="sepolia" ;; + --staging) + ENV="sepolia-staging" + ;; *) echo "Unknown argument: ${arg}" usage @@ -50,17 +50,21 @@ if [ -z "${ENV}" ]; then echo "Please provide the environment to test against" exit 1 fi +if [ -z "${INFURA_KEY}" ]; then + echo "Please provide the INFURA_KEY environment variable" + exit 1 +fi cd ../lib/kakarot || exit export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION="python" -export STARKNET_NETWORK="${ENV}" +export L1_RPC_URL="https://sepolia.infura.io/v3/${INFURA_KEY}" # Set the environment variables based on the provided environment if [ "${ENV}" = "sepolia" ]; then - # Note: you might need to modify the following values in `lib/kakarot/kakarot_scripts/constants.py`: - # - NETWORKS["sepolia"].rpc_url = https://juno-kakarot-sepolia.karnot.xyz - # - NETWORKS["sepolia"].max_wait = 40 - export STARKNET_SEPOLIA_RPC_URL="https://juno-kakarot-sepolia.karnot.xyz" + export RPC_URL="https://juno-kakarot-sepolia.karnot.xyz" + export RPC_NAME="starknet-sepolia" + export CHECK_INTERVAL=1 + export MAX_WAIT=50 export WEB3_HTTP_PROVIDER_URI="https://rpc-kakarot-sepolia.karnot.xyz/" if [ -z "${STARKNET_SEPOLIA_ACCOUNT_ADDRESS}" ]; then echo "Please provide the STARKNET_SEPOLIA_ACCOUNT_ADDRESS environment variable" @@ -75,13 +79,19 @@ if [ "${ENV}" = "sepolia" ]; then exit 1 fi SKIP="--ignore tests/end_to_end/L1L2Messaging --ignore tests/end_to_end/CairoPrecompiles --ignore tests/end_to_end/EvmPrecompiles --ignore tests/end_to_end/test_kakarot.py" -elif [ "${ENV}" = "kakarot-staging" ]; then +elif [ "${ENV}" = "sepolia-staging" ]; then export EVM_PRIVATE_KEY="0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d" - export KAKAROT_STAGING_RPC_URL="https://juno-kakarot-sepolia.karnot.xyz/" - export KAKAROT_STAGING_ACCOUNT_ADDRESS="0x06b23fc7c18611614fef21f11620bf033888ae9eae2316af44100debc9faa01a" + export RPC_URL="https://juno-kakarot-sepolia.karnot.xyz/" + export RPC_NAME="starknet-sepolia-staging" + export CHECK_INTERVAL=1 + export MAX_WAIT=50 export WEB3_HTTP_PROVIDER_URI="https://rpc-kakarot-sepolia-staging.karnot.xyz/" - if [ -z "${KAKAROT_STAGING_PRIVATE_KEY}" ]; then - echo "Please provide the KAKAROT_STAGING_PRIVATE_KEY environment variable. The private key should be loaded using gpg: gpg -r recipient@kakarot.org --decrypt path/to/encrypted/key.gpg" + if [ -z "${STARKNET_SEPOLIA_STAGING_ACCOUNT_ADDRESS}" ]; then + echo "Please provide the STARKNET_SEPOLIA_STAGING_ACCOUNT_ADDRESS environment variable. The private key should be loaded using gpg: gpg -r recipient@kakarot.org --decrypt path/to/encrypted/key.gpg" + exit 1 + fi + if [ -z "${STARKNET_SEPOLIA_STAGING_PRIVATE_KEY}" ]; then + echo "Please provide the STARKNET_SEPOLIA_STAGING_PRIVATE_KEY environment variable. The private key should be loaded using gpg: gpg -r recipient@kakarot.org --decrypt path/to/encrypted/key.gpg" exit 1 fi @@ -92,21 +102,21 @@ fi if ${run_deploy}; then echo "Deploying the contracts to the ${ENV} environment" - uv sync --all-extras --dev && make build-sol && make build && make fetch-ssj-artifacts && make build-cairo1 - uv run python ./kakarot_scripts/deploy_kakarot.py + uv sync --all-extras --dev && make build-sol && make build + uv run deploy fi # Run the tests if the test command is provided if ${run_test}; then echo "Running tests for the ${ENV} environment. Skipping: ${SKIP}" - KAKAROT_ADDRESS=$(jq -r '.kakarot.address' ./deployments/kakarot-"${ENV}"/deployments.json) - UNINITIALIZED_ACCOUNT_CLASS_HASH=$(jq -r '.uninitialized_account' ./deployments/kakarot-"${ENV}"/declarations.json) - ACCOUNT_CONTRACT_CLASS_HASH=$(jq -r '.account_contract' ./deployments/kakarot-"${ENV}"/declarations.json) + KAKAROT_ADDRESS=$(jq -r '.kakarot' ./deployments/starknet-"${ENV}"/deployments.json) + UNINITIALIZED_ACCOUNT_CLASS_HASH=$(jq -r '.uninitialized_account' ./deployments/starknet-"${ENV}"/declarations.json) + ACCOUNT_CONTRACT_CLASS_HASH=$(jq -r '.account_contract' ./deployments/starknet-"${ENV}"/declarations.json) export KAKAROT_ADDRESS="${KAKAROT_ADDRESS}" export UNINITIALIZED_ACCOUNT_CLASS_HASH="${UNINITIALIZED_ACCOUNT_CLASS_HASH}" export ACCOUNT_CONTRACT_CLASS_HASH="${ACCOUNT_CONTRACT_CLASS_HASH}" - eval "uv run pytest -s tests/end_to_end ${SKIP}" + eval "uv run pytest -s tests/end_to_end -k 'test_should_return_data_median_for_query' ${SKIP}" fi