diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab8f1f7de..beec4c9eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -212,7 +212,8 @@ jobs: latest=auto tags: | type=semver,pattern={{version}},value=${{ needs.release-guard.outputs.RELEASE_VERSION }} - type=raw,value=production-latest + type=raw,value=production-latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }} + type=raw,value=staging-latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-') }} type=sha,format=long labels: | org.opencontainers.image.vendor="Cheqd Foundation Limited" diff --git a/networks/mainnet/upgrades/upgrade-v4-minor.json b/networks/mainnet/upgrades/upgrade-v4-minor.json new file mode 100644 index 000000000..c15e8b0f7 --- /dev/null +++ b/networks/mainnet/upgrades/upgrade-v4-minor.json @@ -0,0 +1,6 @@ +{ + "binaries": { + "linux/amd64": "https://github.com/cheqd/cheqd-node/releases/download/v4.1.6/cheqd-noded-4.1.6-linux-amd64.tar.gz?checksum=sha256:a1a967caba0cc9e06dc86378bdd7126e6fb91ee0080117f4c1b7acd1cd525842", + "linux/arm64": "https://github.com/cheqd/cheqd-node/releases/download/v4.1.6/cheqd-noded-4.1.6-linux-arm64.tar.gz?checksum=sha256:88232d36ecb9216ee128121784c966efe69841e4e98368f201e6b5d07f93dd11" + } +} diff --git a/networks/testnet/upgrades/upgrade-v4-minor.json b/networks/testnet/upgrades/upgrade-v4-minor.json new file mode 100644 index 000000000..c15e8b0f7 --- /dev/null +++ b/networks/testnet/upgrades/upgrade-v4-minor.json @@ -0,0 +1,6 @@ +{ + "binaries": { + "linux/amd64": "https://github.com/cheqd/cheqd-node/releases/download/v4.1.6/cheqd-noded-4.1.6-linux-amd64.tar.gz?checksum=sha256:a1a967caba0cc9e06dc86378bdd7126e6fb91ee0080117f4c1b7acd1cd525842", + "linux/arm64": "https://github.com/cheqd/cheqd-node/releases/download/v4.1.6/cheqd-noded-4.1.6-linux-arm64.tar.gz?checksum=sha256:88232d36ecb9216ee128121784c966efe69841e4e98368f201e6b5d07f93dd11" + } +} diff --git a/tests/fee-abs/fee-abs-test.sh b/tests/fee-abs/fee-abs-test.sh index a95f0b469..f927b2f06 100755 --- a/tests/fee-abs/fee-abs-test.sh +++ b/tests/fee-abs/fee-abs-test.sh @@ -81,7 +81,7 @@ docker compose exec -d osmosis osmosisd start info "Waiting for chains" # TODO: Get rid of this -sleep 20 +sleep 10 info "Checking statuses" CHEQD_STATUS=$(docker compose exec cheqd cheqd-noded status 2>&1) diff --git a/tests/integration/cli_diddoc_pricing_negative_test.go b/tests/integration/cli_diddoc_pricing_negative_test.go index ec9e208fd..abab540d5 100644 --- a/tests/integration/cli_diddoc_pricing_negative_test.go +++ b/tests/integration/cli_diddoc_pricing_negative_test.go @@ -45,6 +45,15 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { var payload didcli.DIDDocument var signInputs []didcli.SignInput + makeLowerFee := func(required sdk.Coin) sdk.Coin { + lower := required.Amount.Sub(sdkmath.NewInt(1_000_000_000)) // subtract 1 CHEQ + if lower.IsNegative() { + lower = sdkmath.ZeroInt() + } + + return sdk.NewCoin(required.Denom, lower) + } + BeforeEach(func() { tmpDir = GinkgoT().TempDir() @@ -151,7 +160,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { feeInNCheq, err := cli.ResolveFeeFromParams(feeParams.CreateDid, useMin) Expect(err).To(BeNil()) - lowerTax := sdk.NewCoin(feeInNCheq.Denom, sdkmath.NewInt(feeInNCheq.Amount.Int64()-10000000000)) + lowerTax := makeLowerFee(feeInNCheq) res, err := cli.CreateDidDoc(tmpDir, payload, signInputs, "", testdata.BASE_ACCOUNT_4, helpers.GenerateFees(lowerTax.String())) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(1)) @@ -185,7 +194,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { useMin = true feeInNCheq, err = cli.ResolveFeeFromParams(feeParams.UpdateDid, useMin) Expect(err).To(BeNil()) - lowerTax := sdk.NewCoin(feeInNCheq.Denom, sdkmath.NewInt(feeInNCheq.Amount.Int64()-10000000000)) + lowerTax := makeLowerFee(feeInNCheq) res, err = cli.UpdateDidDoc(tmpDir, payload2, signInputs, "", testdata.BASE_ACCOUNT_5, helpers.GenerateFees(lowerTax.String())) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(1)) @@ -209,7 +218,7 @@ var _ = Describe("cheqd cli - negative diddoc pricing", func() { useMin = true feeInNCheq, err = cli.ResolveFeeFromParams(feeParams.DeactivateDid, useMin) Expect(err).To(BeNil()) - lowerTax := sdk.NewCoin(feeInNCheq.Denom, sdkmath.NewInt(feeInNCheq.Amount.Int64()-1000000000)) + lowerTax := makeLowerFee(feeInNCheq) res, err = cli.DeactivateDidDoc(tmpDir, payload2, signInputs, "", testdata.BASE_ACCOUNT_5, helpers.GenerateFees(lowerTax.String())) Expect(err).To(BeNil()) Expect(res.Code).To(BeEquivalentTo(1)) diff --git a/tests/integration/cli_resource_pricing_negative_test.go b/tests/integration/cli_resource_pricing_negative_test.go index fc9248d84..d02b28a87 100644 --- a/tests/integration/cli_resource_pricing_negative_test.go +++ b/tests/integration/cli_resource_pricing_negative_test.go @@ -187,7 +187,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { useMin := true tax, err := cli.ResolveFeeFromParams(resourceFeeParams.Json, useMin) Expect(err).To(BeNil()) - lowerTax := sdk.NewCoin(tax.Denom, sdkmath.NewInt(tax.Amount.Int64()-1000000000)) + lowerAmount := sdkmath.MaxInt(sdkmath.NewInt(1), sdkmath.NewInt(tax.Amount.Int64()-1000000000)) + lowerTax := sdk.NewCoin(tax.Denom, lowerAmount) res, err := cli.CreateResource(tmpDir, resourcetypes.MsgCreateResourcePayload{ CollectionId: collectionID, Id: resourceID, @@ -212,7 +213,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { useMin := true tax, err := cli.ResolveFeeFromParams(resourceFeeParams.Image, useMin) Expect(err).To(BeNil()) - lowerTax := sdk.NewCoin(tax.Denom, sdkmath.NewInt(tax.Amount.Int64()-1000000000)) + lowerAmount := sdkmath.MaxInt(sdkmath.NewInt(1), sdkmath.NewInt(tax.Amount.Int64()-1000000000)) + lowerTax := sdk.NewCoin(tax.Denom, lowerAmount) res, err := cli.CreateResource(tmpDir, resourcetypes.MsgCreateResourcePayload{ CollectionId: collectionID, @@ -238,7 +240,8 @@ var _ = Describe("cheqd cli - negative resource pricing", func() { useMin := true tax, err := cli.ResolveFeeFromParams(resourceFeeParams.Default, useMin) Expect(err).To(BeNil()) - lowerTax := sdk.NewCoin(tax.Denom, sdkmath.NewInt(tax.Amount.Int64()-1000000000)) + lowerAmount := sdkmath.MaxInt(sdkmath.NewInt(1), sdkmath.NewInt(tax.Amount.Int64()-1000000000)) + lowerTax := sdk.NewCoin(tax.Denom, lowerAmount) res, err := cli.CreateResource(tmpDir, resourcetypes.MsgCreateResourcePayload{ CollectionId: collectionID, Id: resourceID, diff --git a/tests/integration/helpers/event.go b/tests/integration/helpers/event.go index 1ffc7629f..7829316ed 100644 --- a/tests/integration/helpers/event.go +++ b/tests/integration/helpers/event.go @@ -16,7 +16,7 @@ type HumanReadableEvent struct { } func ReadableEvents(events []types.Event) []HumanReadableEvent { - readableEvents := make([]HumanReadableEvent, len(events)) + readableEvents := make([]HumanReadableEvent, 0, len(events)) for _, event := range events { readableAttributes := make([]HumanReadableEventAttribute, len(event.Attributes)) for i, attribute := range event.Attributes { diff --git a/tests/upgrade/integration/v4/param_change_proposal_test.go b/tests/upgrade/integration/v4/param_change_proposal_test.go index 34ea1739e..b2ea25ecb 100644 --- a/tests/upgrade/integration/v4/param_change_proposal_test.go +++ b/tests/upgrade/integration/v4/param_change_proposal_test.go @@ -43,7 +43,7 @@ var _ = Describe("Upgrade - Fee parameter change proposal", func() { Expect(err).To(BeNil()) By("waiting for the proposal to be included in a block") - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*3) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*1) Expect(err).To(BeNil()) }) @@ -81,7 +81,7 @@ var _ = Describe("Upgrade - Fee parameter change proposal", func() { Expect(err).To(BeNil()) By("waiting for the proposal to pass") - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*2) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*1) Expect(err).To(BeNil()) }) @@ -129,7 +129,7 @@ var _ = Describe("Upgrade - Fee parameter change proposal", func() { Expect(err).To(BeNil()) By("waiting for the proposal to be included in a block") - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*2) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+2, cli.VotingPeriod*1) Expect(err).To(BeNil()) }) diff --git a/tests/upgrade/integration/v4/post_test.go b/tests/upgrade/integration/v4/post_test.go index 960aac4c3..8f10f7f97 100644 --- a/tests/upgrade/integration/v4/post_test.go +++ b/tests/upgrade/integration/v4/post_test.go @@ -51,7 +51,7 @@ var _ = Describe("Upgrade - Post", func() { Expect(err).To(BeNil()) By("waiting for 10 blocks to be produced on top, after the upgrade") - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*6) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*2) Expect(err).To(BeNil()) }) @@ -87,7 +87,7 @@ var _ = Describe("Upgrade - Post", func() { Expect(err).To(BeNil()) By("waiting for 10 blocks to be produced on top") - err = cli.WaitForChainHeight(cli.Validator2, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*8) + err = cli.WaitForChainHeight(cli.Validator2, cli.CliBinaryName, currentHeight+10, cli.VotingPeriod*2) Expect(err).To(BeNil()) }) diff --git a/tests/upgrade/integration/v4/pre_test.go b/tests/upgrade/integration/v4/pre_test.go index ba3da8a6b..f4af72b10 100644 --- a/tests/upgrade/integration/v4/pre_test.go +++ b/tests/upgrade/integration/v4/pre_test.go @@ -39,7 +39,7 @@ var _ = Describe("Upgrade - Pre", func() { Context("Before a software upgrade execution is initiated", func() { It("should wait for chain to bootstrap", func() { By("pinging the node status until the voting end height is reached") - err := cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, cli.BootstrapHeight, cli.BootstrapPeriod+20) + err := cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, cli.BootstrapHeight, cli.BootstrapPeriod+5) Expect(err).To(BeNil()) }) @@ -67,7 +67,7 @@ var _ = Describe("Upgrade - Pre", func() { By("waiting for an additional set of blocks to be produced") height, err := cli.GetCurrentBlockHeight(cli.Validator0, cli.CliBinaryName) Expect(err).To(BeNil()) - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*6) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*2) Expect(err).To(BeNil()) } }) @@ -107,7 +107,7 @@ var _ = Describe("Upgrade - Pre", func() { By("waiting for an additional set of blocks to be produced") height, err := cli.GetCurrentBlockHeight(cli.Validator0, cli.CliBinaryName) Expect(err).To(BeNil()) - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*6) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, height+5, cli.VotingPeriod*2) Expect(err).To(BeNil()) } }) @@ -137,7 +137,7 @@ var _ = Describe("Upgrade - Pre", func() { Expect(err).To(BeNil()) By("waiting for 10 blocks to be produced on top, after the upgrade") - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*3) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*1) Expect(err).To(BeNil()) }) @@ -154,7 +154,7 @@ var _ = Describe("Upgrade - Pre", func() { Expect(err).To(BeNil()) By("waiting for the proposal to be included in a block") - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*3) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+3, cli.VotingPeriod*1) Expect(err).To(BeNil()) }) @@ -171,7 +171,7 @@ var _ = Describe("Upgrade - Pre", func() { Expect(err).To(BeNil()) By("waiting for 10 blocks to be produced on top, after the upgrade") - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*2) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*1) Expect(err).To(BeNil()) }) @@ -188,7 +188,7 @@ var _ = Describe("Upgrade - Pre", func() { Expect(err).To(BeNil()) By("waiting for 10 blocks to be produced on top, after the upgrade") - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*2) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*1) Expect(err).To(BeNil()) }) @@ -205,7 +205,7 @@ var _ = Describe("Upgrade - Pre", func() { Expect(err).To(BeNil()) By("waiting for 10 blocks to be produced on top, after the upgrade") - err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*2) + err = cli.WaitForChainHeight(cli.Validator0, cli.CliBinaryName, currentHeight+1, cli.VotingPeriod*1) Expect(err).To(BeNil()) })