Skip to content

Commit

Permalink
refactor: simplify, trim and remove defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
vcastellm committed Aug 13, 2024
1 parent d37f6b9 commit e4b5bb8
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 78 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ 1.21.x ]
go-version: [ 1.22.x ]
goarch: [ "amd64" ]
e2e-group: [ "elderberry-validium", "elderberry-rollup" ]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,12 +55,6 @@ jobs:
uses: actions/checkout@v4
with:
repository: 0xPolygon/kurtosis-cdk
ref: jesteban/cdk-seq_sender
path: "ext/kurtosis-cdk"

- name: Link kurtosis-cdk folder
shell: bash
run: mkdir -p /tmp/cdk/ && ln -s $GITHUB_WORKSPACE/ext/kurtosis-cdk /tmp/cdk/kurtosis-cdk-jesteban_cdk-seq_sender_

- name: Test
run: make test-e2e-${{ matrix.e2e-group }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/dist/
cmd/__debug_bin
/target
tmp
Empty file removed scripts/.gitkeep
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if [ $? -ne 0 ]; then
echo "Error inspecting enclave $ENCLAVE"
echo "You must start kurtosis environment before running this script"
echo "- start kurtosis:"
echo " kurtosis clean --all; kurtosis run --enclave $ENCLAVE --args-file cdk-erigon-sequencer-params.yml --image-download always ."
echo " kurtosis clean --all; kurtosis run --enclave $ENCLAVE --args-file params.yml --image-download always ."

exit 1
fi
Expand All @@ -53,11 +53,11 @@ l1_rpc_port=$(kurtosis port print $ENCLAVE el-1-geth-lighthouse rpc | cut -f 3 -
zkevm_data_streamer_port=$(kurtosis port print $ENCLAVE cdk-erigon-sequencer-001 data-streamer | cut -f 3 -d ":")
[ $? -ne 0 ] && echo "Error getting zkevm_data_streamer_port" && exit 1 || export zkevm_data_streamer_port && echo "zkevm_data_streamer_port=$zkevm_data_streamer_port"

kurtosis files download $ENCLAVE zkevm-sequence-sender-config-artifact $DEST
export zkevm_l2_sequencer_address=$(cat $DEST/config.toml |grep L2Coinbase | cut -f 2 -d "="| tr -d '"' | tr -d ' ')
export zkevm_l2_keystore_password=$(cat $DEST/config.toml |grep -A1 L2Coinbase | tr ',' '\n' | grep Password | cut -f 2 -d '=' | tr -d '}' | tr -d '"' | tr -d ' ')
export l1_chain_id=$(cat $DEST/config.toml |grep L1ChainID | cut -f 2 -d '=')
export zkevm_is_validium=$(cat $DEST/config.toml |grep IsValidiumMode | cut -f 2 -d '=')
kurtosis files download $ENCLAVE cdk-node-config-artifact $DEST
export zkevm_l2_sequencer_address=$(cat $DEST/cdk-node-config.toml |grep L2Coinbase | cut -f 2 -d "="| tr -d '"' | tr -d ' ')
export zkevm_l2_keystore_password=$(cat $DEST/cdk-node-config.toml |grep -A1 L2Coinbase | tr ',' '\n' | grep Password | cut -f 2 -d '=' | tr -d '}' | tr -d '"' | tr -d ' ')
export l1_chain_id=$(cat $DEST/cdk-node-config.toml |grep L1ChainID | cut -f 2 -d '=')
export zkevm_is_validium=$(cat $DEST/cdk-node-config.toml |grep IsValidiumMode | cut -f 2 -d '=')

if [ "$zkevm_is_validium" == "true" ]; then
echo "Validium mode detected... Retrieving the dac_port"
Expand All @@ -68,10 +68,10 @@ fi
envsubst < test/config/test.kurtosis_template.toml > $DEST/test.kurtosis.toml

echo "- to restart kurtosis:"
echo " kurtosis clean --all; kurtosis run --enclave cdk-v1 --args-file cdk-erigon-sequencer-params.yml --image-download always ."
echo " kurtosis clean --all; kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always ."
echo " "
echo "- Stop sequence-sender:"
echo " kurtosis service stop cdk-v1 zkevm-node-sequence-sender-001"
echo "- Stop cdk-node:"
echo " kurtosis service stop cdk-v1 cdk-node-001"
echo " "
echo "- Add next configuration to vscode launch.json"
cat << EOF
Expand All @@ -82,7 +82,7 @@ cat << EOF
"mode": "auto",
"program": "cmd/",
"args":["run","-cfg","$DEST/test.kurtosis.toml",
"--components", "sequence-sender",
"--components", "sequence-sender,aggregator",
"--custom-network-file", "$DEST/local_config/genesis.json"
]
},
Expand Down
4 changes: 2 additions & 2 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ generate-mocks-da: ## Generates mocks for dataavailability, using mockery tool

.PHONY: test-e2e-elderberry-validium
test-e2e-elderberry-validium: stop ## Runs e2e tests checking elderberry/validium
./run-e2e-seq_sender.sh cdk-validium
./run-e2e.sh cdk-validium

.PHONY: test-e2e-elderberry-rollup
test-e2e-elderberry-rollup: stop ## Runs e2e tests checking elderberry/rollup
./run-e2e-seq_sender.sh rollup
./run-e2e.sh rollup

.PHONY: stop
stop:
Expand Down
8 changes: 1 addition & 7 deletions test/run-e2e-seq_sender.sh → test/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ if [ -z $DATA_AVAILABILITY_MODE ]; then
echo "Missing DATA_AVAILABILITY_MODE: ['rollup', 'cdk-validium']"
exit 1
fi
KURTOSIS_VERSION=jesteban/cdk-seq_sender
BASE_FOLDER=$(dirname $0)
KURTOSIS_FOLDER=$($BASE_FOLDER/scripts/get_kurtosis_clone_folder.sh $KURTOSIS_VERSION)
[ $? -ne 0 ] && echo "Error getting kurtosis folder" && exit 1

$BASE_FOLDER/scripts/clone_kurtosis.sh $KURTOSIS_VERSION "$KURTOSIS_FOLDER"
[ $? -ne 0 ] && echo "Error cloning kurtosis " && exit 1

docker images -q cdk:latest > /dev/null
if [ $? -ne 0 ] ; then
Expand All @@ -31,4 +25,4 @@ kurtosis clean --all
kurtosis run --enclave cdk-v1 --args-file $DEST_KURTOSIS_PARAMS_YML --image-download always $KURTOSIS_FOLDER
#[ $? -ne 0 ] && echo "Error running kurtosis" && exit 1
echo "Waiting 10 minutes to get some verified batch...."
$KURTOSIS_FOLDER/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh 0 600
$KURTOSIS_FOLDER/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh 0 600
31 changes: 0 additions & 31 deletions test/scripts/clone_kurtosis.sh

This file was deleted.

6 changes: 4 additions & 2 deletions test/scripts/env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
### Common variables
ENCLAVE=cdk-v1
TMP_CDK_FOLDER=/tmp/cdk
DEST_KURTOSIS_PARAMS_YML=$TMP_CDK_FOLDER/e2e-params.yml
TMP_CDK_FOLDER=tmp/cdk
DEST_KURTOSIS_PARAMS_YML=../$TMP_CDK_FOLDER/e2e-params.yml
KURTOSIS_VERSION=develop
KURTOSIS_FOLDER=../../kurtosis-cdk
11 changes: 0 additions & 11 deletions test/scripts/get_kurtosis_clone_folder.sh

This file was deleted.

9 changes: 1 addition & 8 deletions test/scripts/kurtosis_prepare_params_yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ if [ -z $DATA_AVAILABILITY_MODE ]; then
exit 1
fi




cp $KURTOSIS_FOLDER/cdk-erigon-sequencer-params.yml $DEST_KURTOSIS_PARAMS_YML
cp $KURTOSIS_FOLDER/params.yml $DEST_KURTOSIS_PARAMS_YML
yq -Y --in-place ".args.data_availability_mode = \"$DATA_AVAILABILITY_MODE\"" $DEST_KURTOSIS_PARAMS_YML
yq -Y --in-place ".args.zkevm_sequence_sender_image = \"cdk:latest\"" $DEST_KURTOSIS_PARAMS_YML
yq -Y --in-place ".args.sequencer_type = \"erigon\"" $DEST_KURTOSIS_PARAMS_YML
yq -Y --in-place ".args.deploy_cdk_erigon_node = true" $DEST_KURTOSIS_PARAMS_YML
yq -Y --in-place ".args.sequencer_type = \"erigon\"" $DEST_KURTOSIS_PARAMS_YML
yq -Y --in-place ".args.sequencer_sender_type = \"cdk\"" $DEST_KURTOSIS_PARAMS_YML

0 comments on commit e4b5bb8

Please sign in to comment.