-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(charts): hermes chart fixes, bech32 updates, ibc bridge test (#…
…1130) ## Summary Fixes hermes helm chart ## Background We want to run hermes via helm chart so we can automate e2e testing. ## Changes * add 2nd funded celestia account * use this account's key in hermes * fix hermes chart values * add new chart `bridge-test` * add new justfile `dev/bridgetester.just` * add `AstriaSequencerHrpPrefix` to evm rollup geth-genesis ## Testing - `just deploy-cluster` - `just deploy-ibc-test-infra` - deploys ingress controller - deploys celestia-local - deploys single astria sequencer - `./charts/sequencer/values.yaml` - `./dev/values/validators/single.yaml` - deploys evm rollup - `./charts/evm-rollup/values.yaml` - `./dev/values/rollup/dev.yaml` - `./dev/values/rollup/ibc-bridge-test.yaml` - deploy hermes - `./charts/hermes/values.yaml` - `./dev/values/hermes/local.yml` - `just deploy-bridge-tester` - initContainer handles initializing bridge account on the sequencer - container runs scripts - `celestia-appd keys add` - `celestia-appd tx ibc-transfer transfer` - checks balance before and after and fails if ibc-transfer did not go through ## Metrics - List out metrics added by PR, delete section if none. ## Breaking Changelist - Bulleted list of breaking changes, any notes on migration. Delete section if none. ## Related Issues Link any issues that are related, prefer full github links. closes <!-- list any issues closed here -->
- Loading branch information
1 parent
6999a52
commit bd34b38
Showing
29 changed files
with
515 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: v2 | ||
name: bridge-test | ||
description: A Helm chart for Kubernetes | ||
|
||
# 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.1.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. | ||
# It is recommended to use it with quotes. | ||
appVersion: "0.1.0" | ||
|
||
maintainers: | ||
- name: steezeburger | ||
url: astria.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/sh | ||
|
||
get_evm_balance() { | ||
HEX_NUM=$(curl -X POST "$evm_url" -s -d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBalance\",\"params\":[\"$evm_to_address\", \"latest\"],\"id\":1}" -H 'Content-Type: application/json' | jq -r '.result') | ||
# strip 0x | ||
HEX_NUM=$(echo "$HEX_NUM" | sed 's/^0x//') | ||
# capitalize all lowercase letters | ||
HEX_NUM=$(echo "$HEX_NUM" | tr '[:lower:]' '[:upper:]') | ||
# print as integer | ||
echo "ibase=16; $HEX_NUM" | bc | ||
} | ||
|
||
addKeyForCelestiaAccount() { | ||
# add key for the celestia dev account using the mnemonic | ||
echo "Adding key for the celestia dev account..." | ||
echo "$celestia_dev_account_mnemonic" | celestia-appd keys add \ | ||
"$celestia_dev_account_key_name" \ | ||
--home "$home_dir" \ | ||
--keyring-backend="$keyring_backend" \ | ||
--recover | ||
} | ||
|
||
performIBCTransfer() { | ||
# perform ibc transfer | ||
echo "Performing IBC transfer..." | ||
celestia-appd tx ibc-transfer transfer \ | ||
transfer \ | ||
channel-0 \ | ||
"$bridge_account_address_bech32" \ | ||
53000utia \ | ||
--memo="{\"rollupAddress\":\"$evm_to_address\"}" \ | ||
--chain-id="$celestia_chain_id" \ | ||
--node="$celestia_node_url" \ | ||
--from="$celestia_dev_account_address" \ | ||
--fees=26000utia \ | ||
--yes \ | ||
--log_level=debug \ | ||
--home "$home_dir" \ | ||
--keyring-backend="$keyring_backend" | ||
} | ||
|
||
initial_balance=$(get_evm_balance) | ||
|
||
addKeyForCelestiaAccount | ||
performIBCTransfer | ||
|
||
# FIXME - should probably poll w/ timeout instead of sleeping? | ||
sleep 30 | ||
|
||
final_balance=$(get_evm_balance) | ||
expected_balance=$(echo "$initial_balance + 53000000000000000" | bc) | ||
if [ "$(echo "$final_balance == $expected_balance" | bc)" -eq 0 ]; then | ||
echo "IBC Transfer failed!" | ||
echo "Expected balance $expected_balance, got $final_balance" | ||
exit 1 | ||
else | ||
echo "IBC Transfer successful!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{/* | ||
Namespace to deploy elements into. | ||
*/}} | ||
{{- define "bridge-test.namespace" -}} | ||
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "bridge-test.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: bridge-test-env | ||
namespace: {{ include "bridge-test.namespace" . }} | ||
data: | ||
home_dir: "/home/celestia" | ||
keyring_backend: "test" | ||
bridge_account_address: "{{ .Values.bridgeAccount.address }}" | ||
bridge_account_address_bech32: "{{ .Values.bridgeAccount.bech32 }}" | ||
evm_to_address: "{{ .Values.evmToAddress }}" | ||
evm_url: "{{ .Values.evmURL }}" | ||
celestia_chain_id: "{{ .Values.celestiaChainID }}" | ||
celestia_node_url: "{{ .Values.celestiaNodeURL }}" | ||
celestia_dev_account_address: "{{ .Values.celestiaDevAccount.address }}" | ||
celestia_dev_account_mnemonic: "{{ .Values.celestiaDevAccount.mnemonic }}" | ||
celestia_dev_account_key_name: "{{ .Values.celestiaDevAccount.name }}" | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: bridge-test-scripts | ||
namespace: {{ include "bridge-test.namespace" . }} | ||
data: | ||
test-ibc-transfer.sh: | | ||
{{- .Files.Get "files/scripts/test-ibc-transfer.sh" | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "bridge-test.fullname" . }} | ||
labels: | ||
app: astria-dev-cluster | ||
namespace: {{ include "bridge-test.namespace" . }} | ||
spec: | ||
template: | ||
metadata: | ||
name: {{ include "bridge-test.fullname" . }} | ||
labels: | ||
app: astria-dev-cluster | ||
spec: | ||
initContainers: | ||
- name: init-bridge-account | ||
image: {{ .Values.bridgeTesterUtilityImage }} | ||
command: [ "astria-go", "sequencer", "bridge", "init", {{ .Values.evmRollupName }} ] | ||
args: | ||
- --privkey={{ .Values.bridgeAccount.privkey }} | ||
- --sequencer-chain-id={{ .Values.sequencerChainId }} | ||
- --sequencer-url={{ .Values.sequencerURL }} | ||
- --asset={{ .Values.asset }} | ||
- --fee-asset={{ .Values.feeAsset }} | ||
- --log-level=debug | ||
containers: | ||
- name: test-ibc-transfer | ||
image: {{ .Values.bridgeTesterUtilityImage }} | ||
command: [ "/scripts/test-ibc-transfer.sh" ] | ||
volumeMounts: | ||
- mountPath: /scripts/ | ||
name: bridge-test-scripts-volume | ||
envFrom: | ||
- configMapRef: | ||
name: bridge-test-env | ||
volumes: | ||
- name: bridge-test-scripts-volume | ||
configMap: | ||
name: bridge-test-scripts | ||
defaultMode: 0777 | ||
restartPolicy: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
replicaCount: 1 | ||
|
||
# this image is overridden in ci/cd with the image built in ci/cd | ||
bridgeTesterUtilityImage: ghcr.io/astriaorg/bridge-tester-utility:local | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
namespaceOverride: "" | ||
fullnameOverride: "" | ||
|
||
# must match rollup name used in evm rollup chart values | ||
evmRollupName: "astria" | ||
# this is a shared dev address | ||
evmToAddress: "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30" | ||
# evm execution api url | ||
evmURL: "http://astria-evm-service.astria-dev-cluster.svc.cluster.local:8545" | ||
|
||
sequencerURL: "http://node0-sequencer-rpc-service.astria-dev-cluster.svc.cluster.local:26657" | ||
# must match chain id used in sequencer chart values | ||
sequencerChainId: "sequencer-test-chain-0" | ||
asset: "transfer/channel-0/utia" | ||
feeAsset: "nria" | ||
|
||
# sequencer bridge account. is funded during sequencer genesis. | ||
bridgeAccount: | ||
address: "6f85297e587b61b37695a1ac17189b3e907e318e" | ||
bech32: "astria1d7zjjljc0dsmxa545xkpwxym86g8uvvwhtezcr" | ||
privkey: "6015fbe1c365d3c5ef92dc891db8c5bb26ad454bec2db4762b96e9f8b2430285" | ||
pubkey: "b78aa61c65f21e5fe0f31d221819053fa2286dd6eff83fc490e3ee746f144626" | ||
|
||
celestiaChainID: "celestia-local-0" | ||
celestiaNodeURL: "http://celestia-app-service.astria-dev-cluster.svc.cluster.local:26657" | ||
|
||
# this account should be funded during celestia genesis | ||
celestiaDevAccount: | ||
name: "dev-account" | ||
address: "celestia1m0ksdjl2p5nzhqy3p47fksv52at3ln885xvl96" | ||
mnemonic: "enrich avocado local net will avoid dizzy truth column excuse ready lesson" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.