Skip to content

Commit

Permalink
first pass of smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
bharath-123 committed Feb 16, 2025
1 parent 2db84ed commit 612e040
Show file tree
Hide file tree
Showing 7 changed files with 424 additions and 4 deletions.
16 changes: 16 additions & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,22 @@ working both up and down the stack.
> just ibc-test delete
```

## Running an Auctioneer smoke test

You can run a smoke test which tests the full auctioneer functionality end to end.

Check failure on line 201 in charts/README.md

View workflow job for this annotation

GitHub Actions / markdown

Trailing spaces

charts/README.md:201:83 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

Check failure on line 201 in charts/README.md

View workflow job for this annotation

GitHub Actions / markdown

Line length

charts/README.md:201:81 MD013/line-length Line length [Expected: 80; Actual: 83] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md013.md

1. The bid is streamed from the flame node to the auctioneer node
2. The auctioneer node wraps the winning bid in an allocation and sends it to the sequencer.

Check failure on line 204 in charts/README.md

View workflow job for this annotation

GitHub Actions / markdown

Line length

charts/README.md:204:81 MD013/line-length Line length [Expected: 80; Actual: 92] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md013.md
3. The sequencer node includes the allocation in a block
4. The flame node reads the allocation and places the winning tx at the top of the block

Check failure on line 206 in charts/README.md

View workflow job for this annotation

GitHub Actions / markdown

Line length

charts/README.md:206:81 MD013/line-length Line length [Expected: 80; Actual: 88] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md013.md

```

Check failure on line 208 in charts/README.md

View workflow job for this annotation

GitHub Actions / markdown

Fenced code blocks should have a language specified

charts/README.md:208 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md040.md
> just deploy cluster
> just auctioneer-test deploy
> just auctioneer-test run
> just auctioneer-test delete
```

## Examining Deployments

[k9s](https://k9scli.io/) is a useful utility for inspecting deployed
Expand Down
124 changes: 124 additions & 0 deletions charts/auctioneer-test.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
_default:
@just --list auctioneer-test

defaultTag := ""
defaultNamespace := "astria-dev-cluster"
evm_destination_address := "0x507056D8174aC4fb40Ec51578d18F853dFe000B2"
smoke_test_image := "bharath123456/auctioneer-smoke-test:latest"
sequencer_grpc_url := "grpc.sequencer.localdev.me"
eth_rpc_url := "http://executor.astria.localdev.me"
searcher_private_key := "5478c1df1db4867e4d29ab1cf6c6ed0ae0b2c3fbe7fc6e00edd0891d507d43f2"
rollup_name := "astria"
amount_to_send := "10000"

delete:
-just delete celestia-local
-just delete sequencers
-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..."
helm install celestia-local-chart ./celestia-local --namespace {{defaultNamespace}} --set fast=true --create-namespace > /dev/null
helm dependency update ./sequencer > /dev/null
helm dependency update ./evm-stack > /dev/null

echo "Setting up 3 astria sequencer nodes"
echo "Setting up the first astria sequencers..." && helm install \
-n astria-validator-node0 node0-sequencer-chart ./sequencer \
-f ../dev/values/validators/all.yml \
-f ../dev/values/validators/node0.yml \
--set sequencer.optimisticBlockApis.enabled=true \
{{ if tag != '' { replace('--set images.sequencer.devTag=# --set sequencer-relayer.images.sequencerRelayer.devTag=#', '#', tag) } else { '' } }} \
--create-namespace > /dev/null

echo "Setting up the second astria sequencer..." && helm install \
-n astria-validator-node1 node1-sequencer-chart ./sequencer \
-f ../dev/values/validators/all.yml \
-f ../dev/values/validators/node1.yml \
--set sequencer.optimisticBlockApis.enabled=true \
{{ if tag != '' { replace('--set images.sequencer.devTag=# --set sequencer-relayer.images.sequencerRelayer.devTag=#', '#', tag) } else { '' } }} \
--create-namespace > /dev/null

echo "Setting up the third astria sequencer..." && helm install \
-n astria-validator-node2 node2-sequencer-chart ./sequencer \
-f ../dev/values/validators/all.yml \
-f ../dev/values/validators/node2.yml \
--set sequencer.optimisticBlockApis.enabled=true \
{{ 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 Flame EVM rollup and the Auctioneer..." && helm install -n astria-dev-cluster astria-chain-chart ./evm-stack \
-f ../dev/values/rollup/auctioneer-test.yaml \
{{ if tag != '' { replace('--set evm-rollup.images.conductor.devTag=# --set auctioneer.images.auctioneer.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 auctioneer.enabled=true \
--set config.geth.auctioneer=true \
--set evm-bridge-withdrawer.enabled=false \
--set evm-faucet.enabled=false > /dev/null
# TODO - don't wait for evm-bridge-withdrawer
just wait-for-rollup > /dev/null

[no-cd]
run tag=defaultTag:
#!/usr/bin/env bash
set +e
echo "Running auctioneer smoke test 5 times..."
echo
success=0
for i in {1..5} ; do
echo "Running test iteration $i..."
echo

echo "Getting initial balance of {{evm_destination_address}}"
initial_balance=$(just evm-get-balance {{evm_destination_address}})
echo "Initial balance: $initial_balance"
echo

expected_balance=$(echo "$initial_balance + {{amount_to_send}}" | bc)

docker run --rm \
--network host {{smoke_test_image}} \
--sequencer-url {{sequencer_grpc_url}} \
--eth-rpc-url {{eth_rpc_url}} \
--searcher-private-key {{searcher_private_key}} \
--rollup-name {{rollup_name}} \
--address-to-send {{evm_destination_address}} \
--amount-to-send {{amount_to_send}} \

if [ $? -ne 0 ]; then
echo
echo "Smoke test iteration $i failed!"
echo
continue
fi

echo
echo "Getting final balance of {{evm_destination_address}}"
final_balance=$(just evm-get-balance {{evm_destination_address}})

echo "Verifying if the final balance is as expected..."
if [ "$final_balance" -eq "$expected_balance" ]; then
(( success++ ))
echo "Smoke test iteration $i passed!"
else
echo "Smoke test iteration $i failed!"
echo "Expected balance: $expected_balance, Actual balance: $final_balance"
fi
echo
done
echo "Done with all iterations!"
echo
echo "Verifying if the smoke test passed at least 3 times..."
echo
echo "$success/5 tests has passed"
if [ "$success" -gt 2 ]; then
echo "Smoke test passed!"
else
echo "Smoke test failed!"
exit 1
fi
5 changes: 2 additions & 3 deletions charts/auctioneer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ images:
auctioneer:
repo: ghcr.io/astriaorg/auctioneer
pullPolicy: IfNotPresent
# TODO - update to latest tag
tag: "pr-1839"
devTag: "pr-1839"
tag: sha-2db84ed
devTag: latest

config:
sequencerGrpcEndpoint: ""
Expand Down
1 change: 1 addition & 0 deletions charts/deploy.just
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod ibc-test
mod auctioneer-test

##############################################
## Deploying and Running using Helm and K8s ##
Expand Down
2 changes: 1 addition & 1 deletion charts/flame-rollup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ images:
repo: ghcr.io/astriaorg/flame
pullPolicy: IfNotPresent
tag: sha-457e1f9
devTag: sha-457e1f9
devTag: latest
conductor:
repo: ghcr.io/astriaorg/conductor
pullPolicy: IfNotPresent
Expand Down
Loading

0 comments on commit 612e040

Please sign in to comment.