Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump smart-contracts to v6.2.0 #168

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions .github/actions/tests/local-environment-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,31 +92,48 @@ runs:
echo "Cardano network is ready! Waiting for Partner Chain first node to start..."
INIT_TIMESTAMP=$(docker exec cardano-node-1 cat /shared/cardano.start)
echo "INIT_TIMESTAMP=$INIT_TIMESTAMP" >> $GITHUB_ENV

epoch=0
restart_count=0
max_restarts=10

# Wait for the Partner Chain node to be ready or until max restarts or epoch 2 is reached
while ! docker exec partner-chains-node-1 [ -e /shared/partner-chains-node-1.ready ]; do
epoch=$(docker exec cardano-node-1 cardano-cli query tip --testnet-magic 42 | jq -r .epoch)
echo "Epoch: $epoch"
if [ "$epoch" -ge 3 ]; then
echo "MC has reached epoch 3 and partner-chains-node-1 is still not ready. Failing test and gathering logs."
exit 1
container_status=$(docker inspect -f '{{.State.Status}}' partner-chains-node-1)
echo "Container status: $container_status"
if [ "$container_status" = "restarting" ]; then
restart_count=$((restart_count + 1))
echo "partner-chains-node-1 is restarting ($restart_count/$max_restarts)"
if [ "$restart_count" -ge "$max_restarts" ]; then
echo "partner-chains-node-1 has restarted $restart_count times. Failing early."
exit 1
fi
else
restart_count=0
fi
if [ "$epoch" -ge 2 ]; then
echo "Epoch has reached 2 and partner-chains-node-1 is still not ready."
exit 1
fi
sleep 10
done
shell: bash
- name: Collect and zip Docker logs
run: |
mkdir -p docker_logs
mkdir -p local-environment-logs
docker ps -a --format '{{.Names}}' | while read line; do
echo "Collecting logs for container $line"
docker logs "$line" > "docker_logs/$line.log" 2>&1 || true
docker logs "$line" > "local-environment-logs/$line.log" 2>&1 || true
done
zip -r docker_logs.zip docker_logs/
zip -r local-environment-logs.zip local-environment-logs/
shell: bash
- name: Upload Docker logs artifact
uses: actions/upload-artifact@v4
with:
name: docker_logs
path: docker_logs.zip
name: local-environment-logs
path: local-environment-logs.zip
- name: Fail the job
if: ${{ steps.wait-pc-node.outcome == 'failure' }}
run: exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if [ "$PC_CONTRACTS_CLI_READY" -eq 0 ]; then
echo "Downloading pc-contracts-cli and node_modules..."
wget -q -O ./pc-contracts-cli.zip "$PC_CONTRACTS_CLI_ZIP_URL"
unzip -o ./pc-contracts-cli.zip > /dev/null
mv ./sidechain-cli ./pc-contracts-cli
fi

if [ "$PC_NODE_READY" -eq 0 ]; then
Expand Down Expand Up @@ -89,7 +88,6 @@ echo "Generating addresses.json file..."
--sidechain-id $CHAIN_ID --threshold-numerator $THRESHOLD_NUMERATOR --threshold-denominator $THRESHOLD_DENOMINATOR \
--governance-authority $GOVERNANCE_AUTHORITY \
--version 1 \
--atms-kind plain-ecdsa-secp256k1 \
> addresses.json

export COMMITTEE_CANDIDATE_ADDRESS=$(jq -r '.addresses.CommitteeCandidateValidator' addresses.json)
Expand Down Expand Up @@ -118,7 +116,6 @@ echo "Inserting D parameter..."
--genesis-committee-hash-utxo $GENESIS_COMMITTEE_UTXO \
--sidechain-id $CHAIN_ID --threshold-numerator $THRESHOLD_NUMERATOR --threshold-denominator $THRESHOLD_DENOMINATOR \
--governance-authority $GOVERNANCE_AUTHORITY \
--atms-kind plain-ecdsa-secp256k1 \
--d-parameter-permissioned-candidates-count 3 \
--d-parameter-registered-candidates-count 2 \
--payment-signing-key-file /keys/funded_address.skey
Expand Down Expand Up @@ -147,7 +144,6 @@ bob_grandpa_vkey=$(cat /partner-chains-nodes/partner-chains-node-2/keys/grandpa.
--threshold-numerator $THRESHOLD_NUMERATOR \
--threshold-denominator $THRESHOLD_DENOMINATOR \
--sidechain-id 0 \
--atms-kind plain-ecdsa-secp256k1 \
--payment-signing-key-file /keys/funded_address.skey

if [ $? -eq 0 ]; then
Expand Down Expand Up @@ -189,7 +185,6 @@ dave_grandpa_vkey=$(cat /partner-chains-nodes/partner-chains-node-4/keys/grandpa
--sidechain-id 0 \
--genesis-committee-hash-utxo $GENESIS_COMMITTEE_UTXO \
--governance-authority $GOVERNANCE_AUTHORITY \
--atms-kind plain-ecdsa-secp256k1 \
--threshold-numerator 2 \
--threshold-denominator 3 \
--spo-public-key $dave_spo_public_key \
Expand Down
29 changes: 13 additions & 16 deletions dev/local-environment/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ KUPO_IMAGE="cardanosolutions/kupo:v2.9.0"
OGMIOS_IMAGE="cardanosolutions/ogmios:v6.8.0"
POSTGRES_IMAGE="postgres:15.3"
SIDECHAIN_MAIN_CLI_IMAGE="node:22-bookworm"
PC_CONTRACTS_CLI_ZIP_URL="https://github.com/input-output-hk/partner-chains-smart-contracts/releases/download/v6.1.0/trustless-sidechain-cli-6.1.0-x86_64-linux.zip"
PC_CONTRACTS_CLI_ZIP_URL="https://github.com/input-output-hk/partner-chains-smart-contracts/releases/download/v6.2.0/pc-contracts-cli-v6.2.0.zip"
PARTNER_CHAINS_NODE_URL="https://github.com/input-output-hk/partner-chains/releases/download/v1.2.0/partner-chains-node-v1.2.0-x86_64-linux"
PARTNER_CHAINS_CLI_URL="https://github.com/input-output-hk/partner-chains/releases/download/v1.2.0/partner-chains-cli-v1.2.0-x86_64-linux"

display_banner() {
cat <<'EOF'
___ _ ___ _ _
|_ _|_ _ _ __ _ _| |_ / _ \ _ _| |_ _ __ _ _| |_
| || ' \| '_ \ || | _| | (_) | || | _| '_ \ || | _|
|___|_||_| .__/\_,_|\__|__\___/ \_,_|\__| .__/\_,_|\__| _
| | ___|_|_ __ _| | | __|_ ___ _(_)_ _|_|_ _ _ _ __ ___ _ _| |_
___ _ ___ _ _
|_ _|_ _ _ __ _ _| |_ / _ \ _ _| |_ _ __ _ _| |_
| || ' \| '_ \ || | _| | (_) | || | _| '_ \ || | _|
|___|_||_| .__/\_,_|\__|__\___/ \_,_|\__| .__/\_,_|\__| _
| | ___|_|_ __ _| | | __|_ ___ _(_)_ _|_|_ _ _ _ __ ___ _ _| |_
| |__/ _ \/ _/ _` | | | _|| ' \ V / | '_/ _ \ ' \| ' \/ -_) ' \ _|
|____\___/\__\__,_|_| |___|_||_\_/|_|_| \___/_||_|_|_|_\___|_||_\__|

EOF
}

detect_os() {
local mode=$1
local mode=$1

unameOut="$(uname -s)"
archOut="$(uname -m)"
Expand Down Expand Up @@ -53,7 +53,7 @@ detect_os() {
}

backup_files() {
local mode=$1
local mode=$1

if [ -f ".env" ]; then
if [ "$mode" == "interactive" ]; then
Expand Down Expand Up @@ -149,7 +149,7 @@ configure_kupo() {
}

configure_artifact_overrides() {
local mode=$1
local mode=$1

if [ "$mode" == "interactive" ]; then
echo "===== ARTIFACT OVERRIDE CONFIGURATION ========"
Expand Down Expand Up @@ -311,7 +311,7 @@ configure_postgres() {
}

configure_env() {
local mode=$1
local mode=$1

if [ "$mode" == "interactive" ]; then
echo "===== ENV FILE CREATION ============"
Expand Down Expand Up @@ -394,7 +394,7 @@ choose_deployment_option() {
}

create_docker_compose() {
local mode=$1
local mode=$1

if [ "$mode" == "interactive" ]; then
echo "===== DOCKER-COMPOSE.YML CREATION ============"
Expand Down Expand Up @@ -532,7 +532,7 @@ main() {
configure_kupo
configure_artifact_overrides "interactive"
resource_limits_setup

if [ "$deployment_option" -eq 4 ]; then
choose_deployment_option
fi
Expand All @@ -548,6 +548,3 @@ main() {
}

main "$@"



7 changes: 4 additions & 3 deletions flake.lock

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

3 changes: 1 addition & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

# Partner Chains deps
smart-contracts = {
# Update to desired tag when ready for release
url = "github:input-output-hk/partner-chains-smart-contracts";
url = "github:input-output-hk/partner-chains-smart-contracts/v6.2.0";
flake = false;
};
cardano-node = {
Expand Down
Loading