From cf765db2d490c1fd340916f2a3b88896983b147b Mon Sep 17 00:00:00 2001 From: swelf Date: Mon, 11 Nov 2024 18:41:29 +0300 Subject: [PATCH 1/9] wip --- package.json | 6 +- src/helpers/dao.ts | 4 +- .../run_in_band/chain_manager.test.ts | 209 +++++++++++++++++- yarn.lock | 8 +- 4 files changed, 218 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b1d32728..cadfaf10 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,8 @@ "@cosmjs/cosmwasm-stargate": "^0.32.4", "@cosmjs/stargate": "0.32.4", "@cosmjs/tendermint-rpc": "^0.32.4", - "@neutron-org/neutronjs": "https://github.com/neutron-org/neutronjs.git#7f45328320b53b4fa2b572bc25bb96bf80260181", - "@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#39dd19b17165ef206b40018ff437054210c2bdbc", + "@neutron-org/neutronjs": "https://github.com/neutron-org/neutronjs.git#8ca4875e81fc7cdfffab513bb410ca7cff09db78", + "@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#27317fc2658f2e5056ba900b01db7d749508d647", "@types/lodash": "^4.14.182", "axios": "1.6.0", "commander": "^10.0.0", @@ -91,4 +91,4 @@ "engines": { "node": ">=20.0" } -} +} \ No newline at end of file diff --git a/src/helpers/dao.ts b/src/helpers/dao.ts index 7a8ff3ec..1c63306d 100644 --- a/src/helpers/dao.ts +++ b/src/helpers/dao.ts @@ -67,7 +67,7 @@ export const deploySubdao = async ( }, }, }, - close_proposal_on_execution_failure: closeProposalOnExecutionFailure, + close_proposal_on_execution_failure: false, }; const proposalModuleInstantiateInfo = { code_id: proposeCodeId, @@ -164,7 +164,7 @@ export const setupSubDaoTimelockSet = async ( mockMainDao ? user : daoContracts.core.address, daoContracts.proposals.overrule.pre_propose.address, securityDaoAddr, - closeProposalOnExecutionFailure, + false, ); const mainDaoMember = new DaoMember( diff --git a/src/testcases/run_in_band/chain_manager.test.ts b/src/testcases/run_in_band/chain_manager.test.ts index afc70de1..93dd5de0 100644 --- a/src/testcases/run_in_band/chain_manager.test.ts +++ b/src/testcases/run_in_band/chain_manager.test.ts @@ -13,6 +13,8 @@ import { updateTokenfactoryParamsProposal, AddSchedule, RemoveSchedule, + updateGlobalFeeParamsProposal, + updateConsumerParamsProposal, } from '@neutron-org/neutronjsplus/dist/proposal'; import { LocalState } from '../../helpers/local_state'; import { RunnerTestSuite, inject } from 'vitest'; @@ -23,6 +25,9 @@ import { QueryClientImpl as AdminQueryClient } from '@neutron-org/neutronjs/cosm import { QueryClientImpl as TokenfactoryQueryClient } from '@neutron-org/neutronjs/osmosis/tokenfactory/v1beta1/query.rpc.Query'; import { QueryClientImpl as UpgradeQueryClient } from '@neutron-org/neutronjs/cosmos/upgrade/v1beta1/query.rpc.Query'; import { QueryClientImpl as DexQueryClient } from '@neutron-org/neutronjs/neutron/dex/query.rpc.Query'; +import { QueryClientImpl as DynamicfeesQueryClient } from '@neutron-org/neutronjs/neutron/dynamicfees/v1/query.rpc.Query'; +import { QueryClientImpl as GlobalfeeQueryClient } from '@neutron-org/neutronjs/gaia/globalfee/v1beta1/query.rpc.Query'; +import { QueryClientImpl as CCVQueryClient } from '@neutron-org/neutronjs/interchain_security/ccv/consumer/v1/query.rpc.Query'; import { SigningNeutronClient } from '../../helpers/signing_neutron_client'; import config from '../../config.json'; import { Wallet } from '../../helpers/wallet'; @@ -39,6 +44,9 @@ describe('Neutron / Chain Manager', () => { let cronQuerier: CronQueryClient; let tokenfactoryQuerier: TokenfactoryQueryClient; let dexQuerier: DexQueryClient; + let dynamicfeesQuerier: DynamicfeesQueryClient; + let globalfeeQuerier: GlobalfeeQueryClient; + let ccvQuerier: CCVQueryClient; let upgradeQuerier: UpgradeQueryClient; let chainManagerAddress: string; @@ -73,7 +81,7 @@ describe('Neutron / Chain Manager', () => { neutronClient, mainDao.contracts.core.address, securityDaoAddr, - true, + false, ); subdaoMember1 = new DaoMember( @@ -97,6 +105,9 @@ describe('Neutron / Chain Manager', () => { cronQuerier = new CronQueryClient(neutronRpcClient); dexQuerier = new DexQueryClient(neutronRpcClient); upgradeQuerier = new UpgradeQueryClient(neutronRpcClient); + dynamicfeesQuerier = new DynamicfeesQueryClient(neutronRpcClient); + globalfeeQuerier = new GlobalfeeQueryClient(neutronRpcClient); + ccvQuerier = new CCVQueryClient(neutronRpcClient); }); // We need to do this because the real main dao has a super long voting period. @@ -205,6 +216,35 @@ describe('Neutron / Chain Manager', () => { good_til_purge_allowance: true, }, }, + { + update_ccv_params_permission: { + blocks_per_distribution_transmission: true, + distribution_transmission_channel: true, + provider_fee_pool_addr_str: true, + ccv_timeout_period: true, + transfer_timeout_period: true, + consumer_redistribution_fraction: true, + historical_entries: true, + unbonding_period: true, + // !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see docs/docs/adrs/adr-015-partial-set-security.md + soft_opt_out_threshold: true, + reward_denoms: true, + provider_reward_denoms: true, + retry_delay_period: true, + }, + }, + { + update_globalfee_params_permission: { + minimum_gas_prices: true, + bypass_min_fee_msg_types: true, + max_total_bypass_min_fee_msg_gas_usage: true, + }, + }, + { + update_dynamicfees_params_permission: { + ntrn_prices: true, + }, + }, ], }, }, @@ -325,7 +365,7 @@ describe('Neutron / Chain Manager', () => { describe('ALLOW_ONLY: change DEX parameters', () => { let proposalId: number; const newParams = { - fee_tiers: [1, 2, 99], + fee_tiers: ['1', '2', '99'], paused: true, max_jits_per_block: 11, good_til_purge_allowance: 50000, @@ -365,6 +405,171 @@ describe('Neutron / Chain Manager', () => { }); }); + describe('ALLOW_ONLY: change Dynamicfees parameters', () => { + let proposalId: number; + beforeAll(async () => { + proposalId = await subdaoMember1.submitDynamicfeesChangeParamsProposal( + chainManagerAddress, + 'Proposal #2', + 'Dynamicfees update params proposal. Will pass', + '1000', + { + ntrn_prices: [{ denom: 'newdenom', amount: '0.5' }], + }, + ); + + const timelockedProp = await subdaoMember1.supportAndExecuteProposal( + proposalId, + ); + + expect(timelockedProp.id).toEqual(proposalId); + expect(timelockedProp.status).toEqual('timelocked'); + expect(timelockedProp.msgs).toHaveLength(1); + }); + + test('execute timelocked: success', async () => { + await waitSeconds(10); + + await subdaoMember1.executeTimelockedProposal(proposalId); + const timelockedProp = await subDao.getTimelockedProposal(proposalId); + expect(timelockedProp.id).toEqual(proposalId); + expect(timelockedProp.status).toEqual('executed'); + expect(timelockedProp.msgs).toHaveLength(1); + + const dynamicfeesParams = await dynamicfeesQuerier.params(); + expect(dynamicfeesParams.params.ntrnPrices).toEqual([ + { denom: 'newdenom', amount: '0.5' }, + ]); + }); + }); + + describe('ALLOW_ONLY: change Globalfee parameters', () => { + let proposalId: number; + beforeAll(async () => { + proposalId = await subdaoMember1.submitUpdateParamsGlobalfeeProposal( + chainManagerAddress, + 'Proposal #3', + 'Globalfee update params proposal. Will pass', + updateGlobalFeeParamsProposal({ + minimum_gas_prices: [{ denom: 'newdenom', amount: '0.5' }], + bypass_min_fee_msg_types: ['/gaia.globalfee.v1beta1.MsgUpdateParams'], + max_total_bypass_min_fee_msg_gas_usage: '12345', + }), + '1000', + ); + + const timelockedProp = await subdaoMember1.supportAndExecuteProposal( + proposalId, + ); + + expect(timelockedProp.id).toEqual(proposalId); + expect(timelockedProp.status).toEqual('timelocked'); + expect(timelockedProp.msgs).toHaveLength(1); + }); + + test('execute timelocked: success', async () => { + await waitSeconds(10); + + await subdaoMember1.executeTimelockedProposal(proposalId); + const timelockedProp = await subDao.getTimelockedProposal(proposalId); + expect(timelockedProp.id).toEqual(proposalId); + expect(timelockedProp.status).toEqual('executed'); + expect(timelockedProp.msgs).toHaveLength(1); + + const globalfeeParams = await globalfeeQuerier.params(); + expect(globalfeeParams.params.minimumGasPrices).toEqual([ + { denom: 'newdenom', amount: '0.5' }, + ]); + expect(globalfeeParams.params.bypassMinFeeMsgTypes).toEqual([ + '/gaia.globalfee.v1beta1.MsgUpdateParams', + ]); + expect(globalfeeParams.params.maxTotalBypassMinFeeMsgGasUsage).toEqual( + 12345n, + ); + }); + }); + + describe('ALLOW_ONLY: change ccv consumer parameters', () => { + let proposalId: number; + beforeAll(async () => { + proposalId = await subdaoMember1.submitUpdateParamsConsumerProposal( + chainManagerAddress, + 'Proposal #4', + 'Consumer update params proposal. Will pass', + updateConsumerParamsProposal({ + enabled: true, + blocks_per_distribution_transmission: 321, + distribution_transmission_channel: 'channel-23', + provider_fee_pool_addr_str: chainManagerAddress, + ccv_timeout_period: '32s', + transfer_timeout_period: '23s', + consumer_redistribution_fraction: '0.33', + historical_entries: 123, + unbonding_period: '43s', + soft_opt_out_threshold: '0.55', + reward_denoms: ['tia'], + provider_reward_denoms: ['tia'], + retry_delay_period: '43s', + }), + '1000', + ); + + const timelockedProp = await subdaoMember1.supportAndExecuteProposal( + proposalId, + ); + + expect(timelockedProp.id).toEqual(proposalId); + expect(timelockedProp.status).toEqual('timelocked'); + expect(timelockedProp.msgs).toHaveLength(1); + }); + + test('execute timelocked: success', async () => { + await waitSeconds(10); + + await subdaoMember1.executeTimelockedProposal(proposalId); + console.log( + 'subdao', + subdaoMember1.dao.contracts.proposals['single'].pre_propose.timelock + .address, + ); + const timelockedProp = await subDao.getTimelockedProposal(proposalId); + expect(timelockedProp.id).toEqual(proposalId); + expect(timelockedProp.status).toEqual('executed'); + expect(timelockedProp.msgs).toHaveLength(1); + + const ccvParams = await ccvQuerier.queryParams(); + expect(ccvParams.params.enabled).toEqual(true); + expect(ccvParams.params.blocksPerDistributionTransmission).toEqual(321n); + expect(ccvParams.params.distributionTransmissionChannel).toEqual( + 'channel-23', + ); + expect(ccvParams.params.providerFeePoolAddrStr).toEqual( + chainManagerAddress, + ); + expect(ccvParams.params.ccvTimeoutPeriod).toEqual({ + nanos: 0, + seconds: 32n, + }); + expect(ccvParams.params.transferTimeoutPeriod).toEqual({ + nanos: 0, + seconds: 23n, + }); + expect(ccvParams.params.consumerRedistributionFraction).toEqual('0.33'); + expect(ccvParams.params.historicalEntries).toEqual(123n); + expect(ccvParams.params.unbondingPeriod).toEqual({ + nanos: 0, + seconds: 43n, + }); + expect(ccvParams.params.softOptOutThreshold).toEqual('0.55'); + expect(ccvParams.params.rewardDenoms).toEqual(['tia']); + expect(ccvParams.params.providerRewardDenoms).toEqual(['tia']); + expect(ccvParams.params.retryDelayPeriod).toEqual({ + nanos: 0, + seconds: 43n, + }); + }); + }); + describe('ALLOW_ONLY: CRON add schedule / remove schedule', () => { let cronAccessClient: SigningNeutronClient; let cronAccessWallet: Wallet; diff --git a/yarn.lock b/yarn.lock index 0c07889a..704b25d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1345,9 +1345,13 @@ version "4.2.0" resolved "https://github.com/neutron-org/neutronjs.git#7f45328320b53b4fa2b572bc25bb96bf80260181" -"@neutron-org/neutronjsplus@https://github.com/neutron-org/neutronjsplus.git#39dd19b17165ef206b40018ff437054210c2bdbc": +"@neutron-org/neutronjs@https://github.com/neutron-org/neutronjs.git#8ca4875e81fc7cdfffab513bb410ca7cff09db78": + version "4.2.0" + resolved "https://github.com/neutron-org/neutronjs.git#8ca4875e81fc7cdfffab513bb410ca7cff09db78" + +"@neutron-org/neutronjsplus@https://github.com/neutron-org/neutronjsplus.git#27317fc2658f2e5056ba900b01db7d749508d647": version "0.5.0" - resolved "https://github.com/neutron-org/neutronjsplus.git#39dd19b17165ef206b40018ff437054210c2bdbc" + resolved "https://github.com/neutron-org/neutronjsplus.git#27317fc2658f2e5056ba900b01db7d749508d647" dependencies: "@cosmjs/cosmwasm-stargate" "^0.32.4" "@cosmjs/proto-signing" "^0.32.4" From 76de10a305bd2e075a69c30db9edd26ad14daca4 Mon Sep 17 00:00:00 2001 From: swelf Date: Tue, 12 Nov 2024 19:14:56 +0300 Subject: [PATCH 2/9] closeProposalOnExecutionFailure --- src/helpers/dao.ts | 4 ++-- src/testcases/run_in_band/chain_manager.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers/dao.ts b/src/helpers/dao.ts index 1c63306d..7a8ff3ec 100644 --- a/src/helpers/dao.ts +++ b/src/helpers/dao.ts @@ -67,7 +67,7 @@ export const deploySubdao = async ( }, }, }, - close_proposal_on_execution_failure: false, + close_proposal_on_execution_failure: closeProposalOnExecutionFailure, }; const proposalModuleInstantiateInfo = { code_id: proposeCodeId, @@ -164,7 +164,7 @@ export const setupSubDaoTimelockSet = async ( mockMainDao ? user : daoContracts.core.address, daoContracts.proposals.overrule.pre_propose.address, securityDaoAddr, - false, + closeProposalOnExecutionFailure, ); const mainDaoMember = new DaoMember( diff --git a/src/testcases/run_in_band/chain_manager.test.ts b/src/testcases/run_in_band/chain_manager.test.ts index 93dd5de0..7bd8d44f 100644 --- a/src/testcases/run_in_band/chain_manager.test.ts +++ b/src/testcases/run_in_band/chain_manager.test.ts @@ -81,7 +81,7 @@ describe('Neutron / Chain Manager', () => { neutronClient, mainDao.contracts.core.address, securityDaoAddr, - false, + true, ); subdaoMember1 = new DaoMember( From 93b80c18653ce15a46b7099740e34328f7279bda Mon Sep 17 00:00:00 2001 From: swelf Date: Wed, 13 Nov 2024 00:27:33 +0300 Subject: [PATCH 3/9] neutronjsplus with fixed cron proposal --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cc3486e0..3968dc2f 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@cosmjs/stargate": "0.32.4", "@cosmjs/tendermint-rpc": "^0.32.4", "@neutron-org/neutronjs": "https://github.com/neutron-org/neutronjs.git#8ca4875e81fc7cdfffab513bb410ca7cff09db78", - "@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#27317fc2658f2e5056ba900b01db7d749508d647", + "@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#6bb6dd30a21527c1d232d0152383fdcb5580e933", "@types/lodash": "^4.14.182", "axios": "1.6.0", "commander": "^10.0.0", diff --git a/yarn.lock b/yarn.lock index 704b25d3..ada877df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1349,9 +1349,9 @@ version "4.2.0" resolved "https://github.com/neutron-org/neutronjs.git#8ca4875e81fc7cdfffab513bb410ca7cff09db78" -"@neutron-org/neutronjsplus@https://github.com/neutron-org/neutronjsplus.git#27317fc2658f2e5056ba900b01db7d749508d647": +"@neutron-org/neutronjsplus@https://github.com/neutron-org/neutronjsplus.git#6bb6dd30a21527c1d232d0152383fdcb5580e933": version "0.5.0" - resolved "https://github.com/neutron-org/neutronjsplus.git#27317fc2658f2e5056ba900b01db7d749508d647" + resolved "https://github.com/neutron-org/neutronjsplus.git#6bb6dd30a21527c1d232d0152383fdcb5580e933" dependencies: "@cosmjs/cosmwasm-stargate" "^0.32.4" "@cosmjs/proto-signing" "^0.32.4" From 5ae3bc3e6ed8429af4eb674d73667e87f1a44f5d Mon Sep 17 00:00:00 2001 From: swelf Date: Wed, 13 Nov 2024 20:56:50 +0300 Subject: [PATCH 4/9] test parsing --- src/testcases/run_in_band/chain_manager.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/testcases/run_in_band/chain_manager.test.ts b/src/testcases/run_in_band/chain_manager.test.ts index 7bd8d44f..11b49b6f 100644 --- a/src/testcases/run_in_band/chain_manager.test.ts +++ b/src/testcases/run_in_band/chain_manager.test.ts @@ -330,7 +330,6 @@ describe('Neutron / Chain Manager', () => { const timelockedProp = await subdaoMember1.supportAndExecuteProposal( proposalId, ); - expect(timelockedProp.id).toEqual(proposalId); expect(timelockedProp.status).toEqual('timelocked'); expect(timelockedProp.msgs).toHaveLength(1); @@ -365,7 +364,9 @@ describe('Neutron / Chain Manager', () => { describe('ALLOW_ONLY: change DEX parameters', () => { let proposalId: number; const newParams = { - fee_tiers: ['1', '2', '99'], + // types mixed on purpose, to check contract parser. + // Numeric types in neutron-std can be deserialized from both number and string + fee_tiers: ['1', '2', 99], paused: true, max_jits_per_block: 11, good_til_purge_allowance: 50000, From 898cdb6447ee067c21981a72f22ebf85d8495099 Mon Sep 17 00:00:00 2001 From: swelf Date: Thu, 14 Nov 2024 02:38:37 +0300 Subject: [PATCH 5/9] fixed fee denom --- src/testcases/run_in_band/chain_manager.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testcases/run_in_band/chain_manager.test.ts b/src/testcases/run_in_band/chain_manager.test.ts index 11b49b6f..6fd684a4 100644 --- a/src/testcases/run_in_band/chain_manager.test.ts +++ b/src/testcases/run_in_band/chain_manager.test.ts @@ -452,7 +452,7 @@ describe('Neutron / Chain Manager', () => { 'Proposal #3', 'Globalfee update params proposal. Will pass', updateGlobalFeeParamsProposal({ - minimum_gas_prices: [{ denom: 'newdenom', amount: '0.5' }], + minimum_gas_prices: [{ denom: 'untrn', amount: '0.111' }], bypass_min_fee_msg_types: ['/gaia.globalfee.v1beta1.MsgUpdateParams'], max_total_bypass_min_fee_msg_gas_usage: '12345', }), @@ -479,7 +479,7 @@ describe('Neutron / Chain Manager', () => { const globalfeeParams = await globalfeeQuerier.params(); expect(globalfeeParams.params.minimumGasPrices).toEqual([ - { denom: 'newdenom', amount: '0.5' }, + { denom: 'untrn', amount: '0.111' }, ]); expect(globalfeeParams.params.bypassMinFeeMsgTypes).toEqual([ '/gaia.globalfee.v1beta1.MsgUpdateParams', From fc551b0417d8345befbbd3b42b4cf85503f517f3 Mon Sep 17 00:00:00 2001 From: swelf Date: Thu, 14 Nov 2024 11:19:28 +0300 Subject: [PATCH 6/9] fixed fee amount --- src/testcases/run_in_band/chain_manager.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testcases/run_in_band/chain_manager.test.ts b/src/testcases/run_in_band/chain_manager.test.ts index 6fd684a4..cfba56f4 100644 --- a/src/testcases/run_in_band/chain_manager.test.ts +++ b/src/testcases/run_in_band/chain_manager.test.ts @@ -452,7 +452,7 @@ describe('Neutron / Chain Manager', () => { 'Proposal #3', 'Globalfee update params proposal. Will pass', updateGlobalFeeParamsProposal({ - minimum_gas_prices: [{ denom: 'untrn', amount: '0.111' }], + minimum_gas_prices: [{ denom: 'untrn', amount: '0.00111' }], bypass_min_fee_msg_types: ['/gaia.globalfee.v1beta1.MsgUpdateParams'], max_total_bypass_min_fee_msg_gas_usage: '12345', }), @@ -479,7 +479,7 @@ describe('Neutron / Chain Manager', () => { const globalfeeParams = await globalfeeQuerier.params(); expect(globalfeeParams.params.minimumGasPrices).toEqual([ - { denom: 'untrn', amount: '0.111' }, + { denom: 'untrn', amount: '0.00111' }, ]); expect(globalfeeParams.params.bypassMinFeeMsgTypes).toEqual([ '/gaia.globalfee.v1beta1.MsgUpdateParams', From 4f9f2789906c3ff18a3131dfb37579b71081649d Mon Sep 17 00:00:00 2001 From: swelf Date: Tue, 26 Nov 2024 11:17:00 +0300 Subject: [PATCH 7/9] updated neutronjsplus --- package.json | 2 +- .../run_in_band/chain_manager.test.ts | 26 +++++++++---------- yarn.lock | 14 +++++----- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 3968dc2f..ad5f4f44 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@cosmjs/stargate": "0.32.4", "@cosmjs/tendermint-rpc": "^0.32.4", "@neutron-org/neutronjs": "https://github.com/neutron-org/neutronjs.git#8ca4875e81fc7cdfffab513bb410ca7cff09db78", - "@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#6bb6dd30a21527c1d232d0152383fdcb5580e933", + "@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#14dc348bea4955821565ae030bbce81b0557717f", "@types/lodash": "^4.14.182", "axios": "1.6.0", "commander": "^10.0.0", diff --git a/src/testcases/run_in_band/chain_manager.test.ts b/src/testcases/run_in_band/chain_manager.test.ts index cfba56f4..780d1a91 100644 --- a/src/testcases/run_in_band/chain_manager.test.ts +++ b/src/testcases/run_in_band/chain_manager.test.ts @@ -32,6 +32,7 @@ import { SigningNeutronClient } from '../../helpers/signing_neutron_client'; import config from '../../config.json'; import { Wallet } from '../../helpers/wallet'; import { ADMIN_MODULE_ADDRESS } from '@neutron-org/neutronjsplus/dist/constants'; +import { Duration } from '@neutron-org/neutronjs/google/protobuf/duration'; describe('Neutron / Chain Manager', () => { let testState: LocalState; @@ -226,7 +227,6 @@ describe('Neutron / Chain Manager', () => { consumer_redistribution_fraction: true, historical_entries: true, unbonding_period: true, - // !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see docs/docs/adrs/adr-015-partial-set-security.md soft_opt_out_threshold: true, reward_denoms: true, provider_reward_denoms: true, @@ -499,18 +499,18 @@ describe('Neutron / Chain Manager', () => { 'Consumer update params proposal. Will pass', updateConsumerParamsProposal({ enabled: true, - blocks_per_distribution_transmission: 321, - distribution_transmission_channel: 'channel-23', - provider_fee_pool_addr_str: chainManagerAddress, - ccv_timeout_period: '32s', - transfer_timeout_period: '23s', - consumer_redistribution_fraction: '0.33', - historical_entries: 123, - unbonding_period: '43s', - soft_opt_out_threshold: '0.55', - reward_denoms: ['tia'], - provider_reward_denoms: ['tia'], - retry_delay_period: '43s', + blocksPerDistributionTransmission: 321n, + distributionTransmissionChannel: 'channel-23', + providerFeePoolAddrStr: chainManagerAddress, + ccvTimeoutPeriod: Duration.fromPartial({ seconds: 32n }), + transferTimeoutPeriod: Duration.fromPartial({ seconds: 23n }), + consumerRedistributionFraction: '0.33', + historicalEntries: 123n, + unbondingPeriod: Duration.fromPartial({ seconds: 43n }), + softOptOutThreshold: '0.55', + rewardDenoms: ['tia'], + providerRewardDenoms: ['tia'], + retryDelayPeriod: Duration.fromPartial({ seconds: 43n }), }), '1000', ); diff --git a/yarn.lock b/yarn.lock index ada877df..1299bd8b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1341,22 +1341,22 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@neutron-org/neutronjs@https://github.com/neutron-org/neutronjs.git#7f45328320b53b4fa2b572bc25bb96bf80260181": - version "4.2.0" - resolved "https://github.com/neutron-org/neutronjs.git#7f45328320b53b4fa2b572bc25bb96bf80260181" - "@neutron-org/neutronjs@https://github.com/neutron-org/neutronjs.git#8ca4875e81fc7cdfffab513bb410ca7cff09db78": version "4.2.0" resolved "https://github.com/neutron-org/neutronjs.git#8ca4875e81fc7cdfffab513bb410ca7cff09db78" -"@neutron-org/neutronjsplus@https://github.com/neutron-org/neutronjsplus.git#6bb6dd30a21527c1d232d0152383fdcb5580e933": +"@neutron-org/neutronjs@https://github.com/neutron-org/neutronjs.git#95a719604fecba39de5540b6ac99ded3e7aacfaa": + version "4.2.0" + resolved "https://github.com/neutron-org/neutronjs.git#95a719604fecba39de5540b6ac99ded3e7aacfaa" + +"@neutron-org/neutronjsplus@https://github.com/neutron-org/neutronjsplus.git#14dc348bea4955821565ae030bbce81b0557717f": version "0.5.0" - resolved "https://github.com/neutron-org/neutronjsplus.git#6bb6dd30a21527c1d232d0152383fdcb5580e933" + resolved "https://github.com/neutron-org/neutronjsplus.git#14dc348bea4955821565ae030bbce81b0557717f" dependencies: "@cosmjs/cosmwasm-stargate" "^0.32.4" "@cosmjs/proto-signing" "^0.32.4" "@cosmjs/stargate" "0.32.4" - "@neutron-org/neutronjs" "https://github.com/neutron-org/neutronjs.git#7f45328320b53b4fa2b572bc25bb96bf80260181" + "@neutron-org/neutronjs" "https://github.com/neutron-org/neutronjs.git#95a719604fecba39de5540b6ac99ded3e7aacfaa" axios "1.6.0" bip39 "^3.1.0" long "^5.2.1" From 5e473d0cf9193770e67650d3b873ca2cb721cc72 Mon Sep 17 00:00:00 2001 From: swelf Date: Tue, 26 Nov 2024 22:07:23 +0300 Subject: [PATCH 8/9] make sure we really update every param we wanted to --- .../run_in_band/chain_manager.test.ts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/testcases/run_in_band/chain_manager.test.ts b/src/testcases/run_in_band/chain_manager.test.ts index 780d1a91..0e78e7f7 100644 --- a/src/testcases/run_in_band/chain_manager.test.ts +++ b/src/testcases/run_in_band/chain_manager.test.ts @@ -292,6 +292,7 @@ describe('Neutron / Chain Manager', () => { }); test('execute timelocked: success', async () => { + const cronParamsBefore = await cronQuerier.params(); await waitSeconds(10); await subdaoMember1.executeTimelockedProposal(proposalId); @@ -302,6 +303,12 @@ describe('Neutron / Chain Manager', () => { const cronParams = await cronQuerier.params(); expect(cronParams.params.limit).toEqual(42n); + // check that every params field before proposal execution differs from the field after proposal execution + expect( + Object.keys(cronParamsBefore).every( + (key) => cronParamsBefore[key] !== cronParams[key], + ), + ).toBeTrue(); }); }); @@ -336,6 +343,7 @@ describe('Neutron / Chain Manager', () => { }); test('execute timelocked: success', async () => { + const tokenfactoryParamsBefore = await tokenfactoryQuerier.params(); await waitSeconds(10); await subdaoMember1.executeTimelockedProposal(proposalId); @@ -358,6 +366,12 @@ describe('Neutron / Chain Manager', () => { denomCreator: 'neutron1m9l358xunhhwds0568za49mzhvuxx9ux8xafx2', }, ]); + // check that every params field before proposal execution differs from the field after proposal execution + expect( + Object.keys(tokenfactoryParamsBefore).every( + (key) => tokenfactoryParamsBefore[key] !== tokenfactoryParams[key], + ), + ).toBeTrue(); }); }); @@ -390,6 +404,7 @@ describe('Neutron / Chain Manager', () => { }); test('execute timelocked: success', async () => { + const dexParamsBefore = await dexQuerier.params(); await waitSeconds(10); await subdaoMember1.executeTimelockedProposal(proposalId); @@ -403,6 +418,12 @@ describe('Neutron / Chain Manager', () => { expect(dexParams.params.paused).toEqual(true); expect(dexParams.params.maxJitsPerBlock).toEqual(11n); expect(dexParams.params.goodTilPurgeAllowance).toEqual(50000n); + // check that every params field before proposal execution differs from the field after proposal execution + expect( + Object.keys(dexParamsBefore).every( + (key) => dexParamsBefore[key] !== dexParams[key], + ), + ).toBeTrue(); }); }); @@ -429,6 +450,7 @@ describe('Neutron / Chain Manager', () => { }); test('execute timelocked: success', async () => { + const dynamicfeesParamsBefore = await dynamicfeesQuerier.params(); await waitSeconds(10); await subdaoMember1.executeTimelockedProposal(proposalId); @@ -441,6 +463,12 @@ describe('Neutron / Chain Manager', () => { expect(dynamicfeesParams.params.ntrnPrices).toEqual([ { denom: 'newdenom', amount: '0.5' }, ]); + // check that every params field before proposal execution differs from the field after proposal execution + expect( + Object.keys(dynamicfeesParamsBefore).every( + (key) => dynamicfeesParamsBefore[key] !== dynamicfeesParams[key], + ), + ).toBeTrue(); }); }); @@ -469,6 +497,7 @@ describe('Neutron / Chain Manager', () => { }); test('execute timelocked: success', async () => { + const globalfeeParamsBefore = await globalfeeQuerier.params(); await waitSeconds(10); await subdaoMember1.executeTimelockedProposal(proposalId); @@ -487,6 +516,12 @@ describe('Neutron / Chain Manager', () => { expect(globalfeeParams.params.maxTotalBypassMinFeeMsgGasUsage).toEqual( 12345n, ); + // check that every params field before proposal execution differs from the field after proposal execution + expect( + Object.keys(globalfeeParamsBefore).every( + (key) => globalfeeParamsBefore[key] !== globalfeeParams[key], + ), + ).toBeTrue(); }); }); @@ -525,6 +560,7 @@ describe('Neutron / Chain Manager', () => { }); test('execute timelocked: success', async () => { + const ccvParamsBefore = await ccvQuerier.queryParams(); await waitSeconds(10); await subdaoMember1.executeTimelockedProposal(proposalId); @@ -568,6 +604,14 @@ describe('Neutron / Chain Manager', () => { nanos: 0, seconds: 43n, }); + // field 'enabled' is readonly, and should not be changed, always equals true + delete ccvParamsBefore['enabled']; + // check that every params field before proposal execution differs from the field after proposal execution + expect( + Object.keys(ccvParamsBefore).every( + (key) => ccvParamsBefore[key] !== ccvParams[key], + ), + ).toBeTrue(); }); }); From a6859b7a50036f647d71a36c96b03e4a1137708e Mon Sep 17 00:00:00 2001 From: c1nd0r <84794800+juankaukian@users.noreply.github.com> Date: Wed, 27 Nov 2024 00:38:05 +0200 Subject: [PATCH 9/9] Upgrading ubuntu 24.04 and hermes 1.10.4 --- setup/Makefile | 2 +- setup/docker-compose.yml | 2 +- setup/dockerbuilds/Dockerfile.hermes | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup/Makefile b/setup/Makefile index 5c36f342..d8476750 100644 --- a/setup/Makefile +++ b/setup/Makefile @@ -8,7 +8,7 @@ build-neutron: cd $(APP_DIR)/neutron && $(MAKE) build-docker-image build-hermes: - @docker build -f dockerbuilds/Dockerfile.hermes -t hermes:1.10.1 . + @docker build -f dockerbuilds/Dockerfile.hermes -t hermes:1.10.4 . build-relayer: cd $(APP_DIR)/neutron-query-relayer/ && make build-docker diff --git a/setup/docker-compose.yml b/setup/docker-compose.yml index 5e68d789..426682ad 100644 --- a/setup/docker-compose.yml +++ b/setup/docker-compose.yml @@ -36,7 +36,7 @@ services: - neutron-testing hermes: - image: hermes:1.10.1 + image: hermes:1.10.4 depends_on: - "neutron-node" - "gaia-node" diff --git a/setup/dockerbuilds/Dockerfile.hermes b/setup/dockerbuilds/Dockerfile.hermes index a6b313a5..23ff045f 100644 --- a/setup/dockerbuilds/Dockerfile.hermes +++ b/setup/dockerbuilds/Dockerfile.hermes @@ -1,9 +1,9 @@ -FROM ubuntu:23.04 +FROM ubuntu:24.04 COPY ./hermes/ /app/network/hermes/ WORKDIR /app RUN apt-get update && apt-get install -y wget && \ PLATFORM=`uname -a | awk '{print $(NF-1)}'` && \ - VERSION=v1.10.1 && \ + VERSION=v1.10.4 && \ TARNAME="hermes-${VERSION}-${PLATFORM}-unknown-linux-gnu.tar.gz" && \ wget "https://github.com/informalsystems/hermes/releases/download/${VERSION}/${TARNAME}" && \ tar -xf "$TARNAME" && \