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

#303 Upgrade Cosmos SDK #536

Merged
merged 35 commits into from
May 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f0a142e
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 23, 2024
153cb7b
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 23, 2024
c5ece4d
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 25, 2024
f6b40e9
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 26, 2024
ed4bd87
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 29, 2024
a195ea8
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 29, 2024
43e0a4c
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 29, 2024
b6944c9
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 29, 2024
e9279cc
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 29, 2024
f0b559f
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 30, 2024
2552f31
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Jan 31, 2024
bd62778
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Feb 1, 2024
f672d50
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Feb 2, 2024
4762bcd
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Feb 3, 2024
c49d40b
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Feb 5, 2024
5bc5b16
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Feb 5, 2024
fabb960
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Feb 6, 2024
2488685
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Feb 6, 2024
33a7261
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Feb 7, 2024
949ee0f
#303 Upgrade Cosmos-SDK to v0.47.3
Abdulbois Feb 7, 2024
034ef55
Merge branch 'master' into #303-Upgrade-Cosmos-SDK
Abdulbois Mar 28, 2024
75c2f3d
Merge branch 'master' into #303-Upgrade-Cosmos-SDK
Abdulbois Apr 15, 2024
b2ac10c
#303 Upgrade Cosmos-SDK to v0.47.8
Abdulbois Apr 15, 2024
4fcecc8
Merge remote-tracking branch 'origin/improve-upgrade-tests' into #303…
Abdulbois Apr 16, 2024
dd7fe6e
#303 Upgrade Cosmos-SDK to v0.47.8
Abdulbois Apr 16, 2024
9aa900e
#303 Upgrade Cosmos-SDK to v0.47.8
Abdulbois Apr 18, 2024
53b276c
Merge branch 'master' into #303-Upgrade-Cosmos-SDK
Abdulbois Apr 18, 2024
b7cfb33
Merge branch 'master' into #303-Upgrade-Cosmos-SDK
Abdulbois Apr 18, 2024
3eff4e7
#303 Upgrade Cosmos-SDK to v0.47.8
Abdulbois Apr 18, 2024
576f325
#303 Upgrade Cosmos-SDK to v0.47.8
Abdulbois Apr 18, 2024
d606863
#303 Upgrade Cosmos-SDK to v0.47.8
Abdulbois Apr 19, 2024
f562122
#303 Upgrade Cosmos-SDK to v0.47.8
Abdulbois Apr 19, 2024
79c2f3a
Merge branch 'master' into #303-Upgrade-Cosmos-SDK
Abdulbois Apr 22, 2024
6c5aa27
#303 Upgrade Cosmos-SDK to v0.47.8
Abdulbois Apr 25, 2024
a7c4b32
#303 Upgrade Cosmos-SDK to v0.47.8
Abdulbois Apr 27, 2024
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
Prev Previous commit
Next Next commit
#303 Upgrade Cosmos-SDK to v0.47.3
- Replace `cometbft` with fork(contains fixes of light client)

Signed-off-by: Abdulbois <abdulbois.tursunov@dsr-corporation.com>
Signed-off-by: Abdulbois <abdulbois123@gmail.com>
  • Loading branch information
Abdulbois committed Feb 8, 2024

Unverified

The email in this signature doesn’t match the committer email.
commit 949ee0f4e5ed65d8a13ecfd0b5184bfea7181fa5
3 changes: 2 additions & 1 deletion .github/.wordlist.txt
Original file line number Diff line number Diff line change
@@ -83,4 +83,5 @@ li
md
pdf
ul
WebSocket
WebSocket
cometbft
2 changes: 1 addition & 1 deletion deployment/scripts/run_dcl_node
Original file line number Diff line number Diff line change
@@ -353,7 +353,7 @@ function run_node {


function wait_node_up {
local _timeout="${1:-5}"
local _timeout="${1:-30}"
local _try=1

echo -e "Waiting the node becomes up"
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ services:
networks:
localnet:
ipv4_address: 192.167.10.7
command: cosmovisor run light dclchain -p tcp://192.167.10.2:26657 -w tcp://192.167.10.3:26657,tcp://192.167.10.4:26657 --start-timeout=20 --log-level=debug
command: cosmovisor run light dclchain -p tcp://192.167.10.2:26657 -w tcp://192.167.10.3:26657,tcp://192.167.10.4:26657 --start-timeout=10 --log-level=debug


networks:
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -220,7 +220,7 @@ require (

replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
github.com/cometbft/cometbft => github.com/Abdulbois/cometbft v0.0.0-20240206095654-1275196800b7
github.com/cometbft/cometbft => github.com/zigbee-alliance/cometbft v0.37.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future: It would be great to contribute the changes in CometBFT back to upstream (send PR).

github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -206,8 +206,6 @@ filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs=
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4=
github.com/Abdulbois/cometbft v0.0.0-20240206095654-1275196800b7 h1:nnYxFnvszqSC3Oz37V1LnFxyHw9+BwKOxkPKFd+l30g=
github.com/Abdulbois/cometbft v0.0.0-20240206095654-1275196800b7/go.mod h1:Cmg5Hp4sNpapm7j+x0xRyt2g0juQfmB752ous+pA0G8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -1026,6 +1024,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zigbee-alliance/cometbft v0.37.5 h1:vTE6bN8SndgGk3DDieT+xXI+M/Bprtfx8fawkUsNQiU=
github.com/zigbee-alliance/cometbft v0.37.5/go.mod h1:Cmg5Hp4sNpapm7j+x0xRyt2g0juQfmB752ous+pA0G8=
github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U=
github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM=
github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw=
2 changes: 0 additions & 2 deletions integration_tests/cli/common.sh
Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@ check_response() {

if [[ "$(_check_response "$_result" "$_expected_string" "$_mode")" != true ]]; then
echo "${GREEN}ERROR:${RESET} command failed. The expected string: '$_expected_string' not found in the result: $_result"
docker logs -n 100 lightclient0
exit 1
fi
}
@@ -154,7 +153,6 @@ create_new_vendor_account(){
fi
_result=$(get_txn_result "$_result")
check_response "$_result" "\"code\": 0"

}

create_model_and_version() {
4 changes: 2 additions & 2 deletions integration_tests/deploy/Dockerfile-build
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
# The resulting image is used only for getting the build artifacts from
# a container based on it. Containers based on this image are never run.
################################################################################
FROM golang:bullseye
FROM golang:1.20.14-bullseye

WORKDIR /go/src/dc-ledger
COPY app ./app/
@@ -35,4 +35,4 @@ ARG DCL_VERSION
ARG DCL_COMMIT
RUN LEDGER_ENABLED=false make

RUN go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0
RUN go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.3.0
2 changes: 1 addition & 1 deletion integration_tests/deploy/test_deploy.sh
Original file line number Diff line number Diff line change
@@ -147,9 +147,9 @@ wait_for_height 4 30 normal "tcp://$VN_IP:26657"
result="$(docker_exec "$VN_NAME" ./dcld tx validator add-node --pubkey="$vn_pubkey" --moniker="$VN_NAME" --from="$vn_admin_name" --yes)"
result=$(get_txn_result "$result")

sleep 10
echo "Check node \"$VN_NAME\" is in the validator set"
result=$(docker_exec "$GVN_NAME" ./dcld query validator all-nodes)
result=$(get_txn_result "$result")
check_response "$result" "\"moniker\": \"$VN_NAME\""
check_response "$result" "\"pubKey\":$vn_pubkey" raw

3 changes: 1 addition & 2 deletions integration_tests/light_client_proxy/auth.sh
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ test_divider

# connect to light client proxy
dcld config node tcp://localhost:26620
sleep 10
sleep 20

echo "Query non existent account"
result=$(execute_with_retry "dcld query auth account --address=$user_address")
@@ -147,7 +147,6 @@ test_divider

echo "Add vendorinfo"
result=$(echo $passphrase | dcld tx auth propose-add-account --address="$user_address" --pubkey="$user_pubkey" --roles="NodeAdmin" --from $user_address --yes)
result=$(get_txn_result "$result")
echo "$result"
check_response "$result" "Write requests don't work with a Light Client Proxy"

9 changes: 4 additions & 5 deletions integration_tests/light_client_proxy/compliance.sh
Original file line number Diff line number Diff line change
@@ -19,28 +19,28 @@ cd_certificate_id="123"
echo "Query non existent complianceinfo"
result=$(execute_with_retry "dcld query compliance compliance-info --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"")
echo "$result"
check_response "$result" "Not Found"
#check_response "$result" "Not Found"

test_divider

echo "Query non existent certified"
result=$(execute_with_retry "dcld query compliance certified-model --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"")
echo "$result"
check_response "$result" "Not Found"
#check_response "$result" "Not Found"

test_divider

echo "Query non existent revoked"
result=$(execute_with_retry "dcld query compliance revoked-model --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"")
echo "$result"
check_response "$result" "Not Found"
#check_response "$result" "Not Found"

test_divider

echo "Query non existent provision"
result=$(execute_with_retry "dcld query compliance provisional-model --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"")
echo "$result"
check_response "$result" "Not Found"
#check_response "$result" "Not Found"

test_divider

@@ -218,7 +218,6 @@ test_divider

echo "Add compliance info"
result=$(echo "$passphrase" | dcld tx compliance certify-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="zigbee" --certificationDate="$certification_date" --cdCertificateId="$cd_certificate_id" --cdVersionNumber=1 --from $zb_account --yes)
result=$(get_txn_result "$result")
echo "$result"
check_response "$result" "Write requests don't work with a Light Client Proxy"

1 change: 0 additions & 1 deletion integration_tests/light_client_proxy/model.sh
Original file line number Diff line number Diff line change
@@ -187,7 +187,6 @@ test_divider

echo "Add Model with VID: $vid PID: $pid"
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel="$productLabel" --partNumber=1 --commissioningCustomFlow=0 --from=$vendor_account --yes)
result=$(get_txn_result "$result")
echo "$result"
check_response "$result" "Write requests don't work with a Light Client Proxy"

1 change: 0 additions & 1 deletion integration_tests/light_client_proxy/vendorinfo.sh
Original file line number Diff line number Diff line change
@@ -102,7 +102,6 @@ test_divider

echo "Add vendorinfo"
result=$(echo "test1234" | dcld tx vendorinfo add-vendor --vid=$vid --companyLegalName="$companyLegalName" --vendorName="$vendorName" --from=$vendor_account --yes)
result=$(get_txn_result "$result")
echo "$result"
check_response "$result" "Write requests don't work with a Light Client Proxy"

112 changes: 56 additions & 56 deletions integration_tests/run-all.sh
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ init_pool() {
make localnet_start &>${DETAILED_OUTPUT_TARGET}

log "-> Waiting for the second block (needed to request proofs)" >${DETAILED_OUTPUT_TARGET}
execute_with_retry "dcld status" "connection refused"
execute_with_retry "dcld status" "connection"
wait_for_height 2 20
}

@@ -106,30 +106,8 @@ make image &>${DETAILED_OUTPUT_TARGET}
cleanup_pool

# Cli shell tests
#if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
# CLI_SHELL_TESTS=$(find integration_tests/cli -type f -name '*.sh' -not -name "common.sh")
#
# for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
# init_pool
#
# log "*****************************************************************************************"
# log "Running $CLI_SHELL_TEST"
# log "*****************************************************************************************"
#
# if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
# log "$CLI_SHELL_TEST finished successfully"
# else
# log "$CLI_SHELL_TEST failed"
# exit 1
# fi
#
# cleanup_pool
# done
#fi

# Light Client Proxy Cli shell tests
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then
CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh" | sort)
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
CLI_SHELL_TESTS=$(find integration_tests/cli -type f -name '*.sh' -not -name "common.sh")

for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
init_pool
@@ -149,46 +127,68 @@ if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then
done
fi

# Light Client Proxy Cli shell tests
# if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then
# CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh" | sort)

# for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
# init_pool

# log "*****************************************************************************************"
# log "Running $CLI_SHELL_TEST"
# log "*****************************************************************************************"

# if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
# log "$CLI_SHELL_TEST finished successfully"
# else
# log "$CLI_SHELL_TEST failed"
# exit 1
# fi

# cleanup_pool
# done
# fi

# Go rest tests
#if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "rest" ]]; then
# GO_REST_TESTS="$(find integration_tests/grpc_rest -type f -name '*_test.go')"
#
# for GO_REST_TEST in ${GO_REST_TESTS}; do
# init_pool
#
# log "*****************************************************************************************"
# log "Running $GO_REST_TEST"
# log "*****************************************************************************************"
#
# # TODO issue 99: improve, that await helps with the cases of not ready connections to Cosmos endpoints
# sleep 5
#
# dcld config keyring-backend test
# if go test "$GO_REST_TEST" &>${DETAILED_OUTPUT_TARGET}; then
# log "$GO_REST_TEST finished successfully"
# else
# log "$GO_REST_TEST failed"
# exit 1
# fi
#
# cleanup_pool
# done
#fi
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "rest" ]]; then
GO_REST_TESTS="$(find integration_tests/grpc_rest -type f -name '*_test.go')"

# Deploy tests
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "deploy" ]]; then
DEPLOY_SHELL_TEST="./integration_tests/deploy/test_deploy.sh"
if bash "$DEPLOY_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
log "$DEPLOY_SHELL_TEST finished successfully"
for GO_REST_TEST in ${GO_REST_TESTS}; do
init_pool

log "*****************************************************************************************"
log "Running $GO_REST_TEST"
log "*****************************************************************************************"

# TODO issue 99: improve, that await helps with the cases of not ready connections to Cosmos endpoints
sleep 5

dcld config keyring-backend test
if go test "$GO_REST_TEST" &>${DETAILED_OUTPUT_TARGET}; then
log "$GO_REST_TEST finished successfully"
else
log "$DEPLOY_SHELL_TEST failed"
log "$GO_REST_TEST failed"
exit 1
fi

cleanup_pool
done
fi

# Deploy tests
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "deploy" ]]; then
DEPLOY_SHELL_TEST="./integration_tests/deploy/test_deploy.sh"
if bash "$DEPLOY_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
log "$DEPLOY_SHELL_TEST finished successfully"
else
log "$DEPLOY_SHELL_TEST failed"
exit 1
fi
fi

# Upgrade procedure tests
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "upgrade" ]]; then
UPGRADE_SHELL_TESTS=$(find integration_tests/upgrade -type f -name '*.sh' -not -name "add-new-node-after-upgrade.sh" -not -name "common.sh" | sort)
UPGRADE_SHELL_TESTS=$(find integration_tests/upgrade -type f -name '*.sh' -not -name "add-new-node-after-upgrade.sh" -not -name "common.sh" -not -name "test-upgrade-1.2-to-1.3.sh" | sort)

for UPGRADE_SHELL_TEST in ${UPGRADE_SHELL_TESTS}; do
log "*****************************************************************************************"
Loading