Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
github-merge-queue[bot] committed Jul 25, 2024
1 parent f69b7e2 commit 29371ea
Show file tree
Hide file tree
Showing 13 changed files with 126 additions and 355 deletions.
23 changes: 0 additions & 23 deletions charts/bridge-test/.helmignore

This file was deleted.

28 changes: 0 additions & 28 deletions charts/bridge-test/Chart.yaml

This file was deleted.

58 changes: 0 additions & 58 deletions charts/bridge-test/files/scripts/test-ibc-transfer.sh

This file was deleted.

23 changes: 0 additions & 23 deletions charts/bridge-test/templates/_helpers.tpl

This file was deleted.

26 changes: 0 additions & 26 deletions charts/bridge-test/templates/configmap.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions charts/bridge-test/templates/job.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions charts/bridge-test/values.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions charts/deploy.just
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
mod ibc-test

##############################################
## Deploying and Running using Helm and K8s ##
##############################################
Expand Down Expand Up @@ -225,6 +227,16 @@ init-rollup-bridge rollupName=defaultRollupName evmDestinationAddress=evm_destin
--fee-asset=$FEE_ASSET --asset=$ASSET || exit 1


init-ibc-bridge privateKey asset feeAsset rollupName=defaultRollupName:
astria-cli sequencer init-bridge-account \
--rollup-name {{ rollupName }} \
--private-key {{ privateKey }} \
--sequencer.chain-id {{ sequencer_chain_id }} \
--sequencer-url {{ sequencer_rpc_url }} \
--fee-asset {{ feeAsset }} \
--asset {{ asset }}


eth_rpc_url := "http://executor.astria.localdev.me/"
eth_ws_url := "ws://ws-executor.astria.localdev.me/"
bridge_tx_bytes := "0xf8f280843c54e7f182898594a58639fb5458e65e4fa917ff951c390292c24a15880de0b6b3a7640000b884bab916d00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002d617374726961313777306164656736346b7930646178776432756779756e65656c6c6d6a676e786c333935303400000000000000000000000000000000000000820a96a086b85348c9816f6d34533669db3d3626cf55eecea6a380d4d072efb1839df443a04b8b60c8b91dd30add1ca4a96097238d73bab29b0a958322d9a51755d5a5f287"
Expand Down
111 changes: 111 additions & 0 deletions charts/ibc-test.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
defaultTag := ""

delete:
-just delete celestia-local
-just delete sequencer
-just delete hermes-local
-just delete rollup

@deploy 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 ./sequencer > /dev/null
helm dependency update ./evm-stack > /dev/null
echo "Setting up single astria sequencer..." && helm install \
-n astria-validator-single single-sequencer-chart ./sequencer \
-f ../dev/values/validators/all.yml \
-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 ./evm-stack \
-f ../dev/values/rollup/dev.yaml \
-f ../dev/values/rollup/ibc-bridge-test.yaml \
{{ if tag != '' { replace('--set evm-rollup.images.conductor.devTag=# --set composer.images.composer.devTag=# --set evm-bridge-withdrawer.images.evmBridgeWithdrawer.devTag=#', '#', tag) } else { '' } }} \
--set blockscout-stack.enabled=false \
--set postgresql.enabled=false \
--set evm-faucet.enabled=false > /dev/null
just wait-for-rollup > /dev/null
echo "Deploying Hermes"
just deploy hermes-local > /dev/null
kubectl wait -n astria-dev-cluster deployment hermes-local-chart --for=condition=Available=True --timeout=300s

[no-cd]
run celestiaHome pathToCelestiaAppd=default_celestia_appd :
#!/usr/bin/env bash
initial_balance=$(just evm-get-balance {{evm_destination_address}})

# Create a bridge account on the sequencer
just init-ibc-bridge {{ sequencer_tia_bridge_pkey }} transfer/channel-0/utia nria

# Load the private key of the Celestia dev account to issue transfers
just ibc-test _load-celestia-key "{{ celestiaHome}}" "{{ pathToCelestiaAppd }}"

# Execute the transfer from Celestia to the Rollup
just ibc-test _do-ibc-transfer "{{ celestiaHome}}" "{{ pathToCelestiaAppd }}"

# Multiplication factor is 10^-6 (utia to tia) * 10^18 (rollup factor) = 10^12
let expected_balance="$initial_balance + {{ transfer_amount }} * 10**12"

for i in {1..50}
do
current_balance=$(just evm-get-balance {{evm_destination_address}})
echo "check $i, balance: $current_balance, expected: $expected_balance"
if (( expected_balance == $current_balance )); then
expected_balance_found="1"
break
else
sleep 1
fi
done
if [[ -z $expected_balance_found ]]; then
echo "expected balance was not found; IBC transfer from Celestia to the Rollup failed"
exit 1
fi


bridge_address := "astria1d7zjjljc0dsmxa545xkpwxym86g8uvvwhtezcr"
celestia_dev_account_address := "celestia1m0ksdjl2p5nzhqy3p47fksv52at3ln885xvl96"
celestia_dev_account_key_name := "dev"
celestia_dev_account_mnemonic := "enrich avocado local net will avoid dizzy truth column excuse ready lesson"
celestia_chain_id := "celestia-local-0"
celestia_node_url := "http://rpc.app.celestia.localdev.me:80"
sequencer_tia_bridge_pkey := "6015fbe1c365d3c5ef92dc891db8c5bb26ad454bec2db4762b96e9f8b2430285"
keyring_backend := "test"

# This is the same address as used in deploy.just
evm_destination_address := "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30"

# all in units of utia
transfer_amount := "53000"
transfer_fees := "26000"

default_celestia_appd := "celestia-appd"
[no-cd]
_load-celestia-key celestiaHome pathToCelestiaAppd=default_celestia_appd:
#!/usr/bin/env bash
pwd
"{{pathToCelestiaAppd}}" keys add {{ celestia_dev_account_key_name }} \
--home "{{celestiaHome}}" \
--keyring-backend="{{ keyring_backend }}" \
--recover <<< "{{ celestia_dev_account_mnemonic }}"
[no-cd]
_do-ibc-transfer celestiaHome pathToCelestiaAppd=default_celestia_appd:
echo "Performing IBC transfer..."
"{{pathToCelestiaAppd}}" tx ibc-transfer transfer \
transfer \
channel-0 \
{{ bridge_address }} \
"{{ transfer_amount }}utia" \
--memo="{\"rollupDepositAddress\":\"{{ evm_destination_address }}\"}" \
--chain-id="{{ celestia_chain_id }}" \
--node="{{ celestia_node_url }}" \
--from="{{ celestia_dev_account_address }}" \
--fees="{{ transfer_fees }}utia" \
--yes \
--log_level=debug \
--home "{{celestiaHome}}" \
--keyring-backend="{{ keyring_backend }}"
2 changes: 1 addition & 1 deletion charts/sequencer-relayer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.11.0
version: 0.11.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
Expand Down
Loading

0 comments on commit 29371ea

Please sign in to comment.