Skip to content

Commit

Permalink
Merge branch 'main' into fix/hermes-chart
Browse files Browse the repository at this point in the history
* main:
  feat(cli): add cmd to collect withdrawal events and submit as actions (#1261)
  fix(core, bridge, sequencer)!: dismabiguate return addresses (#1266)
  fix(withdrawer): support withdrawer address that differs from bridge address   (#1262)
  (core, sequencer)!: generate serde traits impls for all protocol protobufs (#1260)
  fix(charts): add resources for sequencer/cometbft (#1254)
  chore(sequencer)!: add metrics (#1248)
  fix(sequencer-utils): fixes issue in `parse_blob` tests (#1243)
  feat(core, proto)!: make bridge unlock memo string (#1244)
  fix(conductor): don't panic during panic (#1252)
  feat(core)!: lowerCamelCase for protobuf json mapping (#1250)
  refactor(bridge-withdrawer)!: refactor startup to a separate subtask and remove balance check from startup (#1190)
  fix: rollup archive node configurations (#1249)
  refactor(core, bridge-withdrawer)!: move bridge-unlock memo to core (#1245)
  fix(sequencer)!: store native asset ibc->trace mapping in init_chain (#1242)
  • Loading branch information
steezeburger committed Jul 15, 2024
2 parents e7907df + 1555c03 commit 5a3c8e7
Show file tree
Hide file tree
Showing 93 changed files with 8,148 additions and 1,532 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
- "**-v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "**-v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "**-v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"

pull_request:
types:
- opened
Expand Down Expand Up @@ -146,6 +146,39 @@ jobs:
timeout-minutes: 3
run: just run-smoke-test

smoke-cli:
needs: [run_checker, composer, conductor, sequencer, sequencer-relayer, evm-bridge-withdrawer]
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'astriaorg/astria') && (github.event_name == 'merge_group' || needs.run_checker.outputs.run_docker == 'true')
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Install kind
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:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Smoke Test Environment
timeout-minutes: 5
run: |
TAG=sha-$(git rev-parse --short HEAD)
just deploy cluster
kubectl create secret generic regcred --from-file=.dockerconfigjson=$HOME/.docker/config.json --type=kubernetes.io/dockerconfigjson
echo -e "\n\nDeploying with astria images tagged $TAG"
just deploy smoke-cli $TAG
- name: Run Smoke test
timeout-minutes: 3
run: just run-smoke-cli

ibc-bridge-test:
needs: [ run_checker, composer, conductor, sequencer, sequencer-relayer ]
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'astriaorg/astria') && (github.event_name == 'merge_group' || needs.run_checker.outputs.run_docker == 'true')
Expand Down Expand Up @@ -195,7 +228,8 @@ jobs:
docker:
if: ${{ always() && !cancelled() }}
needs: [composer, conductor, sequencer, sequencer-relayer, evm-bridge-withdrawer, smoke-test]
needs: [composer, conductor, sequencer, sequencer-relayer, evm-bridge-withdrawer, smoke-test, smoke-cli]
uses: ./.github/workflows/reusable-success.yml
with:
success: ${{ !contains(needs.*.result, 'failure') }}

17 changes: 15 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

136 changes: 125 additions & 11 deletions charts/deploy.just
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ delete tool *ARGS:
init tool *ARGS:
@just init-{{tool}} {{ARGS}}

run-smoke type *ARGS:
@just run-smoke-{{type}} {{ARGS}}

load-image image:
kind load docker-image {{image}} --name astria-dev-cluster

Expand Down Expand Up @@ -148,7 +151,6 @@ 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
Expand All @@ -171,6 +173,25 @@ deploy-smoke-test tag=defaultTag:
{{ if tag != '' { replace('--set images.evmBridgeWithdrawer.devTag=#', '#', tag) } else { '' } }} > /dev/null
@just wait-for-rollup > /dev/null

deploy-smoke-cli 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/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 ./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-dev-rollup > /dev/null


evm_destination_address := "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30"
# 1 RIA is 10^9 nRIA
Expand All @@ -180,32 +201,33 @@ rollup_multiplier := "1000000000"
# 10 RIA
sequencer_transfer_amount := "10"
sequencer_rpc_url := "http://rpc.sequencer.localdev.me"
sequencer_bridge_address := "astria13ahqz4pjqfmynk9ylrqv4fwe4957x2p0h5782u"
sequencer_bridge_pkey := "dfa7108e38ab71f89f356c72afc38600d5758f11a8c337164713e4471411d2e0"
sequencer_chain_id := "sequencer-test-chain-0"
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 \
--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 \
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.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/"
eth_ws_url := "ws://ws-executor.astria.localdev.me/"
bridge_tx_bytes := "0xf8f280843c54e7f182898594a58639fb5458e65e4fa917ff951c390292c24a15880de0b6b3a7640000b884bab916d00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002d617374726961313777306164656736346b7930646178776432756779756e65656c6c6d6a676e786c333935303400000000000000000000000000000000000000820a96a086b85348c9816f6d34533669db3d3626cf55eecea6a380d4d072efb1839df443a04b8b60c8b91dd30add1ca4a96097238d73bab29b0a958322d9a51755d5a5f287"
bridge_tx_hash := "0x67db5b0825e8f60b926234e209d54e0336cd94defe6720e7acadf871e0377150"
run-smoke-test:
Expand Down Expand Up @@ -272,7 +294,7 @@ run-smoke-test:
sleep 1
fi
done
if [ $CHECKS -eq $MAX_CHECKS ]; then
if [ $CHECKS -gt $MAX_CHECKS ]; then
echo "Bridge Out Sequencer failure"
exit 1
fi
Expand All @@ -293,8 +315,8 @@ run-smoke-test:
sleep 1
fi
done
if [ $CHECKS -eq $MAX_CHECKS ]; then
echo "Bridge Out Sequencer failure"
if [ $CHECKS -gt $MAX_CHECKS ]; then
echo "Finalization failure"
exit 1
fi
exit 0
Expand All @@ -304,6 +326,98 @@ delete-smoke-test:
just delete sequencer
just delete rollup

evm_contract_address := "0xA58639fB5458e65E4fA917FF951C390292C24A15"
run-smoke-cli:
#!/usr/bin/env bash
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
done
if [ $CHECKS -eq $MAX_CHECKS ]; then
echo "Bridge In failure"
exit 1
fi

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
done
if [ $CHECKS -eq $MAX_CHECKS ]; then
echo "Bridge Out EVM failure"
exit 1
fi

CURRENT_BLOCK_HEX=$(just evm-get-block-by-number latest | jq -r '.number')
CURRENT_BLOCK=$(just hex-to-dec $CURRENT_BLOCK_HEX)
echo {{sequencer_bridge_pkey}} > test_se

astria-cli bridge collect-withdrawals \
--rollup-endpoint {{eth_ws_url}} \
--contract-address {{evm_contract_address}} \
--from-rollup-height 1 \
--to-rollup-height $CURRENT_BLOCK \
--rollup-asset-denom nria \
--bridge-address {{sequencer_bridge_address}} \
--output ./withdrawals.json
astria-cli bridge submit-withdrawals \
--signing-key <(printf "%s" "{{sequencer_bridge_pkey}}") \
--sequencer-chain-id {{sequencer_chain_id}} \
--sequencer-url {{sequencer_rpc_url}} \
--input ./withdrawals.json


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 -gt $MAX_CHECKS ]; then
echo "Bridge Out Sequencer failure"
exit 1
fi

exit 0

#############################################
## EVM Curl Command Helper Functions ##
#############################################
Expand Down
2 changes: 1 addition & 1 deletion charts/evm-bridge-withdrawer/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.0.1
version: 0.0.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
Expand Down
2 changes: 1 addition & 1 deletion charts/evm-bridge-withdrawer/templates/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ data:
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 }}"
Expand All @@ -30,6 +29,7 @@ data:
OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.otel.traceHeaders }}"
OTEL_SERVICE_NAME: "{{ tpl .Values.otel.serviceName . }}"
{{- if not .Values.global.dev }}
ASTRIA_BRIDGE_WITHDRAWER_MIN_EXPECTED_FEE_ASSET_BALANCE: "{{ .Values.config.minExpectedFeeAssetBalance }}"
{{- else }}
{{- end }}
---
Expand Down
2 changes: 1 addition & 1 deletion charts/evm-rollup/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.23.0
version: 0.23.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
3 changes: 3 additions & 0 deletions charts/evm-rollup/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ spec:
- --maxpeers=0
{{- if .Values.config.rollup.archiveNode }}
- --gcmode=archive
- --state.scheme=hash
- --history.transactions=0
- --history.state=0
{{- else }}
- --state.scheme=path
- --history.state=540000
{{- end }}
{{ if .Values.config.rollup.metrics.enabled }}
- --metrics
Expand Down
2 changes: 1 addition & 1 deletion charts/sequencer/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.18.0
version: 0.18.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.
Expand Down
14 changes: 14 additions & 0 deletions charts/sequencer/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ spec:
- containerPort: {{ .Values.ports.sequencerMetrics }}
name: seq-metric
{{- end }}
resources:
requests:
cpu: {{ .Values.resources.sequencer.requests.cpu }}
memory: {{ .Values.resources.sequencer.requests.memory }}
limits:
cpu: {{ .Values.resources.sequencer.limits.cpu }}
memory: {{ .Values.resources.sequencer.limits.memory }}
- name: cometbft
imagePullPolicy: IfNotPresent
command: [ "cometbft", "start" ]
Expand All @@ -78,6 +85,13 @@ spec:
- containerPort: {{ .Values.ports.cometbftMetrics }}
name: cometbft-metric
{{- end }}
resources:
requests:
cpu: {{ .Values.resources.cometbft.requests.cpu }}
memory: {{ .Values.resources.cometbft.requests.memory }}
limits:
cpu: {{ .Values.resources.cometbft.limits.cpu }}
memory: {{ .Values.resources.cometbft.limits.memory }}
volumes:
- name: cometbft-config-volume
configMap:
Expand Down
Loading

0 comments on commit 5a3c8e7

Please sign in to comment.