diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index af8883eb2e..9a34b861f7 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -125,6 +125,9 @@ jobs: uses: helm/kind-action@v1 with: install_only: true + - name: Install astria cli (rust) + run: | + just install-cli - name: Log in to GHCR uses: docker/login-action@v2 with: @@ -140,7 +143,7 @@ jobs: echo -e "\n\nDeploying with astria images tagged $TAG" just deploy smoke-test $TAG - name: Run Smoke test - timeout-minutes: 1 + timeout-minutes: 3 run: just run-smoke-test docker: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcb7c23ad7..358fa899dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,20 +41,30 @@ jobs: needs: run_checker if: github.ref_name == 'main' && needs.run_checker.outputs.run_release_charts == 'true' steps: - - name: Checkout Repo + - name: Checkout Mono Repo + uses: actions/checkout@v4 + with: + path: 'mono' + - name: Checkout Mono Repo uses: actions/checkout@v4 - - name: Publish to Charts Repo - uses: cpina/github-action-push-to-another-repository@v1.7.2 - env: - API_TOKEN_GITHUB: ${{ secrets.CHARTS_REPO_TOKEN }} with: - source-directory: 'charts/' - target-directory: 'charts/' - target-branch: 'main' - destination-github-username: 'astriaorg' - destination-repository-name: 'charts' - user-email: '${{ github.actor }}@users.noreply.github.com' - user-name: '${{ github.actor }}' + repository: astriaorg/charts + ref: 'main' + path: 'charts' + token: ${{ secrets.CHARTS_REPO_TOKEN }} + - name: Copy Updates to Charts Repo + run: | + rsync -a --delete mono/charts/ charts/charts/ --exclude=charts/README.md + rsync -a --delete mono/charts/README.md charts/README.md + rsync -a --delete mono/dev/ charts/dev/ + - name: Publish to Charts Repo + run: | + cd charts + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + git config --global user.name "${{ github.actor }}" + git add . + git commit -m "Changes from astriaorg/astria@${{ github.sha }}" + git push conductor: needs: run_checker diff --git a/charts/README.md b/charts/README.md index e324932366..ced4dedb97 100644 --- a/charts/README.md +++ b/charts/README.md @@ -18,21 +18,18 @@ For contract deployment: * Forge (part of Foundry) - +For funding via bridge: + +* Astria Go CLI - + ## Setup -In order to startup you will need to have docker running on your machine +In order to startup you will need to have docker running on your machine. ### Configuring Funding of Geth -By default, running this local rollup will fund a wallet address -`0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30`, which you can add to your -preferred wallet using the private key in -`helm/rollup/files/keys/private_key.txt`. This account should never be used for -anything but test transactions. - -To change the wallet account which receives funds, use the `deploy-rollup` -command with the optional arguments `evm_funding_address` and -`evm_funding_private_key`. +By default, running this local rollup will not have any funds, but will be +configured to use the sequencer account bridge. ```bash # create control plane cluster @@ -48,13 +45,21 @@ just wait-for-ingress-controller just deploy astria-local # Deploys a geth rollup chain + faucet + blockscout + ingress -# w/ defaults running against local network +# w/ defaults running against local network, along with a bridge withdawer. # NOTE - default values can be found in `helm/rollup/values.yaml` +just deploy rollup + +# Deploy only the rollup chain, faucet, blockscout instance without withdrawer: just deploy dev-rollup -# w/ custom name and id +# w/ custom name and id for further customization see the values file at +# `dev/values/rollup/dev.yml` just deploy dev-rollup -# w/ custom name, id, and funding address -just deploy dev-rollup + +# Send funds into the rollup chain, by default transfers 10 RIA to the rollup +# using prefunded default test sequencer accounts. +just init rollup-bridge +# Update the amounts to init +just init rollup-bridge # Delete default rollup just delete rollup @@ -104,7 +109,7 @@ If you deploy a custom rollup, then the endpoints will be * adding the default network * network name: `astria` * rpc url: `http://executor.astria.localdev.me` - * chain id: `912559` + * chain id: `1337` * currency symbol: `RIA` * adding a custom network @@ -158,14 +163,15 @@ pattern (especially in config maps and genesis files): ## Running a Smoke Test -You can run a basic smoke test, which deploys the astria components and a basic -rollup, runs a tx e2e to ensure it has executed correctly. +You can run a smoke test which ensures that full bridge functionality is working +both up and down the stack. To deploy and run this: ```sh # only if cluster not already created > just deploy cluster +# deploys all the components needed to run the test. > just deploy smoke-test # deploys all components needed to run the smoke test > just run-smoke-test @@ -174,7 +180,7 @@ To deploy and run this: # Clean up deployed test ``` -## Examing Deployments +## Examining Deployments [k9s](https://k9scli.io/) is a useful utility for inspecting deployed containers, logs and services. Additionally you may interact directly with the diff --git a/charts/deploy.just b/charts/deploy.just index 50ad17425b..b502c56ce3 100644 --- a/charts/deploy.just +++ b/charts/deploy.just @@ -8,10 +8,13 @@ deploy tool *ARGS: delete tool *ARGS: @just delete-{{tool}} {{ARGS}} +init tool *ARGS: + @just init-{{tool}} {{ARGS}} + load-image image: kind load docker-image {{image}} --name astria-dev-cluster -deploy-all: deploy-cluster deploy-ingress-controller wait-for-ingress-controller deploy-astria-local wait-for-sequencer (deploy-chart "sequencer-faucet") deploy-dev-rollup wait-for-rollup +deploy-all: deploy-cluster deploy-ingress-controller wait-for-ingress-controller deploy-astria-local wait-for-sequencer (deploy-chart "sequencer-faucet") deploy-rollup delete-all: clean clean-persisted-data deploy-astria-local namespace=defaultNamespace: (deploy-chart "celestia-local" namespace) (deploy-sequencer) @@ -29,14 +32,19 @@ delete-chart chart namespace=defaultNamespace: helm-add-if-not-exist repo url: helm repo list | grep -q {{repo}} || helm repo add {{repo}} {{url}} -deploy-cluster namespace=defaultNamespace: - kind create cluster --config ./dev/kubernetes/kind-cluster-config.yml - @just helm-add-if-not-exist cilium https://helm.cilium.io/ - helm install cilium cilium/cilium --version 1.14.3 \ +hubbleEnabled := "false" +deploy-cluster namespace=defaultNamespace enableHubble=hubbleEnabled: + kind create cluster --image kindest/node:v1.28.9 --config ./dev/kubernetes/kind-cluster-config.yml + @just helm-add-if-not-exist cilium https://helm.cilium.io/ > /dev/null + helm install cilium cilium/cilium --version 1.15.5 \ -f ./dev/values/cilium.yml \ + {{ if enableHubble == "true" { '--set hubble.enabled=true --set hubble.relay.enabled=true --set hubble.ui.enabled=true --set hubble.ui.ingress.enabled=true' } else { '' } }} \ --namespace kube-system kubectl create namespace {{namespace}} +deploy-metrics-server: + kubectl apply -f ./dev/kubernetes/metrics-server-local.yml + deploy-ingress-controller: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml @@ -83,38 +91,39 @@ wait-for-sequencer: kubectl wait -n astria-dev-cluster deployment celestia-local --for=condition=Available=True --timeout=600s kubectl rollout status --watch statefulset/sequencer -n astria-dev-cluster --timeout=600s +deploy-rollup: deploy-dev-rollup deploy-bridge-withdrawer wait-for-rollup +wait-for-rollup: wait-for-dev-rollup wait-for-bridge-withdrawer +delete-rollup: delete-dev-rollup delete-bridge-withdrawer + defaultRollupName := "astria" defaultNetworkId := "" -defaultGenesisAllocAddress := "" defaultPrivateKey := "" defaultSequencerStartBlock := "" -deploy-rollup rollupName=defaultRollupName networkId=defaultNetworkId genesisAllocAddress=defaultGenesisAllocAddress privateKey=defaultPrivateKey sequencerStartBlock=defaultSequencerStartBlock: - helm dependency update charts/evm-rollup > /dev/null - helm install \ - {{ if rollupName != '' { replace('--set config.rollup.name=# --set celestia-node.config.labelPrefix=#', '#', rollupName) } else { '' } }} \ - {{ if networkId != '' { replace('--set config.rollup.networkId=#', '#', networkId) } else { '' } }} \ - {{ if genesisAllocAddress != '' { replace('--set config.rollup.genesisAccounts[0].address=#', '#', genesisAllocAddress) } else { '' } }} \ - {{ if privateKey != '' { replace('--set config.faucet.privateKey=#', '#', privateKey) } else { '' } }} \ - {{ if sequencerStartBlock != '' { replace('--set config.sequencer.initialBlockHeight=#', '#', sequencerStartBlock) } else { '' } }} \ - {{rollupName}}-chain-chart ./charts/evm-rollup --namespace astria-dev-cluster - -deploy-dev-rollup rollupName=defaultRollupName networkId=defaultNetworkId genesisAllocAddress=defaultGenesisAllocAddress privateKey=defaultPrivateKey sequencerStartBlock=defaultSequencerStartBlock: +deploy-dev-rollup rollupName=defaultRollupName networkId=defaultNetworkId: helm dependency update charts/evm-rollup > /dev/null helm install \ {{ if rollupName != '' { replace('--set config.rollup.name=# --set celestia-node.config.labelPrefix=#', '#', rollupName) } else { '' } }} \ {{ if networkId != '' { replace('--set config.rollup.networkId=#', '#', networkId) } else { '' } }} \ - {{ if genesisAllocAddress != '' { replace('--set config.rollup.genesisAccounts[0].address=#', '#', genesisAllocAddress) } else { '' } }} \ - {{ if privateKey != '' { replace('--set config.faucet.privateKey=#', '#', privateKey) } else { '' } }} \ - {{ if sequencerStartBlock != '' { replace('--set config.sequencer.initialBlockHeight=#', '#', sequencerStartBlock) } else { '' } }} \ -f dev/values/rollup/dev.yaml \ {{rollupName}}-chain-chart ./charts/evm-rollup --namespace astria-dev-cluster -delete-rollup rollupName=defaultRollupName: +delete-dev-rollup rollupName=defaultRollupName: @just delete chart {{rollupName}}-chain -wait-for-rollup rollupName=defaultRollupName: +wait-for-dev-rollup rollupName=defaultRollupName: kubectl rollout status --watch statefulset/{{rollupName}}-geth -n astria-dev-cluster --timeout=600s +deploy-bridge-withdrawer: + helm install evm-bridge-withdrawer-chart ./charts/evm-bridge-withdrawer \ + --namespace astria-dev-cluster \ + -f dev/values/withdrawer/values.yaml + +delete-bridge-withdrawer: + @just delete chart evm-bridge-withdrawer astria-dev-cluster + +wait-for-bridge-withdrawer: + kubectl wait -n astria-dev-cluster deployment evm-bridge-withdrawer --for=condition=Available=True --timeout=600s + defaultHypAgentConfig := "" defaultHypRelayerPrivateKey := "" defaultHypValidatorPrivateKey := "" @@ -141,7 +150,7 @@ deploy-local-metrics: defaultTag := "" deploy-smoke-test tag=defaultTag: - @echo "Deploying ingress controller..." && just deploy-ingress-controller > /dev/null + @echo "Deploying ingress controller..." && just deploy ingress-controller > /dev/null @just wait-for-ingress-controller > /dev/null @echo "Deploying local celestia instance..." && just deploy celestia-local > /dev/null @helm dependency update charts/sequencer > /dev/null @@ -157,72 +166,179 @@ deploy-smoke-test tag=defaultTag: {{ if tag != '' { replace('--set images.conductor.devTag=# --set images.composer.devTag=#', '#', tag) } else { '' } }} \ --set config.blockscout.enabled=false \ --set config.faucet.enabled=false > /dev/null + @echo "Starting Bridge Withdrawer..." && helm install -n astria-dev-cluster evm-bridge-withdrawer-chart ./charts/evm-bridge-withdrawer \ + -f dev/values/withdrawer/values.yaml \ + {{ if tag != '' { replace('--set images.evmBridgeWithdrawer.devTag=#', '#', tag) } else { '' } }} > /dev/null @just wait-for-rollup > /dev/null - @sleep 15 + +evm_destination_address := "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30" +# 1 RIA is 10^9 nRIA +sequencer_base_amount := "1000000000" +# RIA is 10^9, WEI is 10^18, 10^9 * 10^9 = 10^18 +rollup_multiplier := "1000000000" +# 10 RIA +sequencer_transfer_amount := "10" +sequencer_rpc_url := "http://rpc.sequencer.localdev.me" +init-rollup-bridge rollupName=defaultRollupName evmDestinationAddress=evm_destination_address transferAmount=sequencer_transfer_amount: + #!/usr/bin/env bash + SEQUENCER_BRIDGE_PKEY="dfa7108e38ab71f89f356c72afc38600d5758f11a8c337164713e4471411d2e0" + SEQUENCER_FUNDS_PKEY="934ab488f9e1900f6a08f50605ce1409ca9d95ebdc400dafc2e8a4306419fd52" + SEQUENCER_BRIDGE_ADDRESS="astria13ahqz4pjqfmynk9ylrqv4fwe4957x2p0h5782u" + SEQUENCER_CHAIN_ID="sequencer-test-chain-0" + ASSET="nria" + FEE_ASSET="nria" + TRANSFER_AMOUNT=$(echo "{{transferAmount}} * {{sequencer_base_amount}}" | bc) + + astria-cli sequencer init-bridge-account \ + --rollup-name {{rollupName}} \ + --private-key $SEQUENCER_BRIDGE_PKEY \ + --sequencer.chain-id $SEQUENCER_CHAIN_ID \ + --sequencer-url {{sequencer_rpc_url}} \ + --fee-asset=$FEE_ASSET --asset=$ASSET || exit 1 + astria-cli sequencer bridge-lock $SEQUENCER_BRIDGE_ADDRESS \ + --amount $TRANSFER_AMOUNT \ + --destination-chain-address {{evmDestinationAddress}} \ + --private-key $SEQUENCER_FUNDS_PKEY \ + --sequencer.chain-id $SEQUENCER_CHAIN_ID \ + --sequencer-url {{sequencer_rpc_url}} \ + --fee-asset=$FEE_ASSET --asset=$ASSET || exit 1 + + +eth_rpc_url := "http://executor.astria.localdev.me/" +bridge_tx_bytes := "0xf8f280843c54e7f182898594a58639fb5458e65e4fa917ff951c390292c24a15880de0b6b3a7640000b884bab916d00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002d617374726961313777306164656736346b7930646178776432756779756e65656c6c6d6a676e786c333935303400000000000000000000000000000000000000820a96a086b85348c9816f6d34533669db3d3626cf55eecea6a380d4d072efb1839df443a04b8b60c8b91dd30add1ca4a96097238d73bab29b0a958322d9a51755d5a5f287" +bridge_tx_hash := "0x67db5b0825e8f60b926234e209d54e0336cd94defe6720e7acadf871e0377150" run-smoke-test: #!/usr/bin/env bash - ETH_RPC_URL="http://executor.astria.localdev.me/" - MAX_RUNS=30 - echo "Testing Transfer..." - TRANSFER_RUNS=0 - EXPECTED_BALANCE=1000000000000000000 - curl -X POST $ETH_RPC_URL -s -d '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xf86d80843c54e7f182520894830b0e9bb0b1ebad01f2805278ede64c69e068fe880de0b6b3a764000080820a96a045cac19cec50c92e356c665172ec70de5f3cd3721ba09bf3cbad1976d3e83487a00ff4d49607db9ac3c4bb71160be41600f8d1b56ac20b092c0e042f0d226e5277"],"id":1}' -H 'Content-Type: application/json' -s - balance() { - HEX_NUM=$(curl -X POST $ETH_RPC_URL -s -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x830B0e9Bb0B1ebad01F2805278Ede64c69e068FE", "latest"],"id":1}' -H 'Content-Type: application/json' | jq -r '.result') - echo "$(printf "%d" $HEX_NUM)" - } - while [ $TRANSFER_RUNS -lt $MAX_RUNS ]; do - if [ $(balance) -eq $EXPECTED_BALANCE ]; then - echo "Transfer success" + MAX_CHECKS=30 + + # Checking starting balance + BALANCE=$(just evm-get-balance {{evm_destination_address}}) + if [ $BALANCE -ne 0 ]; then + echo "Starting balance is not correct" + exit 1 + fi + + echo "Testing Bridge In..." + just init rollup-bridge + CHECKS=0 + EXPECTED_BALANCE=$(echo "{{sequencer_transfer_amount}} * {{sequencer_base_amount}} * {{rollup_multiplier}}" | bc) + while [ $CHECKS -lt $MAX_CHECKS ]; do + CHECKS=$((CHECKS+1)) + BALANCE=$(just evm-get-balance {{evm_destination_address}}) + echo "Check $CHECKS, Balance: $BALANCE, Expected: $EXPECTED_BALANCE" + if [ "$BALANCE" == "$EXPECTED_BALANCE" ]; then + echo "Bridge In success" break else sleep 1 fi - TRANSFER_RUNS=$((TRANSFER_RUNS+1)) done - if [ $TRANSFER_RUNS -eq $MAX_RUNS ]; then - echo "Transfer failure" + if [ $CHECKS -eq $MAX_CHECKS ]; then + echo "Bridge In failure" exit 1 fi - echo "Testing soft commits..." - SOFT_RUNS=0 - soft() { - HEX_NUM=$(curl -X POST $ETH_RPC_URL -s -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["safe", false],"id":1}' -H 'Content-Type: application/json' | jq -r '.result.number') - echo "$(printf "%d" $HEX_NUM)" - } - while [ $SOFT_RUNS -lt $MAX_RUNS ]; do - if [ $(soft) -gt 0 ]; then - echo "Soft commit success" + echo "Testing Bridge Out..." + just evm-send-raw-transaction {{bridge_tx_bytes}} + TRANSFERED_BALANCE=$(echo "1 * {{sequencer_base_amount}} * {{rollup_multiplier}}" | bc) + EXPECTED_BALANCE=$(echo "$EXPECTED_BALANCE - $TRANSFERED_BALANCE" | bc) + CHECKS=0 + while [ $CHECKS -lt $MAX_CHECKS ]; do + CHECKS=$((CHECKS+1)) + BALANCE=$(just evm-get-balance {{evm_destination_address}}) + echo "Check $CHECKS, Balance: $BALANCE, Expected: $EXPECTED_BALANCE" + if [ "$BALANCE" == "$EXPECTED_BALANCE" ]; then + echo "Bridge Out EVM success" break else sleep 1 fi - SOFT_RUNS=$((SOFT_RUNS+1)) done + if [ $CHECKS -eq $MAX_CHECKS ]; then + echo "Bridge Out EVM failure" + exit 1 + fi + CHECKS=0 + EXPECTED_BALANCE=$(echo "1 * {{sequencer_base_amount}}" | bc) + while [ $CHECKS -lt $MAX_CHECKS ]; do + CHECKS=$((CHECKS+1)) + BALANCE=$(astria-cli sequencer account balance astria17w0adeg64ky0daxwd2ugyuneellmjgnxl39504 --sequencer-url {{sequencer_rpc_url}} | awk '/nria/{print $(NF-1)}') + echo "Check $CHECKS, Balance: $BALANCE, Expected: $EXPECTED_BALANCE" + if [ "$BALANCE" == "$EXPECTED_BALANCE" ]; then + echo "Bridge Out Sequencer success" + break + else + sleep 1 + fi + done + if [ $CHECKS -eq $MAX_CHECKS ]; then + echo "Bridge Out Sequencer failure" + exit 1 + fi - echo "Testing finalization..." - FINALIZED_RUNS=0 - finalized() { - HEX_NUM=$(curl -X POST $ETH_RPC_URL -s -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["finalized", false],"id":1}' -H 'Content-Type: application/json' | jq -r '.result.number') - echo "$(printf "%d" $HEX_NUM)" - } - while [ $FINALIZED_RUNS -lt $MAX_RUNS ]; do - FINAL=$(finalized) - if [ $FINAL -gt 0 ]; then - echo "Finalized success" - exit 0 + echo "Testing TX Finalization" + CHECKS=0 + BLOCK_NUM_HEX=$(just evm-get-transaction-receipt {{bridge_tx_hash}} | jq -r '.blockNumber') + BLOCK_NUM=$(just hex-to-dec $BLOCK_NUM_HEX) + while [ $CHECKS -lt $MAX_CHECKS ]; do + CHECKS=$((CHECKS+1)) + FINALIZED_BLOCK=$(just evm-get-block-by-number finalized | jq -r '.number') + FINALIZED_BLOCK=$(just hex-to-dec $FINALIZED_BLOCK) + echo "Check $CHECKS, Finalized block: $FINALIZED_BLOCK, Expected: $BLOCK_NUM" + if [ $FINALIZED_BLOCK -ge $BLOCK_NUM ]; then + echo "Finalization success" + break else sleep 1 fi - echo "Finalized block: $FINAL, Check number: $FINALIZED_RUNS" - FINALIZED_RUNS=$((FINALIZED_RUNS+1)) done - echo "Finalization failure" - exit 1 + if [ $CHECKS -eq $MAX_CHECKS ]; then + echo "Bridge Out Sequencer failure" + exit 1 + fi + exit 0 delete-smoke-test: just delete celestia-local just delete sequencer - just delete rollup \ No newline at end of file + just delete rollup + +############################################# +## EVM Curl Command Helper Functions ## +############################################# + +evm-get-deployed-contract-code contractAddress rpcUrl=eth_rpc_url: + #!/usr/bin/env bash + curl -X POST {{eth_rpc_url}} -s -d '{"jsonrpc":"2.0","method":"eth_getCode","params":["{{contractAddress}}", "latest"],"id":1}' -H 'Content-Type: application/json' | jq -r '.result' + +evm-get-transaction-receipt txHash rpcUrl=eth_rpc_url: + #!/usr/bin/env bash + curl -X POST {{eth_rpc_url}} -s -d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["{{txHash}}"],"id":1}' -H 'Content-Type: application/json' | jq '.result' + +evm-get-raw-transaction txHash rpcUrl=eth_rpc_url: + #!/usr/bin/env bash + curl -X POST {{eth_rpc_url}} -s -d '{"jsonrpc":"2.0","method":"eth_getRawTransactionByHash","params":["{{txHash}}"],"id":1}' -H 'Content-Type: application/json' | jq '.result' + +evm-send-raw-transaction txData rpcUrl=eth_rpc_url: + #!/usr/bin/env bash + curl -X POST {{eth_rpc_url}} -s -d '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["{{txData}}"],"id":1}' -H 'Content-Type: application/json' + +evm-get-block-by-number blockNumber rpcUrl=eth_rpc_url: + #!/usr/bin/env bash + curl -X POST {{eth_rpc_url}} -s -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["{{blockNumber}}", false],"id":1}' -H 'Content-Type: application/json' | jq '.result' + +evm-get-balance address rpcUrl=eth_rpc_url: + #!/usr/bin/env bash + HEX_NUM=$(curl -X POST {{eth_rpc_url}} -s -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["{{address}}", "latest"],"id":1}' -H 'Content-Type: application/json' | jq -r '.result') + echo $(just hex-to-dec $HEX_NUM) + +evm-get-txpool-length rpcUrl=eth_rpc_url: + #!/usr/bin/env bash + curl -X POST {{eth_rpc_url}} -s -d '{"jsonrpc":"2.0","method":"txpool_content","params":[],"id":1}' -H 'Content-Type: application/json' | jq '.result' + +hex-to-dec hex: + #!/usr/bin/env bash + HEX_NUM={{hex}} + CLEAN_HEX=$(echo "${HEX_NUM#0x}" | tr 'a-z' 'A-Z') + echo $(echo "ibase=16; $CLEAN_HEX" | bc) diff --git a/charts/evm-bridge-withdrawer/Chart.yaml b/charts/evm-bridge-withdrawer/Chart.yaml new file mode 100644 index 0000000000..8c87fbe42d --- /dev/null +++ b/charts/evm-bridge-withdrawer/Chart.yaml @@ -0,0 +1,32 @@ +apiVersion: v2 +name: bridge-withdrawer +description: A Helm chart for deploying the evm bridge withdrawer for Astria native bridge + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.0.1 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" + +maintainers: + - name: wafflesvonmaple + url: astria.org + - name: quasystaty1 + url: astria.org + - name: joroshiba + url: astria.org diff --git a/charts/evm-bridge-withdrawer/templates/_helpers.tpl b/charts/evm-bridge-withdrawer/templates/_helpers.tpl new file mode 100644 index 0000000000..84c9085ebd --- /dev/null +++ b/charts/evm-bridge-withdrawer/templates/_helpers.tpl @@ -0,0 +1,10 @@ +{{/* +Namepsace to deploy elements into. +*/}} +{{- define "evm-bridge-withdrawer.namespace" -}} +{{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}} +{{- end }} + +{{- define "evm-bridge-withdrawer.image" -}} +{{ .Values.images.evmBridgeWithdrawer.repo }}:{{ if .Values.global.dev }}{{ .Values.images.evmBridgeWithdrawer.devTag }}{{ else }}{{ .Values.images.evmBridgeWithdrawer.tag }}{{ end }} +{{- end }} diff --git a/charts/evm-bridge-withdrawer/templates/configmaps.yaml b/charts/evm-bridge-withdrawer/templates/configmaps.yaml new file mode 100644 index 0000000000..c0b0e41901 --- /dev/null +++ b/charts/evm-bridge-withdrawer/templates/configmaps.yaml @@ -0,0 +1,46 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: evm-bridge-withdrawer-env + namespace: {{ include "evm-bridge-withdrawer.namespace" . }} +data: + ASTRIA_BRIDGE_WITHDRAWER_LOG: "astria_bridge_withdrawer=debug" + ASTRIA_BRIDGE_WITHDRAWER_API_ADDR: "0.0.0.0:{{ .Values.ports.healthAPI }}" + ASTRIA_BRIDGE_WITHDRAWER_SEQUENCER_COMETBFT_ENDPOINT: "{{ .Values.config.sequencerCometbftEndpoint }}" + ASTRIA_BRIDGE_WITHDRAWER_SEQUENCER_CHAIN_ID: "{{ .Values.config.sequencerChainId }}" + ASTRIA_BRIDGE_WITHDRAWER_SEQUENCER_KEY_PATH: "/secret/sequencerPrivateKey/{{ .Values.config.sequencerPrivateKey.secret.filename }}" + ASTRIA_BRIDGE_WITHDRAWER_SEQUENCER_ADDRESS_PREFIX: "{{ .Values.config.sequencerAddressPrefix }}" + ASTRIA_BRIDGE_WITHDRAWER_SEQUENCER_BRIDGE_ADDRESS: "{{ .Values.config.sequencerBridgeAddress }}" + ASTRIA_BRIDGE_WITHDRAWER_FEE_ASSET_DENOMINATION: "{{ .Values.config.feeAssetDenom }}" + ASTRIA_BRIDGE_WITHDRAWER_ROLLUP_ASSET_DENOMINATION: "{{ .Values.config.rollupAssetDenom }}" + ASTRIA_BRIDGE_WITHDRAWER_MIN_EXPECTED_FEE_ASSET_BALANCE: "{{ .Values.config.minExpectedFeeAssetBalance }}" + ASTRIA_BRIDGE_WITHDRAWER_ETHEREUM_CONTRACT_ADDRESS: "{{ .Values.config.evmContractAddress }}" + ASTRIA_BRIDGE_WITHDRAWER_ETHEREUM_RPC_ENDPOINT: "{{ .Values.config.evmRpcEndpoint }}" + ASTRIA_BRIDGE_WITHDRAWER_NO_METRICS: "{{ not .Values.metrics.enabled }}" + ASTRIA_BRIDGE_WITHDRAWER_METRICS_HTTP_LISTENER_ADDR: "0.0.0.0:{{ .Values.ports.metrics }}" + ASTRIA_BRIDGE_WITHDRAWER_FORCE_STDOUT: "{{ .Values.global.useTTY }}" + ASTRIA_BRIDGE_WITHDRAWER_PRETTY_PRINT: "{{ .Values.global.useTTY }}" + ASTRIA_BRIDGE_WITHDRAWER_NO_OTEL: "{{ not .Values.otel.enabled }}" + NO_COLOR: "{{ .Values.global.useTTY }}" + OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.otel.endpoint }}" + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "{{ .Values.otel.tracesEndpoint }}" + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: "{{ .Values.otel.tracesTimeout }}" + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: "{{ .Values.otel.tracesCompression }}" + OTEL_EXPORTER_OTLP_HEADERS: "{{ .Values.otel.otlpHeaders }}" + OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.otel.traceHeaders }}" + OTEL_SERVICE_NAME: "{{ tpl .Values.otel.serviceName . }}" + {{- if not .Values.global.dev }} + {{- else }} + {{- end }} +--- +{{- if not .Values.secretProvider.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: evm-bridge-withdrawer-private-key + namespace: {{ include "evm-bridge-withdrawer.namespace" . }} +data: + {{ .Values.config.sequencerPrivateKey.secret.filename }}: | + {{ .Values.config.sequencerPrivateKey.devContent }} +--- +{{- end }} diff --git a/charts/evm-bridge-withdrawer/templates/deployment.yaml b/charts/evm-bridge-withdrawer/templates/deployment.yaml new file mode 100644 index 0000000000..c72e1781df --- /dev/null +++ b/charts/evm-bridge-withdrawer/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: evm-bridge-withdrawer + labels: + app: evm-bridge-withdrawer + namespace: {{ include "evm-bridge-withdrawer.namespace" . }} +spec: + replicas: {{ .Values.global.replicaCount }} + selector: + matchLabels: + app: evm-bridge-withdrawer + template: + metadata: + annotations: + name: astria-sequencer + labels: + app: evm-bridge-withdrawer + spec: + containers: + - name: evm-bridge-withdrawer + image: {{ include "evm-bridge-withdrawer.image" . }} + command: [ "/usr/local/bin/astria-bridge-withdrawer" ] + stdin: {{ .Values.global.useTTY }} + tty: {{ .Values.global.useTTY }} + envFrom: + - configMapRef: + name: evm-bridge-withdrawer-env + volumeMounts: + - mountPath: /secret/sequencerPrivateKey/ + name: sequencer-private-key-volume + ports: + - containerPort: {{ .Values.ports.metrics }} + name: metrics + startupProbe: + httpGet: + path: /readyz + port: {{ .Values.ports.healthAPI }} + readinessProbe: + httpGet: + path: /readyz + port: {{ .Values.ports.healthAPI }} + # TODO: Enable the liveness probe when it is more reliable + # livenessProbe: + # httpGet: + # path: /healthz + # port: {{ .Values.ports.healthAPI }} + volumes: + - name: sequencer-private-key-volume + {{- if $.Values.secretProvider.enabled }} + csi: + driver: secrets-store.csi.k8s.io + readOnly: true + volumeAttributes: + secretProviderClass: evm-bridge-withdrawer-key + {{- else }} + configMap: + name: evm-bridge-withdrawer-private-key + {{- end }} diff --git a/charts/evm-bridge-withdrawer/templates/secretproviderclass.yaml b/charts/evm-bridge-withdrawer/templates/secretproviderclass.yaml new file mode 100644 index 0000000000..4d6d29f148 --- /dev/null +++ b/charts/evm-bridge-withdrawer/templates/secretproviderclass.yaml @@ -0,0 +1,12 @@ +{{- if .Values.secretProvider.enabled }} +--- +apiVersion: secrets-store.csi.x-k8s.io/v1 +kind: SecretProviderClass +metadata: + name: evm-bridge-withdrawer-key +spec: + provider: gcp + parameters: + {{- $_ := set $ "key" .Values.config.sequencerPrivateKey.secret }} + {{- tpl $.Values.secretProvider.parametersTemplate $ | nindent 4 }} +{{- end }} diff --git a/charts/evm-bridge-withdrawer/templates/service.yaml b/charts/evm-bridge-withdrawer/templates/service.yaml new file mode 100644 index 0000000000..6f16cc4540 --- /dev/null +++ b/charts/evm-bridge-withdrawer/templates/service.yaml @@ -0,0 +1,17 @@ +{{- if .Values.serviceMonitor.enabled }} +kind: Service +apiVersion: v1 +metadata: + name: evm-bridge-withdrawer-metrics + namespace: {{ include "evm-bridge-withdrawer.namespace" . }} +spec: + selector: + app: evm-bridge-withdrawer + ports: + {{- if .Values.metrics.enabled }} + - name: metrics + port: {{ .Values.ports.metrics }} + targetPort: metrics + {{- end }} +{{- end }} +--- diff --git a/charts/evm-bridge-withdrawer/templates/servicemonitor.yaml b/charts/evm-bridge-withdrawer/templates/servicemonitor.yaml new file mode 100644 index 0000000000..33f4a257f9 --- /dev/null +++ b/charts/evm-bridge-withdrawer/templates/servicemonitor.yaml @@ -0,0 +1,28 @@ +{{- if and .Values.serviceMonitor.enabled .Values.config.relayer.metrics.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: evm-bridge-withdrawer-metrics + labels: + app: evm-bridge-withdrawer + {{- with .Values.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + jobLabel: evm-bridge-withdrawer-metric + namespaceSelector: + matchNames: + - {{ include "evm-bridge-withdrawer.namespace" . }} + selector: + matchLabels: + app: evm-bridge-withdrawer + endpoints: + - port: metric + path: / + {{- with .Values.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} +{{- end }} diff --git a/charts/evm-bridge-withdrawer/values.yaml b/charts/evm-bridge-withdrawer/values.yaml new file mode 100644 index 0000000000..92113eaee8 --- /dev/null +++ b/charts/evm-bridge-withdrawer/values.yaml @@ -0,0 +1,77 @@ +# Default values for sequencer. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +global: + namespaceOverride: "" + replicaCount: 1 + useTTY: true + dev: false + +# sequencer core images +images: + evmBridgeWithdrawer: + repo: ghcr.io/astriaorg/evm-bridge-withdrawer + tag: "0.1.0" + devTag: latest + +config: + sequencerCometbftEndpoint: "" + sequencerChainId: "" + sequencerAddressPrefix: "astria" + sequencerBridgeAddress: "" + feeAssetDenom: "" + minExpectedFeeAssetBalance: "1000000" + rollupAssetDenom: "" + evmContractAddress: "0x" + evmRpcEndpoint: "" + sequencerPrivateKey: + devContent: "" + secret: + filename: "key.hex" + resourceName: "projects/$PROJECT_ID/secrets/celestiaPrivateKey/versions/latest" +ports: + healthAPI: 2450 + metrics: 9000 + +metrics: + enabled: false + +otel: + enabled: false + serviceName: "astria-evm-withdrawer" + endpoint: + tracesEndpoint: + tracesCompression: gzip + tracesTimeout: 10 + otlpHeaders: + traceHeaders: + +serviceMonitor: + enabled: false + port: 26660 + additionalLabels: + release: kube-prometheus-stack + +# When deploying in a production environment should use a secret provider +# This is configured for use with GCP, need to set own resource names +# and keys +secretProvider: + enabled: false + provider: gcp + # May need to update this template to match the secret provider + # it will be passed an object containing: + # { + # key: { + # resourceName: , + # filename: , + # key: + # } + # } + # + # Can update set the source of each chain key at chain..key.secret to + # match the secret provider's requirements. The default works for GCP. + # The secret file must be mapped to the + parametersTemplate: |- + secrets: | + - resourceName: {{ .key.resourceName }} + fileName: "{{ .key.filename }}" diff --git a/charts/evm-rollup/Chart.yaml b/charts/evm-rollup/Chart.yaml index 55247a0a79..a2581202a2 100644 --- a/charts/evm-rollup/Chart.yaml +++ b/charts/evm-rollup/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.22.0 +version: 0.23.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -32,7 +32,7 @@ dependencies: maintainers: - name: wafflesvonmaple url: astria.org - - name: steezeburger + - name: quasystaty1 url: astria.org - name: joroshiba url: astria.org diff --git a/charts/evm-rollup/templates/configmap.yaml b/charts/evm-rollup/templates/configmap.yaml index 4451b0c0f0..1eb62728d4 100644 --- a/charts/evm-rollup/templates/configmap.yaml +++ b/charts/evm-rollup/templates/configmap.yaml @@ -23,6 +23,7 @@ data: ASTRIA_CONDUCTOR_METRICS_HTTP_LISTENER_ADDR: "0.0.0.0:{{ .Values.ports.conductorMetrics }}" ASTRIA_CONDUCTOR_FORCE_STDOUT: "{{ .Values.global.useTTY }}" ASTRIA_CONDUCTOR_PRETTY_PRINT: "{{ .Values.global.useTTY }}" + NO_COLOR: "{{ .Values.global.useTTY }}" ASTRIA_CONDUCTOR_NO_OTEL: "{{ not .Values.config.rollup.otel.enabled }}" ASTRIA_CONDUCTOR_CELESTIA_BEARER_TOKEN: "{{ .Values.config.celestia.token }}" OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.config.rollup.otel.endpoint }}" @@ -44,7 +45,7 @@ metadata: namespace: {{ include "rollup.namespace" . }} data: ASTRIA_COMPOSER_LOG: "astria_composer={{ .Values.config.logLevel }}" - ASTRIA_COMPOSER_API_LISTEN_ADDR: "0.0.0.0:0" + ASTRIA_COMPOSER_API_LISTEN_ADDR: "0.0.0.0:{{ .Values.ports.composerHealthAPI }}" ASTRIA_COMPOSER_GRPC_ADDR: "0.0.0.0:{{ .Values.ports.composerGRPC }}" ASTRIA_COMPOSER_SEQUENCER_CHAIN_ID: "{{ .Values.config.sequencer.chainId }}" ASTRIA_COMPOSER_SEQUENCER_URL: "{{ .Values.config.sequencer.rpc }}" @@ -59,6 +60,7 @@ data: ASTRIA_COMPOSER_METRICS_HTTP_LISTENER_ADDR: "0.0.0.0:{{ .Values.ports.composerMetrics }}" ASTRIA_COMPOSER_FORCE_STDOUT: "{{ .Values.global.useTTY }}" ASTRIA_COMPOSER_PRETTY_PRINT: "{{ .Values.global.useTTY }}" + NO_COLOR: "{{ .Values.global.useTTY }}" ASTRIA_COMPOSER_NO_OTEL: "{{ not .Values.config.rollup.otel.enabled }}" OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.config.rollup.otel.endpoint }}" OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "{{ .Values.config.rollup.otel.tracesEndpoint }}" diff --git a/charts/evm-rollup/templates/service.yaml b/charts/evm-rollup/templates/service.yaml index 67fb015567..add1edd5c0 100644 --- a/charts/evm-rollup/templates/service.yaml +++ b/charts/evm-rollup/templates/service.yaml @@ -13,9 +13,6 @@ spec: - name: ws-rpc-svc port: {{ .Values.ports.wsRPC }} targetPort: ws-rpc - - name: gossipnet-svc - port: {{ .Values.ports.gossipnet }} - targetPort: gossipnet --- {{- if .Values.config.faucet.enabled}} kind: Service diff --git a/charts/evm-rollup/templates/statefulsets.yaml b/charts/evm-rollup/templates/statefulsets.yaml index a0ff5bae5b..f588696830 100644 --- a/charts/evm-rollup/templates/statefulsets.yaml +++ b/charts/evm-rollup/templates/statefulsets.yaml @@ -108,11 +108,21 @@ spec: volumeMounts: - mountPath: "/var/secrets" name: sequencer-private-key - {{- if .Values.config.rollup.metrics.enabled }} + startupProbe: + httpGet: + path: /readyz + port: {{ .Values.ports.composerHealthAPI }} + readinessProbe: + httpGet: + path: /readyz + port: {{ .Values.ports.composerHealthAPI }} ports: + {{- if .Values.config.rollup.metrics.enabled }} - containerPort: {{ .Values.ports.composerMetrics }} name: composer-metr - {{- end }} + {{- end }} + - containerPort: {{ .Values.ports.composerHealthAPI }} + name: composer-api resources: {{- toYaml .Values.resources.composer | trim | nindent 12 }} - name: conductor diff --git a/charts/evm-rollup/values.yaml b/charts/evm-rollup/values.yaml index d0e7a7624d..fb56125196 100644 --- a/charts/evm-rollup/values.yaml +++ b/charts/evm-rollup/values.yaml @@ -38,16 +38,16 @@ config: logLevel: "debug" rollup: - # Default name for the rollup chain, used to generate Rollup ID - name: astria + # string name for the rollup chain, used to generate Rollup ID + name: "" + # EVM network ID used by the chain + networkId: "" # Can be set to 'pebble' or 'leveldb' dbEngine: pebble # Set to true to keep history of all blocks archiveNode: false # Set to true to clear the mempool on startup/restart purgeMempool: false - # EVM network ID used by the chain - networkId: "1337" # Determines what will drive block execution, options are: # - "SoftOnly" -> blocks are only pulled from the sequencer # - "FirmOnly" -> blocks are only pulled from DA @@ -66,7 +66,7 @@ config: maxSubmitInterval: 2000 # Configuration specific to EVM rollup genesis genesis: - # Configuration of Eth forks, setting to 0 will enable form height, + # Configuration of Eth forks, setting to 0 will enable from height, # left as is these forks will not activate. shanghaiTime: "" cancunTime: "" @@ -100,10 +100,6 @@ config: # baseFeeChangeDenominator: 8 # Can configure the genesis allocs for the chain alloc: - - address: "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30" - value: - # The balance must be a string due to size - balance: "1000000000000000000000000000" # Deploying the deterministic deploy proxy contract in genesis # Forge and other tools use this for their CREATE2 usage, but # can only be included through the genesis block after EIP-155 @@ -111,7 +107,12 @@ config: - address: "0x4e59b44847b379578588920cA78FbF26c0B4956C" value: balance: "0" - data: "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3" + code: "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3" + # Example of simple genesis account funding + # - address: "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30" + # value: + # # The balance must be a string due to size + # balance: "1000000000000000000000000000" metrics: # set to enable prometheus metrics enabled: false @@ -154,14 +155,14 @@ config: description: "Chain Head Finalized on {{ $labels.namespace }} is increasing at a rate slower then 20 blocks per 5 minute\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" faucet: - enabled: true + enabled: false proxyCount: 1 # The account from which the faucet disburses funds, likely want to have # the corresponding account given a balance in genesis accounts. # Note: When secretProvider.enabled is true the secret provided by # `evmPrivateKey` is used instead of this value. privateKey: - devContent: "8b3a7999072c9c9314c084044fe705db11714c6c4ed7cddb64da18ea270dd203" + devContent: "" secret: filename: "key.hex" resourceName: "projects/$PROJECT_ID/secrets/sequencerPrivateKey/versions/latest" @@ -180,14 +181,14 @@ config: # Fastest block time possible in MS blockTimeMs: 2000 # URL path for the sequencer - rpc: "http://node0-sequencer-rpc-service.astria-dev-cluster.svc.cluster.local:26657" + rpc: "" # gRPC path for the sequencer - grpc: "http://node0-sequencer-grpc-service.astria-dev-cluster.svc.cluster.local:8080" + grpc: "" # Private key which is used for wrapping txs for sequencer submission # Note: When secretProvider.enabled is true the secret provided by # `sequencerPrivateKey` is used instead of this value. privateKey: - devContent: "2bd806c97f0e00af1a1fc3328fa763a9269723c8db8fac4f93af71db186d6e90" + devContent: "" secret: filename: "key.hex" resourceName: "projects/$PROJECT_ID/secrets/sequencerPrivateKey/versions/latest" @@ -197,11 +198,15 @@ config: # the rpc, ws, and token fields must be set to access celestia network. rpc: "" token: "" - initialBlockHeight: "2" - heightVariance: "10" + # The first block height to look at for a rollup block + initialBlockHeight: "" + # The number of blocks to celestia blocks to allow before finding the next rollup data + # The chain will halt in FirmOnly when this limit is hit. In SoftAndOnly mode, the chain + # will execute up to 6x this of soft blocks ahead of firm commitment and then halt. + heightVariance: "" blockscout: - enabled: true + enabled: false celestia-node: # Strongly recommend leaving enabled when not doing `SoftOnly` execution @@ -233,7 +238,7 @@ secretProvider: fileName: "{{ .key.filename }}" ingress: - enabled: true + enabled: false labels: {} hostname: localdev.me className: nginx @@ -275,7 +280,7 @@ ingress: # hosts: # - chart-example.local faucet: - enabled: true + enabled: false hosts: - faucet.{{ .Values.config.rollup.name }}.{{ .Values.ingress.hostname }} path: / @@ -293,7 +298,7 @@ ingress: # hosts: # - chart-example.local explorer: - enabled: true + enabled: false hosts: - blockscout.{{ .Values.config.rollup.name }}.{{ .Values.ingress.hostname }} path: / @@ -314,7 +319,6 @@ ingress: # Default persistent storage values # NOTE - `rollupName` will be used with `persistentVolumeName` to generate names for kubernetes resources. # e.g. astria-executor-pv, astria-executor-pvc - resources: conductor: requests: @@ -350,7 +354,7 @@ ports: wsRPC: 8546 executionGRPC: 50051 composerGRPC: 50052 - gossipnet: 2451 + composerHealthAPI: 2450 faucet: 8080 blockscout: 4000 metrics: 6060 diff --git a/charts/sequencer-relayer/Chart.yaml b/charts/sequencer-relayer/Chart.yaml index 2346cd3c08..817c68b20d 100644 --- a/charts/sequencer-relayer/Chart.yaml +++ b/charts/sequencer-relayer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.9.0 +version: 0.10.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -26,7 +26,7 @@ appVersion: "0.15.0" maintainers: - name: wafflesvonmaple url: astria.org - - name: steezeburger + - name: quasystaty1 url: astria.org - name: joroshiba url: astria.org diff --git a/charts/sequencer-relayer/templates/configmaps.yaml b/charts/sequencer-relayer/templates/configmaps.yaml index 5135adb01d..fc076a4587 100644 --- a/charts/sequencer-relayer/templates/configmaps.yaml +++ b/charts/sequencer-relayer/templates/configmaps.yaml @@ -10,13 +10,14 @@ data: ASTRIA_SEQUENCER_RELAYER_SEQUENCER_GRPC_ENDPOINT: "{{ .Values.config.relayer.sequencerGrpc }}" ASTRIA_SEQUENCER_RELAYER_CELESTIA_APP_GRPC_ENDPOINT: "{{ .Values.config.relayer.celestiaAppGrpc }}" ASTRIA_SEQUENCER_RELAYER_CELESTIA_APP_KEY_FILE: "/celestia-key/{{ .Values.config.celestiaAppPrivateKey.secret.filename }}" - ASTRIA_SEQUENCER_RELAYER_API_ADDR: "127.0.0.1:{{ .Values.ports.relayerRPC }}" + ASTRIA_SEQUENCER_RELAYER_API_ADDR: "0.0.0.0:{{ .Values.ports.healthAPI }}" ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH: "{{ include "sequencer-relayer.storage.preSubmitPath" . }}" ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH: "{{ include "sequencer-relayer.storage.postSubmitPath" . }}" ASTRIA_SEQUENCER_RELAYER_NO_METRICS: "{{ not .Values.config.relayer.metrics.enabled }}" ASTRIA_SEQUENCER_RELAYER_METRICS_HTTP_LISTENER_ADDR: "0.0.0.0:{{ .Values.ports.metrics }}" ASTRIA_SEQUENCER_RELAYER_FORCE_STDOUT: "{{ .Values.global.useTTY }}" ASTRIA_SEQUENCER_RELAYER_PRETTY_PRINT: "{{ .Values.global.useTTY }}" + NO_COLOR: "{{ .Values.global.useTTY }}" ASTRIA_SEQUENCER_RELAYER_NO_OTEL: "{{ not .Values.config.relayer.otel.enabled }}" OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.config.relayer.otel.endpoint }}" OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "{{ .Values.config.relayer.otel.tracesEndpoint }}" diff --git a/charts/sequencer-relayer/templates/servicemonitor.yaml b/charts/sequencer-relayer/templates/servicemonitor.yaml index 63b0635a37..02b8b1cd73 100644 --- a/charts/sequencer-relayer/templates/servicemonitor.yaml +++ b/charts/sequencer-relayer/templates/servicemonitor.yaml @@ -17,7 +17,7 @@ spec: matchLabels: app: sequencer-relayer endpoints: - - port: metric + - port: metrics path: / {{- with .Values.serviceMonitor.interval }} interval: {{ . }} diff --git a/charts/sequencer-relayer/templates/statefulset.yaml b/charts/sequencer-relayer/templates/statefulset.yaml index d17e67bc84..5b5eac96a6 100644 --- a/charts/sequencer-relayer/templates/statefulset.yaml +++ b/charts/sequencer-relayer/templates/statefulset.yaml @@ -36,6 +36,18 @@ spec: ports: - containerPort: {{ .Values.ports.metrics }} name: metrics + startupProbe: + httpGet: + path: /readyz + port: {{ .Values.ports.healthAPI }} + readinessProbe: + httpGet: + path: /readyz + port: {{ .Values.ports.healthAPI }} + livenessProbe: + httpGet: + path: /healthz + port: {{ .Values.ports.healthAPI }} volumes: - name: relayer-scripts-volume configMap: diff --git a/charts/sequencer-relayer/values.yaml b/charts/sequencer-relayer/values.yaml index 673cf31bde..718b2829c5 100644 --- a/charts/sequencer-relayer/values.yaml +++ b/charts/sequencer-relayer/values.yaml @@ -44,7 +44,7 @@ config: filename: "key.hex" resourceName: "projects/$PROJECT_ID/secrets/celestiaPrivateKey/versions/latest" ports: - relayerRPC: 2450 + healthAPI: 2450 metrics: 9000 serviceMonitor: diff --git a/charts/sequencer/Chart.lock b/charts/sequencer/Chart.lock index 7b4c21e5ba..e3be569fda 100644 --- a/charts/sequencer/Chart.lock +++ b/charts/sequencer/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: sequencer-relayer repository: file://../sequencer-relayer - version: 0.9.0 -digest: sha256:46eea5a5a35a87d2d27c57766c82ae253ee0fa6b171157ddfb6daa57f6ab0171 -generated: "2024-06-27T14:02:36.489567-07:00" + version: 0.10.0 +digest: sha256:b2d8726e0722360789c49dbe60a0eb11751c583e09e32a57767981607533cf21 +generated: "2024-07-01T16:33:42.474014-07:00" diff --git a/charts/sequencer/Chart.yaml b/charts/sequencer/Chart.yaml index 2e84e9c881..f127768d48 100644 --- a/charts/sequencer/Chart.yaml +++ b/charts/sequencer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.17.0 +version: 0.18.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. @@ -24,7 +24,7 @@ appVersion: "0.14.0" dependencies: - name: sequencer-relayer - version: "0.9.0" + version: "0.10.0" repository: "file://../sequencer-relayer" condition: sequencer-relayer.enabled diff --git a/charts/sequencer/templates/configmaps.yaml b/charts/sequencer/templates/configmaps.yaml index 34725dfab3..2f49d4416c 100644 --- a/charts/sequencer/templates/configmaps.yaml +++ b/charts/sequencer/templates/configmaps.yaml @@ -64,6 +64,7 @@ data: ASTRIA_SEQUENCER_METRICS_HTTP_LISTENER_ADDR: "0.0.0.0:{{ .Values.ports.sequencerMetrics }}" ASTRIA_SEQUENCER_FORCE_STDOUT: "{{ .Values.global.useTTY }}" ASTRIA_SEQUENCER_PRETTY_PRINT: "{{ .Values.global.useTTY }}" + NO_COLOR: "{{ .Values.global.useTTY }}" ASTRIA_SEQUENCER_NO_OTEL: "{{ not .Values.sequencer.otel.enabled }}" OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.sequencer.otel.endpoint }}" OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "{{ .Values.sequencer.otel.tracesEndpoint }}" diff --git a/crates/astria-sequencer/src/asset/query.rs b/crates/astria-sequencer/src/asset/query.rs index 4e16bdfa46..3d0dc65c9a 100644 --- a/crates/astria-sequencer/src/asset/query.rs +++ b/crates/astria-sequencer/src/asset/query.rs @@ -111,7 +111,7 @@ fn preprocess_request( Ok(asset) } -pub(crate) async fn allowed_fee_asset_ids_request( +pub(crate) async fn allowed_fee_assets_request( storage: Storage, request: request::Query, _params: Vec<(String, String)>, diff --git a/crates/astria-sequencer/src/service/info/mod.rs b/crates/astria-sequencer/src/service/info/mod.rs index de0240df3c..fce0a33a99 100644 --- a/crates/astria-sequencer/src/service/info/mod.rs +++ b/crates/astria-sequencer/src/service/info/mod.rs @@ -60,8 +60,8 @@ impl Info { .context("invalid path: `asset/denom/:id`")?; query_router .insert( - "asset/allowed_fee_asset_ids", - crate::asset::query::allowed_fee_asset_ids_request, + "asset/allowed_fee_assets", + crate::asset::query::allowed_fee_assets_request, ) .context("invalid path: `asset/allowed_fee_asset_ids`")?; query_router @@ -295,7 +295,7 @@ mod test { } #[tokio::test] - async fn handle_allowed_fee_asset_ids_query() { + async fn handle_allowed_fee_assets_query() { use astria_core::generated::protocol::asset::v1alpha1 as raw; let storage = cnidarium::TempStorage::new().await.unwrap(); @@ -322,7 +322,7 @@ mod test { storage.commit(state).await.unwrap(); let info_request = InfoRequest::Query(request::Query { - path: "asset/allowed_fee_asset_ids".to_string(), + path: "asset/allowed_fee_assets".to_string(), data: vec![].into(), height: u32::try_from(height).unwrap().into(), prove: false, diff --git a/dev/kubernetes/namespace.yml b/dev/kubernetes/namespace.yml deleted file mode 100644 index e69916763b..0000000000 --- a/dev/kubernetes/namespace.yml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: astria-dev-cluster diff --git a/dev/values/cilium.yml b/dev/values/cilium.yml index 6e9b9ffc41..9f42516584 100644 --- a/dev/values/cilium.yml +++ b/dev/values/cilium.yml @@ -14,13 +14,13 @@ image: ipam: mode: kubernetes hubble: - enabled: true + enabled: false relay: - enabled: true + enabled: false ui: - enabled: true + enabled: false ingress: - enabled: true + enabled: false annotations: kubernetes.io/ingress.class: nginx hosts: diff --git a/dev/values/rollup/dev.yaml b/dev/values/rollup/dev.yaml index 765de0d9bf..1ad96a5649 100644 --- a/dev/values/rollup/dev.yaml +++ b/dev/values/rollup/dev.yaml @@ -3,11 +3,89 @@ global: dev: true config: + # The level at which core astria components will log out + # Options are: error, warn, info, and debug + logLevel: "debug" + + rollup: + # Default name for the rollup chain, used to generate Rollup ID + name: astria + # Set to true to keep history of all blocks + archiveNode: false + # EVM network ID used by the chain + networkId: "1337" + # Determines what will drive block execution, options are: + # - "SoftOnly" -> blocks are only pulled from the sequencer + # - "FirmOnly" -> blocks are only pulled from DA + # - "SoftAndFirm" -> blocks are pulled from both the sequencer and DA + executionCommitLevel: 'SoftAndFirm' + # Configuration specific to EVM rollup genesis + genesis: + # Configuration of Eth forks, setting to 0 will enable form height, + # left as is these forks will not activate. + shanghaiTime: "0" + cancunTime: "" + pragueTime: "" + verkleTime: "" + # Configure the gas Limit + gasLimit: "8000000" + # Set to a hex set of bytes if your rollup has manually configured extra data + extraDataOverride: "" + # If set to true the genesis block will contain extra data + overrideGenesisExtraData: true + # Configure the sequencer bridge addresses and allowed assets if using + # the astria canonical bridge. Recommend removing alloc values if so. + bridgeAddresses: + - bridgeAddress: "astria13ahqz4pjqfmynk9ylrqv4fwe4957x2p0h5782u" + startHeight: 1 + assetDenom: "nria" + assetPrecision: 9 + # Configure the fee collector for the evm tx fees, activated at block heights. + # If not configured, all tx fees will be burned. + feeCollectors: + 1: "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30" + # Configure EIP-1559 params, activated at block heights + eip1559Params: {} + # 1: + # minBaseFee: 0 + # elasticityMultiplier: 2 + # baseFeeChangeDenominator: 8 + # Can configure the genesis allocs for the chain + alloc: + # Deploying the deterministic deploy proxy contract in genesis + # Forge and other tools use this for their CREATE2 usage, but + # can only be included through the genesis block after EIP-155 + # https://github.com/Arachnid/deterministic-deployment-proxy + - address: "0x4e59b44847b379578588920cA78FbF26c0B4956C" + value: + balance: "0" + code: "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3" + - address: "0xA58639fB5458e65E4fA917FF951C390292C24A15" + value: + balance: "0" + code: "0x60806040526004361061004a5760003560e01c80637eb6dec71461004f578063a996e0201461009d578063b6476c7e146100b2578063bab916d0146100d4578063db97dc98146100e7575b600080fd5b34801561005b57600080fd5b506100837f000000000000000000000000000000000000000000000000000000000000000981565b60405163ffffffff90911681526020015b60405180910390f35b6100b06100ab366004610315565b6100fc565b005b3480156100be57600080fd5b506100c761019e565b6040516100949190610381565b6100b06100e23660046103cf565b61022c565b3480156100f357600080fd5b506100c76102bf565b3460006101297f000000000000000000000000000000000000000000000000000000003b9aca0083610411565b1161014f5760405162461bcd60e51b815260040161014690610433565b60405180910390fd5b34336001600160a01b03167f0c64e29a5254a71c7f4e52b3d2d236348c80e00a00ba2e1961962bd2827c03fb8787878760405161018f94939291906104ea565b60405180910390a35050505050565b600180546101ab9061051c565b80601f01602080910402602001604051908101604052809291908181526020018280546101d79061051c565b80156102245780601f106101f957610100808354040283529160200191610224565b820191906000526020600020905b81548152906001019060200180831161020757829003601f168201915b505050505081565b3460006102597f000000000000000000000000000000000000000000000000000000003b9aca0083610411565b116102765760405162461bcd60e51b815260040161014690610433565b34336001600160a01b03167f0f4961cab7530804898499aa89f5ec81d1a73102e2e4a1f30f88e5ae3513ba2a85856040516102b2929190610556565b60405180910390a3505050565b600080546101ab9061051c565b60008083601f8401126102de57600080fd5b50813567ffffffffffffffff8111156102f657600080fd5b60208301915083602082850101111561030e57600080fd5b9250929050565b6000806000806040858703121561032b57600080fd5b843567ffffffffffffffff8082111561034357600080fd5b61034f888389016102cc565b9096509450602087013591508082111561036857600080fd5b50610375878288016102cc565b95989497509550505050565b600060208083528351808285015260005b818110156103ae57858101830151858201604001528201610392565b506000604082860101526040601f19601f8301168501019250505092915050565b600080602083850312156103e257600080fd5b823567ffffffffffffffff8111156103f957600080fd5b610405858286016102cc565b90969095509350505050565b60008261042e57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526062908201527f417374726961576974686472617765723a20696e73756666696369656e74207660408201527f616c75652c206d7573742062652067726561746572207468616e203130202a2a60608201527f20283138202d20424153455f434841494e5f41535345545f505245434953494f6080820152614e2960f01b60a082015260c00190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6040815260006104fe6040830186886104c1565b82810360208401526105118185876104c1565b979650505050505050565b600181811c9082168061053057607f821691505b60208210810361055057634e487b7160e01b600052602260045260246000fd5b50919050565b60208152600061056a6020830184866104c1565b94935050505056fea264697066735822122047a7ef84c0be4640572989abfc01decbc1ae143d4659f1b32047978c67ebc9c864736f6c63430008150033" + faucet: + enabled: true + privateKey: + devContent: "8b3a7999072c9c9314c084044fe705db11714c6c4ed7cddb64da18ea270dd203" + + # The amount of token to give per request + amount: 1 sequencer: chainId: sequencer-test-chain-0 + # URL path for the sequencer + rpc: "http://node0-sequencer-rpc-service.astria-dev-cluster.svc.cluster.local:26657" + # gRPC path for the sequencer + grpc: "http://node0-sequencer-grpc-service.astria-dev-cluster.svc.cluster.local:8080" + privateKey: + devContent: "2bd806c97f0e00af1a1fc3328fa763a9269723c8db8fac4f93af71db186d6e90" celestia: rpc: "http://celestia-service.astria-dev-cluster.svc.cluster.local:26658" token: "http://celestia-service.astria-dev-cluster.svc.cluster.local:5353" + initialBlockHeight: "2" + heightVariance: "10" + blockscout: + enabled: true resources: conductor: @@ -37,3 +115,16 @@ celestia-node: storage: enabled: false + +ingress: + enabled: true + services: + rpc: + enabled: true + ws: + enabled: true + faucet: + enabled: true + explorer: + enabled: true + diff --git a/dev/values/validators/all.yml b/dev/values/validators/all.yml index 9e2fee6c7a..7e09b12ef6 100644 --- a/dev/values/validators/all.yml +++ b/dev/values/validators/all.yml @@ -27,7 +27,12 @@ genesis: balance: "333333333333333333" - address: astria1vpcfutferpjtwv457r63uwr6hdm8gwr3pxt5ny balance: "333333333333333333" - # NOTE - the following address matches the privKey that funds the - # sequencer-faucet + # Matches the privKey that funds the dev sequencer-faucet - address: astria1qrt4kfc9ggyy548u7rg0d64sgq5c952kzk9tg9 balance: "333333333333333333" + # This account is used for bridge in smoke test. + - address: astria13ahqz4pjqfmynk9ylrqv4fwe4957x2p0h5782u + balance: "48" + +storage: + enabled: false diff --git a/dev/values/withdrawer/values.yaml b/dev/values/withdrawer/values.yaml new file mode 100644 index 0000000000..40324268d0 --- /dev/null +++ b/dev/values/withdrawer/values.yaml @@ -0,0 +1,28 @@ +global: + namespaceOverride: "" + replicaCount: 1 + # Whether to use tty readable logging for astria services, when false uses + # structured json logging of tracing events. + useTTY: true + dev: true + +config: + sequencerCometbftEndpoint: "http://node0-sequencer-rpc-service.astria-dev-cluster.svc.cluster.local:26657" + sequencerChainId: "sequencer-test-chain-0" + minExpectedFeeAssetBalance: "0" + sequencerBridgeAddress: "astria13ahqz4pjqfmynk9ylrqv4fwe4957x2p0h5782u" + feeAssetDenom: "nria" + rollupAssetDenom: "nria" + evmContractAddress: "0xA58639fB5458e65E4fA917FF951C390292C24A15" + evmRpcEndpoint: "ws://astria-evm-service.astria-dev-cluster.svc.cluster.local:8546/" + sequencerPrivateKey: + devContent: "dfa7108e38ab71f89f356c72afc38600d5758f11a8c337164713e4471411d2e0" + +metrics: + enabled: false + +otel: + enabled: false + +serviceMonitor: + enabled: false diff --git a/justfile b/justfile index 2707bc54db..307ac0c4b0 100644 --- a/justfile +++ b/justfile @@ -62,7 +62,7 @@ _lint-toml: [no-exit-message] _lint-md: - markdownlint-cli2 "**/*.md" "#target" "#.github" + markdownlint-cli2 "**/*.md" "#target" "#.github" "#**/*/astria-bridge-contracts/lib/**/*.md" [no-exit-message] _fmt-proto: