diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a46095d99d..d9f9ea6f03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,16 +87,17 @@ jobs: - name: Checkout Repo uses: actions/checkout@v4 - name: Publish to Charts Repo - uses: nkoppel/push-files-to-another-repository@v1.1.2 + uses: cpina/push-files-to-another-repository@v1.7.2 env: API_TOKEN_GITHUB: ${{ secrets.CHARTS_REPO_TOKEN }} with: - source-files: 'charts/' - destination-username: 'astriaorg' - destination-branch: 'main' - destination-repository: 'charts' - commit-email: '${{ github.actor }}@users.noreply.github.com' - commit-username: '${{ github.actor }}' + 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 }}' conductor: needs: run_checker diff --git a/charts/celestia-node/Chart.yaml b/charts/celestia-node/Chart.yaml index 0b5349d630..1142edcbfc 100644 --- a/charts/celestia-node/Chart.yaml +++ b/charts/celestia-node/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.3.0 +version: 0.3.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 diff --git a/charts/celestia-node/files/config.toml b/charts/celestia-node/files/config.toml index 7d10dfe04e..eb2ce571ba 100644 --- a/charts/celestia-node/files/config.toml +++ b/charts/celestia-node/files/config.toml @@ -72,7 +72,7 @@ AdvertiseInterval = "22h0m0s" [Header] - TrustedHash = "" + TrustedHash = {{ .Values.config.trustedHash | quote }} TrustedPeers = [] [Header.Store] StoreCacheSize = 4096 @@ -90,18 +90,16 @@ RangeRequestTimeout = "8s" {{- end }} -{{- if eq .Values.config.type "light" }} [DASer] SamplingRange = 100 - ConcurrencyLimit = 16 BackgroundStoreInterval = "10m0s" - SampleFrom = 1 + SampleFrom = {{ toString .Values.config.startHeight | replace "\"" "" }} +{{- if eq .Values.config.type "light" }} + ConcurrencyLimit = 16 SampleTimeout = "4m0s" {{- else if eq .Values.config.type "full" }} SamplingRange = 100 ConcurrencyLimit = 6 - BackgroundStoreInterval = "10m0s" - SampleFrom = 1 SampleTimeout = "3m0s" {{- end }} diff --git a/charts/celestia-node/files/scripts/start-node.sh b/charts/celestia-node/files/scripts/start-node.sh index 144463271d..99dd522638 100644 --- a/charts/celestia-node/files/scripts/start-node.sh +++ b/charts/celestia-node/files/scripts/start-node.sh @@ -24,7 +24,7 @@ export CELESTIA_CUSTOM=$CELESTIA_CUSTOM_TO_BE exec /bin/celestia {{ .Values.config.type }} start \ --node.store /celestia \ {{- if not .Values.config.tokenAuthLevel }} - --rpc.skipAuth \ + --rpc.skip-auth \ {{- end }} {{- if not $isCustomNetwork }} --core.ip {{ .Values.config.coreIp }} \ diff --git a/charts/celestia-node/templates/statefulset.yaml b/charts/celestia-node/templates/statefulset.yaml index 9dc7e364f9..ab145433ea 100644 --- a/charts/celestia-node/templates/statefulset.yaml +++ b/charts/celestia-node/templates/statefulset.yaml @@ -36,7 +36,7 @@ spec: containers: - name: {{ $label }} image: {{ .Values.images.node }} - command: ["./celestia/scripts/start-node.sh"] + command: ["/celestia/scripts/start-node.sh"] securityContext: runAsUser: 10001 runAsGroup: 10001 diff --git a/charts/celestia-node/values.yaml b/charts/celestia-node/values.yaml index a5752127c4..f5b6f311ec 100644 --- a/charts/celestia-node/values.yaml +++ b/charts/celestia-node/values.yaml @@ -14,6 +14,8 @@ config: tokenAuthLevel: read # can set to nil or false to disable rpc auth coreGrpcPort: 9090 customInfo: '' + startHeight: "1" + trustedHash: "B93BBE20A0FBFDF955811B6420F8433904664D45DB4BF51022BE4200C1A1680D" images: pullPolicy: IfNotPresent diff --git a/charts/deploy.just b/charts/deploy.just new file mode 100644 index 0000000000..c31ad40351 --- /dev/null +++ b/charts/deploy.just @@ -0,0 +1,226 @@ +############################################## +## Deploying and Running using Helm and K8s ## +############################################## +defaultNamespace := "astria-dev-cluster" +deploy tool *ARGS: + @just deploy-{{tool}} {{ARGS}} + +delete tool *ARGS: + @just delete-{{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 +delete-all: clean clean-persisted-data + +deploy-astria-local namespace=defaultNamespace: (deploy-chart "celestia-local" namespace) (deploy-sequencer) +delete-astria-local namespace=defaultNamespace: (delete-chart "celestia-local" namespace) (delete-sequencer) + +[private] +deploy-chart chart namespace=defaultNamespace: + helm install {{chart}}-chart ./charts/{{chart}} --namespace {{namespace}} --create-namespace + +[private] +delete-chart chart namespace=defaultNamespace: + helm uninstall {{chart}}-chart --namespace {{namespace}} + +[private] +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 \ + -f ./dev/values/cilium.yml \ + --namespace kube-system + kubectl create namespace {{namespace}} + +deploy-ingress-controller: + kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml + +[private] +deploy-celestia-local namespace=defaultNamespace: (deploy-chart "celestia-local" namespace) + +[private] +delete-celestia-local namespace=defaultNamespace: (delete-chart "celestia-local" namespace) + +deploy-secrets-store: + @just helm-add-if-not-exist secrets-store-csi-driver https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts + helm install csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --namespace kube-system + +delete-secrets-store: + @just delete chart csi-secrets-store kube-system + +wait-for-ingress-controller: + while ! kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=600s; do \ + sleep 1; \ + done + +validatorName := "single" +deploy-sequencer name=validatorName: + helm dependency update charts/sequencer > /dev/null + helm install --debug \ + {{ replace('-f dev/values/validators/#.yml' , '#', name) }} \ + -n astria-validator-{{name}} --create-namespace \ + {{name}}-sequencer-chart ./charts/sequencer +deploy-sequencers: (deploy-sequencer "node0") (deploy-sequencer "node1") (deploy-sequencer "node2") + +deploy-hermes-local: + helm install hermes-local-chart ./charts/hermes \ + -n astria-dev-cluster \ + -f dev/values/hermes/local.yml +delete-hermes-local: + @just delete chart hermes-local + +delete-sequencer name=validatorName: + @just delete chart {{name}}-sequencer astria-validator-{{name}} +delete-sequencers: (delete-sequencer "node0") (delete-sequencer "node1") (delete-sequencer "node2") + +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 + +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: + 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: + @just delete chart {{rollupName}}-chain + +wait-for-rollup rollupName=defaultRollupName: + kubectl rollout status --watch statefulset/{{rollupName}}-geth -n astria-dev-cluster --timeout=600s + +defaultHypAgentConfig := "" +defaultHypRelayerPrivateKey := "" +defaultHypValidatorPrivateKey := "" +deploy-hyperlane-agents rollupName=defaultRollupName agentConfig=defaultHypAgentConfig relayerPrivateKey=defaultHypRelayerPrivateKey validatorPrivateKey=defaultHypValidatorPrivateKey: + helm install --debug \ + {{ if rollupName != '' { replace('--set config.name=# --set global.namespace=#-dev-cluster', '#', rollupName) } else { '' } }} \ + {{ if agentConfig != '' { replace('--set config.agentConfig=#', '#', agentConfig) } else { '' } }} \ + {{ if relayerPrivateKey != '' { replace('--set config.relayer.privateKey=#', '#', relayerPrivateKey) } else { '' } }} \ + {{ if validatorPrivateKey != '' { replace('--set config.validator.privateKey=#', '#', validatorPrivateKey) } else { '' } }} \ + {{rollupName}}-hyperlane-agents-chart ./charts/hyperlane-agents --namespace astria-dev-cluster + +delete-hyperlane-agents rollupName=defaultRollupName: + @just delete {{rollupName}}-hyperlane-agents + +clean: + kind delete cluster --name astria-dev-cluster + +clean-persisted-data: + rm -r /tmp/astria + +deploy-local-metrics: + kubectl apply -f kubernetes/metrics-server-local.yml + +defaultTag := "" + +deploy-smoke-test tag=defaultTag: + @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 + @helm dependency update charts/evm-rollup > /dev/null + @echo "Setting up single astria sequencer..." && helm install \ + -n astria-validator-single single-sequencer-chart ./charts/sequencer \ + -f dev/values/validators/single.yml \ + {{ if tag != '' { replace('--set images.sequencer.devTag=# --set sequencer-relayer.images.sequencerRelayer.devTag=#', '#', tag) } else { '' } }} \ + --create-namespace > /dev/null + @just wait-for-sequencer > /dev/null + @echo "Starting EVM rollup..." && helm install -n astria-dev-cluster astria-chain-chart ./charts/evm-rollup -f dev/values/rollup/dev.yaml \ + {{ 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 + @just wait-for-rollup > /dev/null + @sleep 15 + +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" + break + else + sleep 1 + fi + TRANSFER_RUNS=$((TRANSFER_RUNS+1)) + done + if [ $TRANSFER_RUNS -eq $MAX_RUNS ]; then + echo "Transfer 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" + break + else + sleep 1 + fi + SOFT_RUNS=$((SOFT_RUNS+1)) + done + + 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 + else + sleep 1 + fi + echo "Finalized block: $FINAL, Check number: $FINALIZED_RUNS" + FINALIZED_RUNS=$((FINALIZED_RUNS+1)) + done + echo "Finalization failure" + exit 1 + +delete-smoke-test: + just delete celestia-local + just delete sequencer + just delete rollup \ No newline at end of file diff --git a/charts/evm-rollup/Chart.lock b/charts/evm-rollup/Chart.lock index eca5156bbe..af27353d3a 100644 --- a/charts/evm-rollup/Chart.lock +++ b/charts/evm-rollup/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: celestia-node repository: file://../celestia-node - version: 0.3.0 -digest: sha256:11880d5ac9449bd674625fe78e6af327ba9b8fadacbfe2b43d53f849c80a9860 -generated: "2024-04-26T14:51:12.590892-07:00" + version: 0.3.1 +digest: sha256:ad93a19d54455cd6d3abaf20a2e9a662d986651998f81089983da6744435c5ff +generated: "2024-05-02T15:44:33.852501-07:00" diff --git a/charts/evm-rollup/Chart.yaml b/charts/evm-rollup/Chart.yaml index 74db3b2387..9a97024aba 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.15.1 +version: 0.15.2 # 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 @@ -25,7 +25,7 @@ appVersion: "0.10.0" dependencies: - name: celestia-node - version: "0.3.0" + version: "0.3.1" repository: "file://../celestia-node" condition: celestia-node.enabled diff --git a/justfile b/justfile index 062decdad4..2707bc54db 100644 --- a/justfile +++ b/justfile @@ -1,3 +1,5 @@ +import 'charts/deploy.just' + default: @just --list @@ -75,230 +77,3 @@ _lint-proto: buf breaking proto/sequencerblockapis --against 'buf.build/astria/sequencerblock-apis' buf breaking proto/protocolapis --against 'buf.build/astria/protocol-apis' buf breaking proto/composerapis --against 'buf.build/astria/composer-apis' - -############################################## -## Deploying and Running using Helm and K8s ## -############################################## -defaultNamespace := "astria-dev-cluster" -deploy tool *ARGS: - @just deploy-{{tool}} {{ARGS}} - -delete tool *ARGS: - @just delete-{{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 -delete-all: clean clean-persisted-data - -deploy-astria-local namespace=defaultNamespace: (deploy-chart "celestia-local" namespace) (deploy-sequencer) -delete-astria-local namespace=defaultNamespace: (delete-chart "celestia-local" namespace) (delete-sequencer) - -[private] -deploy-chart chart namespace=defaultNamespace: - helm install {{chart}}-chart ./charts/{{chart}} --namespace {{namespace}} --create-namespace - -[private] -delete-chart chart namespace=defaultNamespace: - helm uninstall {{chart}}-chart --namespace {{namespace}} - -[private] -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 \ - -f ./dev/values/cilium.yml \ - --namespace kube-system - kubectl create namespace {{namespace}} - -deploy-ingress-controller: - kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml - -[private] -deploy-celestia-local namespace=defaultNamespace: (deploy-chart "celestia-local" namespace) - -[private] -delete-celestia-local namespace=defaultNamespace: (delete-chart "celestia-local" namespace) - -deploy-secrets-store: - @just helm-add-if-not-exist secrets-store-csi-driver https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts - helm install csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --namespace kube-system - -delete-secrets-store: - @just delete chart csi-secrets-store kube-system - -wait-for-ingress-controller: - while ! kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=600s; do \ - sleep 1; \ - done - -validatorName := "single" -deploy-sequencer name=validatorName: - helm dependency update charts/sequencer > /dev/null - helm install --debug \ - {{ replace('-f dev/values/validators/#.yml' , '#', name) }} \ - -n astria-validator-{{name}} --create-namespace \ - {{name}}-sequencer-chart ./charts/sequencer -deploy-sequencers: (deploy-sequencer "node0") (deploy-sequencer "node1") (deploy-sequencer "node2") - -deploy-hermes-local: - helm install hermes-local-chart ./charts/hermes \ - -n astria-dev-cluster \ - -f dev/values/hermes/local.yml -delete-hermes-local: - @just delete chart hermes-local - -delete-sequencer name=validatorName: - @just delete chart {{name}}-sequencer astria-validator-{{name}} -delete-sequencers: (delete-sequencer "node0") (delete-sequencer "node1") (delete-sequencer "node2") - -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 - -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: - 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: - @just delete chart {{rollupName}}-chain - -wait-for-rollup rollupName=defaultRollupName: - kubectl rollout status --watch statefulset/{{rollupName}}-geth -n astria-dev-cluster --timeout=600s - -defaultHypAgentConfig := "" -defaultHypRelayerPrivateKey := "" -defaultHypValidatorPrivateKey := "" -deploy-hyperlane-agents rollupName=defaultRollupName agentConfig=defaultHypAgentConfig relayerPrivateKey=defaultHypRelayerPrivateKey validatorPrivateKey=defaultHypValidatorPrivateKey: - helm install --debug \ - {{ if rollupName != '' { replace('--set config.name=# --set global.namespace=#-dev-cluster', '#', rollupName) } else { '' } }} \ - {{ if agentConfig != '' { replace('--set config.agentConfig=#', '#', agentConfig) } else { '' } }} \ - {{ if relayerPrivateKey != '' { replace('--set config.relayer.privateKey=#', '#', relayerPrivateKey) } else { '' } }} \ - {{ if validatorPrivateKey != '' { replace('--set config.validator.privateKey=#', '#', validatorPrivateKey) } else { '' } }} \ - {{rollupName}}-hyperlane-agents-chart ./charts/hyperlane-agents --namespace astria-dev-cluster - -delete-hyperlane-agents rollupName=defaultRollupName: - @just delete {{rollupName}}-hyperlane-agents - -clean: - kind delete cluster --name astria-dev-cluster - -clean-persisted-data: - rm -r /tmp/astria - -deploy-local-metrics: - kubectl apply -f kubernetes/metrics-server-local.yml - -defaultTag := "" - -deploy-smoke-test tag=defaultTag: - @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 - @helm dependency update charts/evm-rollup > /dev/null - @echo "Setting up single astria sequencer..." && helm install \ - -n astria-validator-single single-sequencer-chart ./charts/sequencer \ - -f dev/values/validators/single.yml \ - {{ if tag != '' { replace('--set images.sequencer.devTag=# --set sequencer-relayer.images.sequencerRelayer.devTag=#', '#', tag) } else { '' } }} \ - --create-namespace > /dev/null - @just wait-for-sequencer > /dev/null - @echo "Starting EVM rollup..." && helm install -n astria-dev-cluster astria-chain-chart ./charts/evm-rollup -f dev/values/rollup/dev.yaml \ - {{ 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 - @just wait-for-rollup > /dev/null - @sleep 15 - -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" - break - else - sleep 1 - fi - TRANSFER_RUNS=$((TRANSFER_RUNS+1)) - done - if [ $TRANSFER_RUNS -eq $MAX_RUNS ]; then - echo "Transfer 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" - break - else - sleep 1 - fi - SOFT_RUNS=$((SOFT_RUNS+1)) - done - - 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 - else - sleep 1 - fi - echo "Finalized block: $FINAL, Check number: $FINALIZED_RUNS" - FINALIZED_RUNS=$((FINALIZED_RUNS+1)) - done - echo "Finalization failure" - exit 1 - -delete-smoke-test: - just delete celestia-local - just delete sequencer - just delete rollup