From eeb755769494187cc492018a06dbb5f56973d094 Mon Sep 17 00:00:00 2001 From: Vishal Potpelliwar <71565171+vishal-kanna@users.noreply.github.com> Date: Thu, 4 Jan 2024 21:35:09 +0530 Subject: [PATCH] feat: Removing restorechannel and adding SetUpgradeErrorReceipt (#5405) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add a check for connection state in UpgradeAck. (#3954) * update WriteUpgradeTry to change flush status to `FLUSHCOMPLETE` if there are no packet commitments left (#3964) * Add flush status check in SendPacket (#3912) * Add ChanUpgradeOpen core handler. (#3844) * Add ChanUpgradeOpen core handler. * Tests tests tests. * Update upgrade open handler based on feedback. * Reformat testing approach. * Move counterpartyhops assignment inline. * Check err of SetChannelState. * Address feedback. * Remove uneeded modification of version. * Add flushing check to WriteUpgradeAckChannel (#3976) * chore: adding check for in flight packets in WriteUpgradeAckChannel * added test for TestWriteUpgradeAckChannel * linter * add client update to UpgradeAckChannel test * mv test * merge * fix post-merge * fix merge issues * review comment --------- Co-authored-by: Charly Co-authored-by: Carlos Rodriguez * remove depguard from golangci-lint (#4000) * Set channel state to NOTINFLUSH when Closing (#3995) * Set Counterparty Last Sequence Send (#4005) * Add FlushStatus Checks to RecvPacket (#3914) * Add implementation for message server handling of ChanUpgradeOpen. (#3895) * Add implementation for message server handling of ChanUpgradeOpen. * Add tests for msg_server. * Address review feedback. * Remove setting of flush status. * Apply suggestions from code review Co-authored-by: Damian Nolan * Address rest of review comments. --------- Co-authored-by: Damian Nolan * helper function for validating a counterparty upgrade against the selfupgrade (#4016) * Make AbortUpgrade panic on failure (#4011) * chore: update abort upgrade function to panic on error * apply review suggestions --------- Co-authored-by: Carlos Rodriguez * Amend AcknowledgePacket to handle flushing (#3922) * Amend Ack packet to keep acknowledging if we're in the process of flushing pre-upgrade packets. * Use handshake to reach correct state before mutating any fields. * Add test to verify post-ack channel state after last in-flight packet. * Remove unecessary modifications of version for non initializing channel end. * Test both cases: final in-flight packet and non-final one. * Apply suggestions from code review Co-authored-by: Carlos Rodriguez * Remove manual setting of flush status. * Update test name, pass mock version to both channels. --------- Co-authored-by: Carlos Rodriguez * Amend timeout to handle in-flight packets. (#3923) * Amend timeout to handle in-flight packets. * Update timeout handler per spec. * Update tests to test for toggling of flush status. * Fix small typos in docstring. --------- Co-authored-by: Carlos Rodriguez * change comment * chore: adding callback for OnChanUpgradeRestore in abort scenarios (#4051) * Pass in counterparty portID, channelID when verifying channel in ChanUpgradeOpen. (#4052) * Pass in counterparty portid, channelid. * use direct check on err. * Force distinct channel identifiers when testing UpgradeOpen. * Remove manual setting of flush status in ChanUpgradeOpen. (#4064) * Use counterparty portid, channelid when verifying channel upgrade error. (#4063) * feat: adding `OnChanUpgradeInit` handler implementation to `29-fee` (#4019) * WIP: adding fee upgrade cbs and testing * imp: allow failure expectations when using chain.SendMsgs * fixing import errors from cherry-pick * updating tests and rm try code * rm diff onChanUpgradeTry * Update modules/apps/29-fee/ibc_middleware.go * adding MetadataFromVersion func to pkg types * addressing pr feedback, disable fees on err, rename args, adding testcase * Update modules/apps/29-fee/ibc_middleware_test.go Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * abstract out expIsFeeEnabled check in tests * adding additional error context to MetadataFromVersion --------- Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * feat: adding `OnChanUpgradeTry` handler implementation for `29-fee` (#4023) * WIP: adding fee upgrade cbs and testing * imp: allow failure expectations when using chain.SendMsgs * fixing import errors from cherry-pick * updating tests and rm try code * rm diff onChanUpgradeTry * Update modules/apps/29-fee/ibc_middleware.go * adding OnChanUpgradeTry implementation for 29-fee, adding tests * rm CR in test expectation * remove goconst linter as discussed async * adding MetadataFromVersion func to pkg types * addressing pr feedback, disable fees on err, rename args, adding testcase * Update modules/apps/29-fee/ibc_middleware_test.go Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * abstract out expIsFeeEnabled check in tests * adding additional error context to MetadataFromVersion * propagate changes from onChanUpgradeInit PR * addressing test assertion feedback --------- Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * feat: adding `OnChanUpgradeAck` handler implementation to `29-fee` (#4028) * WIP: adding fee upgrade cbs and testing * imp: allow failure expectations when using chain.SendMsgs * fixing import errors from cherry-pick * updating tests and rm try code * rm diff onChanUpgradeTry * Update modules/apps/29-fee/ibc_middleware.go * adding OnChanUpgradeTry implementation for 29-fee, adding tests * rm CR in test expectation * remove goconst linter as discussed async * adding onChanUpgradeAck implementation to 29-fee, adding tests * adding MetadataFromVersion func to pkg types * addressing pr feedback, disable fees on err, rename args, adding testcase * Update modules/apps/29-fee/ibc_middleware_test.go Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * abstract out expIsFeeEnabled check in tests * adding additional error context to MetadataFromVersion * propagate changes from onChanUpgradeInit PR * addressing test assertion feedback * updating to use types.MetadataFromVersion in OnChanUpgradeAck * updating tests to add additional checks --------- Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * Use counterparty connection hops when verifying channel state (#4074) * use counterparty conn hops. * Clean up tests. * Amend inline comment slightly. * Address nits --------- Co-authored-by: Carlos Rodriguez * chore: adding comment to 29-fee OnChanUpgradeOpen callback (#4123) * Add tests for WriteUpgradeOpenChannel. (#4077) * Add tests for WriteUpgradeCancel. (#4076) * Move channel to OPEN if all in-flight packets have been flushed in UpgradeAck. (#4075) * Move channel to OPEN if all in-flight packets have been flushed in UpgradeAck. * Add comment noting that counterparty flush status has been verified before usage. * Fix failing tests. * imp: use HasInflightPackets to check if channel has finished flushing. (#4134) * feat: adding `OnChanUpgradeInit` implementation to transfer (#4126) * adding transfer checks in upgrade cbs * adding tests and reduce diff by moving code out * add additional assertion on upgrade stored in state * lint: single var declaration instead of block * rename version -> upgradeVersion * Update modules/apps/transfer/ibc_module_test.go * rename sequence -> upgradeSequence * updating to use NewTranferPath in test func * address pr comment - reformat error msg * Remove superfluous ignore directive. (#4158) * feat: adding OnChanUpgradeTry implementation to transfer (#4137) * adding transfer checks in upgrade cbs * adding tests and reduce diff by moving code out * add additional assertion on upgrade stored in state * lint: single var declaration instead of block * rename version -> upgradeVersion * Update modules/apps/transfer/ibc_module_test.go * rename sequence -> upgradeSequence * adding onChanUpgradeTry impl for transfer app, adding tests * updating to use NewTranferPath in test func * restructure error formatting * Call app callback after writting state in Cancel and Timeout. (#4166) * helper function to clear state stored during an upgrade (#4147) * add `IsUpgradError` func for readability (#4144) * add IsUpgradeError function * Update modules/core/04-channel/types/upgrade.go Co-authored-by: Jim Fasarakis-Hilliard * gofumpt * Update modules/core/04-channel/types/upgrade.go Co-authored-by: Charly --------- Co-authored-by: Jim Fasarakis-Hilliard Co-authored-by: Charly * add check that channel exists in upgrade gRPCs (#4156) * add check that channel exists * use has function instead * consistent connection lookup calls in 04-channel (#4146) * nit: error formatting improvements for channel upgrades (#4097) * string formatting improvements * fix typo * review comment * review comment * review comment * review comment * added test for event emission (#4020) * feat: implement `OnChanUpgradeAck` for transfer (#4215) * feat: implement onChanUpgradeAck for transfer module * Update modules/apps/transfer/ibc_module_test.go * refactor: call OnChanUpgradeTry transfer callback directly in favour of full Endpoint call * refactor: simplify OnChanUpgradeTry transfer testing to call module cbs directly (#4221) * feat: implement onChanUpgradeAck for transfer module * Update modules/apps/transfer/ibc_module_test.go * refactor: call OnChanUpgradeTry transfer callback directly in favour of full Endpoint call * refactor: simplify OnChanUpgradeTry transfer testing to call module cbs directly * lint me * rm duplicate test from merge * test: adding test for events in channel upgrade try (#4226) * Add store functions for counterparty upgrade. (#4293) * Add store functions for counterparty upgrade. * Apply suggestions from code review Co-authored-by: Damian Nolan --------- Co-authored-by: Damian Nolan * Add FLUSHING/FLUSHCOMPLETE to Channel state. (#4300) * feat: adding `ChannelUpgradeConfirm` rpc and msgs (#4302) * adding protobuf msgs and rpc service definition * adding empty boilerplate method stub * register msg codec and add sdk.Msg impl + tests * chore: move verification before startFlushUpgradeHandshake (#4285) * rebase `04-channel-upgrades` branch (#4160) * update with latest changes from main * fix conflicts in e2e * make invalid version constant * fix linter by using constant instead of literal --------- Co-authored-by: chatton Co-authored-by: Damian Nolan * Revert "rebase `04-channel-upgrades` branch (#4160)" This reverts commit d5e63d40695adc6c1aad16160ea3bf655251825c. * rm unnecessary test matrix file * make lint-fix * satisfy revive linter * updating feature banch ci workflow for golangci-lint * bumping golangci-lint action to v3.6.0 * define go version as string in workflow * Delete counterparty upgrade in deleteUpgradeInfo. Move function to keeper. (#4294) * Remove check for counterparty timeout in ChanUpgradeTry. (#4301) Co-authored-by: Damian Nolan * Store counterparty upgrade after ack finishes. (#4299) * call verification of counterparty channel, upgrade in upgradetry. (#4310) * Add verification calls in ChanUpgradeAck. (#4312) * Add ChanUpgradeConfirm to endpoint. (#4314) * Remove verification calls in StartFlushUpgradeHandshake (#4317) Co-authored-by: Damian Nolan * test: add events test for ChannelUpgradeTimeout (#4284) * test: add event emission test for ChanUpgradeCancel (#4281) * Check counterparty timeout hasn't elapsed in ChanUpgradeAck. (#4305) Co-authored-by: Carlos Rodriguez * refactor: modify `ChannelUpgradeInit` to only store upgrade fields (#4344) * WIP: adding initial implementation of changes * proto format * commenting out more failing tests from timeouts * fix compiler error * commenting out failing testcases due to timeout logic * fix: reorder proto msg fields correctly * refactor: move increment upgrade sequence to write fn, rename currentChannel -> channel * refactor: rename msg server vars for consistency * update FirstChannelID to FirstConnectionID in msg validate basic tests * rename test var and use mock.UpgradeVersion * comment out failing tests * Add test for event emission ChanUpgradeAck (#4228) * test: add event test for chan upgrade ack * gofumpt file --------- Co-authored-by: Carlos Rodriguez * Adding test for events for ChanUpgradeOpen (#4230) * test: adding test for events for chan upgrade open * Update upgrade_test.go --------- Co-authored-by: Carlos Rodriguez * Move check to fail on incompatible upgrade after proof verification. (#4320) * Move check to fail on incompatible upgrade after proof verification. * Update modules/core/04-channel/keeper/upgrade_test.go Co-authored-by: Damian Nolan * lint fix --------- Co-authored-by: Damian Nolan Co-authored-by: Carlos Rodriguez * Add functions checkForUpgradeCompatibility and syncUpgradeSequence (#4352) * refactor: modify upgrade init to not change channel state (#4357) * WIP: adding initial implementation of changes * proto format * commenting out more failing tests from timeouts * fix compiler error * commenting out failing testcases due to timeout logic * fix: reorder proto msg fields correctly * refactor: move increment upgrade sequence to write fn, rename currentChannel -> channel * refactor: rename msg server vars for consistency * update FirstChannelID to FirstConnectionID in msg validate basic tests * rename test var and use mock.UpgradeVersion * comment out failing tests * refactor upgrade init state to open. refactor crossing hellos and try verification logic * updating godoc and error return in chanUpgradeAck2 * address nits from pr review * refactor: cleanup upgrade init app callback args (#4359) * WIP: adding initial implementation of changes * proto format * commenting out more failing tests from timeouts * fix compiler error * commenting out failing testcases due to timeout logic * fix: reorder proto msg fields correctly * refactor: move increment upgrade sequence to write fn, rename currentChannel -> channel * refactor: rename msg server vars for consistency * update FirstChannelID to FirstConnectionID in msg validate basic tests * rename test var and use mock.UpgradeVersion * comment out failing tests * refactor upgrade init state to open. refactor crossing hellos and try verification logic * updating godoc and error return in chanUpgradeAck2 * refactor: rm unnecessary args in application upgrade init callback * Add WriteUpgradeConfirm function. (#4303) * Add WriteUpgradeConfirm function. * Add some sweet godoc for this bad boy. * Apply suggestions from code review Co-authored-by: Carlos Rodriguez --------- Co-authored-by: Carlos Rodriguez * Modify startFlushUpgradeHandshake to be used as a write function (#4360) * Remove restore logic in upgrade TRY handler (#4362) * refactor: remove `FlushStatus` from ack handler and msg (#4364) * chore: remove restore logic in try handler, fast forward upgrade sequence in try hander * chore: fix linter * refactor: remove channel flush status from ack msg and handler * fix: address test acknowledgement failing testcase, replace flush status with channel state assertion * fix: linter crying * adding back failure testcase for AcknowledgePacket * updating testcase name to be more reflective of channel state --------- Co-authored-by: chatton * Amend checkForUpgradeCompatibility to check that versions match (#4366) * refactor: modify ack handler expected channel state (#4371) * chore: remove restore logic in try handler, fast forward upgrade sequence in try hander * chore: fix linter * disable acknowledmgent test where try upgrade is called * fixing failing msg server test for chanUpgradeTry * wip: update write upgrade try func to no longer write channel as TRYUPGRADE. no longer set flush status * refactor: remove channel flush status from ack msg and handler * rm commented out lines of code in write try func * address todo for handling packet acks in correct channel state --------- Co-authored-by: chatton * Channel Upgrade Ack (#4372) * feat: adding `chanUpgradeConfirm` implementation to `04-channel` (#4373) * chore: remove restore logic in try handler, fast forward upgrade sequence in try hander * chore: fix linter * disable acknowledmgent test where try upgrade is called * fixing failing msg server test for chanUpgradeTry * wip: update write upgrade try func to no longer write channel as TRYUPGRADE. no longer set flush status * refactor: remove channel flush status from ack msg and handler * refactor: remove channel flush status from ack msg and handler * fix: address test acknowledgement failing testcase, replace flush status with channel state assertion * fix: linter crying * adding back failure testcase for AcknowledgePacket * updating testcase name to be more reflective of channel state * refactor: update chanUpgradeAck as per spec changes * rm commented out lines of code in write try func * address todo for handling packet acks in correct channel state * chore: fixing ack tests * chore: remove unneeded comment * chore: removed previous state log entry * Update modules/core/04-channel/keeper/upgrade.go Co-authored-by: Damian Nolan * block comment code to be moved and link issue, uncomment previously disabled tests * addding ChanUpgradeConfirm implementation with test suite --------- Co-authored-by: chatton Co-authored-by: Cian Hatton * feat: adding msg server implementation for `ChanUpgradeConfirm` (#4376) * chore: remove restore logic in try handler, fast forward upgrade sequence in try hander * chore: fix linter * disable acknowledmgent test where try upgrade is called * fixing failing msg server test for chanUpgradeTry * wip: update write upgrade try func to no longer write channel as TRYUPGRADE. no longer set flush status * refactor: remove channel flush status from ack msg and handler * refactor: remove channel flush status from ack msg and handler * fix: address test acknowledgement failing testcase, replace flush status with channel state assertion * fix: linter crying * adding back failure testcase for AcknowledgePacket * updating testcase name to be more reflective of channel state * refactor: update chanUpgradeAck as per spec changes * rm commented out lines of code in write try func * address todo for handling packet acks in correct channel state * chore: fixing ack tests * chore: remove unneeded comment * chore: removed previous state log entry * Update modules/core/04-channel/keeper/upgrade.go Co-authored-by: Damian Nolan * block comment code to be moved and link issue, uncomment previously disabled tests * addding ChanUpgradeConfirm implementation with test suite * adding the msg server impl for chanUpgradeConfirm, adding tests :) --------- Co-authored-by: chatton Co-authored-by: Cian Hatton * Remove check on flush status for send packet. (#4384) * Remove check on flush status for send packet. * Rename test, remove duplicate test. * Channel Upgrade Open (#4379) * Implement Channel Upgrade Cancel (#4404) * Refactor `TestWriteUpgradeCancelChannel` (#4424) * chore: remove restore logic in try handler, fast forward upgrade sequence in try hander * chore: fix linter * disable acknowledmgent test where try upgrade is called * fixing failing msg server test for chanUpgradeTry * wip: update write upgrade try func to no longer write channel as TRYUPGRADE. no longer set flush status * refactor: remove channel flush status from ack msg and handler * refactor: remove channel flush status from ack msg and handler * fix: address test acknowledgement failing testcase, replace flush status with channel state assertion * fix: linter crying * adding back failure testcase for AcknowledgePacket * updating testcase name to be more reflective of channel state * refactor: update chanUpgradeAck as per spec changes * rm commented out lines of code in write try func * address todo for handling packet acks in correct channel state * chore: fixing ack tests * chore: remove unneeded comment * chore: removed previous state log entry * Update modules/core/04-channel/keeper/upgrade.go Co-authored-by: Damian Nolan * block comment code to be moved and link issue, uncomment previously disabled tests * addding ChanUpgradeConfirm implementation with test suite * adding the msg server impl for chanUpgradeConfirm, adding tests :) * refactor: updated ChanUpgradeOpen keeper function to match spec * chore: fixing tests for ChannelUpgradeOpen * chore: added test case for invalid counterparty channel state * chore: adding new implementation for ChannelUpgradeClose * chore: fix TestWriteUpgradeCancelChannel * chore: addressing feedback * chore: simplified test cases * chore: fix linter * chore: remove duplicate connection test * Apply suggestions from code review Co-authored-by: Damian Nolan * refactor TestWriteUpgradeCancelChannel to use table tests * delete unused variable * lint * update check panic * update from code review * Apply suggestions from code review --------- Co-authored-by: chatton Co-authored-by: Damian Nolan Co-authored-by: Cian Hatton * Refactor `TestWriteUpgradeOpenChannel` (#4431) * refactor TestWriteUpgradeOpenChannel to use table tests * Apply suggestions from code review * lint * revert AttributeKeyUpgradeChannelFlushStatus --------- Co-authored-by: Damian Nolan * refactor: acknowledgePacket handling flushing / flush complete state (#4412) * refactor: handle flush complete channel state transition in acknowledgePacket * wip: adding testcases for acknowledgePacket with flushing state * lint: make lint-fix * test: adding assertFn temporarily to tests to provide after test state checks * set counterparty upgrade on write try fn * Add UpgradeTimeout as a params field in the channel submodule (#4411) * Refactor TestWriteUpgradeTry to remove flush status checks (#4430) * refactor: use `expResult` in acknowledgePacket tests (#4439) * refactor: adapt acknowledgePacket tests to use expResult func * cleanup: removing redundant stale tests * fix: assert ErrInvalidProof for verification failure. modify suite.Run tc naming * Implement ChanUpgradeTimeout with spec changes (#4438) * Amend recvPacket as per spec. (#4386) * Amend recvPacket as per spec. * Update modules/core/04-channel/keeper/packet_test.go Co-authored-by: Damian Nolan * Drop usage of CounterpartyLastSequenceSend. * Cover all cases. * Use SetChannelCounterpartyUpgrade. * Add expected errors, remove duplicate test. * Remove setting of counterparty last sequence send in other test case. * Shorthand initialization of dummy upgrade. * Apply suggestions from code review Co-authored-by: Damian Nolan --------- Co-authored-by: Damian Nolan Co-authored-by: Cian Hatton * Update error receipt event emission to use correct event type (#4451) * Account for moving channel state to flush complete in timeout processing (#4425) * Remove init, try, ack upgrade states (#4455) * refactor: remove `FlushStatus` from channel end (#4457) * refactor: remove flush status from channel end * remove flush status enum * address pr review comments and remove additional refs in comments * Refactor channel upgradability msgs to reflect updated spec (#4456) * Amend timeoutPacket to allow timeouts on any channel state. (#4367) Co-authored-by: Damian Nolan * Refactor recvPacket tests to use expError. (#4471) * Refactor recvPacket tests to use expError. * Use testify's ErrorIs. * refactor: remove counterparty last sequence send state entry (#4473) * Don't write channel to state when not modified. (#4495) * refactor: rename channel upgradability flush states (#4488) * Don't emit event information for unchanged upgrade. (#4492) * Add tests for WriteUpgradeConfirm. (#4490) * Allow receiving of packets if the counterparty latest sequence send has not been set (#4480) * allow receiving of packets if the counterparty latest sequence send has not been set. * Update modules/core/04-channel/keeper/packet_test.go Co-authored-by: Damian Nolan * Address feedback, lint fix. * STATUS_FLUSHING -> FLUSHING --------- Co-authored-by: Damian Nolan * chore: re-enable disabled test case in `chanUpgradeTry` (#4501) * Resolve commented out testcases for Channel Upgrades (#4474) * refactor: adding additional upgrade fields args to onChanUpgradeOpen (#4478) * tests: adding followup tests for in-flight packets on chanUpgradeConfirm (#4491) * tests: adding followup tests for in-flight packets on chanUpgradeConfirm * fix: adapt failing test and format * fix: resolve compiler breakage of enum naming * Use only timestamp only for upgrade timeouts. (#4482) * Timing out packets on ordered channels when in flushing state aborts upgrade and closes channel (#4475) * Change UpgradeTimeout to from absolute to relative (#4511) * refactor: fee middleware onChanUpgradeInit callback (#4514) * refactor: fee middleware onChanUpgradeTry callback (#4515) Co-authored-by: Cian Hatton * refactor: implementation for onChanUpgradeAck ics29 (#4523) * refactor: implementation for onChanUpgradeAck ics29 * lint0r * feat: adding fee middleware onChanUpgradeOpen callback impl (#4524) * refactor: implementation for onChanUpgradeAck ics29 * lint0r * feat: adding fee middleware onChanUpgradeOpen callback impl * adding comment to discarded return arg * test: adding integration test for fee transfer channel upgrade (#4533) * refactor: implementation for onChanUpgradeAck ics29 * lint0r * feat: adding fee middleware onChanUpgradeOpen callback impl * test: adding integration test for fee transfer channel upgrade * fix: check that `MsgChannelUpgradeInit` is signed by authority (#4773) * Chore: consistent argument order (#4545) * order arguments * Revert "order arguments" This reverts commit 2de37271e6f19b77e01cef65a1120a663486c040. * reorder arguments of channel upgrade verify functions * missing changes --------- Co-authored-by: Carlos Rodriguez * Add ParseProposalIDFromEvents helper function (#4942) * add ParseProposalIDFromEvents * update with damian suggest * imp: remove `LatestSequenceSend` (#5108) * del: latestsequencesend field * fix: comment * gofumpt * del: tests * del leftover tests part * adressing comments * addressing comment --------- Co-authored-by: sangier Co-authored-by: sangier Co-authored-by: Carlos Rodriguez * chore: rebase 04-channel-upgrades feature branch (#5085) * move legacy keytable init to migration handler code (#4730) * deps: bump SDK v0.50-rc.1 (#4763) * test: run tests of all go.mods (#4468) * test: run tests of all go.mods Co-authored-by: Carlos Rodriguez * Remove +build directive which is deprecated, remove tparse hadnling in Makefile. * Add sdk script, remove LINT_DIFF. * Fix linting issues that popped up. * Add script to run tests for all modules. * chore: add executible permissions to script, rename to avoid shadowing dir builtin * chore: use python3 instead of python * chore: add venv to gitignore * Disallow env vars not being set, clean up minor issues. --------- Co-authored-by: DimitrisJim Co-authored-by: chatton Co-authored-by: Cian Hatton * docs: some more v8 migration docs (#4728) * docs: some more migration docs * alignment * alignment 2 * Update docs/docs/05-migrations/11-v7-to-v8.md Co-authored-by: Jim Fasarakis-Hilliard * update about proposals * update docs after putting back legacy proposals * add links for gov v1 messages * update link of importable workflow * add information about facilities to test upgrade * add notes about cosmos sdk v0.50 upgrading guide * Update docs/docs/05-migrations/11-v7-to-v8.md Co-authored-by: Charly * Update docs/docs/05-migrations/11-v7-to-v8.md Co-authored-by: Charly * add extra info about authority and merkle path functions that have been removed --------- Co-authored-by: Jim Fasarakis-Hilliard Co-authored-by: Charly * deps: bump mod/capability to v1.0.0-rc6 (#4768) Co-authored-by: Jim Fasarakis-Hilliard * Fix e2e-upgrade.yaml complaint. (#4772) * deps(docs): bump docusaurus from v2.4.1 to v2.4.3 * Fix e2e linting issues. (#4767) * test extra conditions for `ApplyPrefix` (#4764) * test extra conditions * review comment * Add codec registrations tests for apps (#4780) * Add test for type registration for transfer. * Add test for type registration for fee. * Add test for type registration for ica. * Lint this bad boy * Apply suggestions from code review Co-authored-by: Damian Nolan --------- Co-authored-by: Damian Nolan * Save gas on capability IsInitialized (#4770) * chore: fix broken links/rename folders (#4781) * chore: fix broken links/rename folders * typo * fix link * Use slices.ContainsFunc instead of separate contains func. (#4786) * docs: fix links (#4787) * chore: update changelog (#4774) * chore: update changelog * Apply suggestions from code review Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> Co-authored-by: Jim Fasarakis-Hilliard --------- Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> Co-authored-by: Jim Fasarakis-Hilliard * docs: implemented Mary's suggestions (#4775) * docs: implemented Mary's suggestions * imp(docs): updated the large IBC logo --------- Co-authored-by: Carlos Rodriguez * Update repo cover image (#4794) * docs: added tutorial for Cosmoverse 2023 (#4793) * feat(docs): added custom components * feat(docs): added and tested custom components * docs: fee app.go integration tutorial added * imp(docs): added custom git diff magic comments * deps: switched to '@saucelabs/theme-github-codeblock' * imp(docs): improved fee wiring up and added keplr to env setup * imp(docs): added react scaffold docs * imp(docs): added fee mw react component * imp(docs): finished all files of the demo * imp(docs): updated links and styling * docs: ran linter * imp(docs): implemented review items * fix: typos (#4796) * fix typo * fix typo * fix typos * fix typos * fix typos * fix typo * imp!: use expected interface for legacy params subspace (#4811) * imp: use expected interface for legacy params subspace * chore: define GetParamSet on expected interface and rm explicit type conversions * chore: fix fork e2es (#4813) * chore: mergify task and e2e tests for `release/v8.0.x` (#4765) * chore: mergify task and e2e tests for release/v8.0.x * preventing single chain tests to run on more than one chain * extra polishing of yaml files * add release/v8.0.x to drop down menus * use hermes relayer instead of rly * docs: add changelog entry for #4835 * doc: adding migration doc info for nil legacy subspace (#4816) * Change host relay tests to check error returned (#4161) * Add failure case for msg failing on ValidateBasic. * Move testing for host relay to check for error returns. * Use similar error checking as other tests. * Use NoError, wrap err in error message. * fix: relay test expected result --------- Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: Damian Nolan * build(deps): Bump golang.org/x/mod from 0.12.0 to 0.13.0 in /e2e (#4839) Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.12.0 to 0.13.0. - [Commits](https://github.com/golang/mod/compare/v0.12.0...v0.13.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): Bump github.com/spf13/viper from 1.16.0 to 1.17.0 (#4846) * build(deps): Bump github.com/spf13/viper from 1.16.0 to 1.17.0 Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.16.0 to 1.17.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.16.0...v1.17.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Go mod tidy e2e, callbacks, capability. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim * build(deps): Bump bufbuild/buf-setup-action from 1.26.1 to 1.27.0 (#4847) Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.26.1 to 1.27.0. - [Release notes](https://github.com/bufbuild/buf-setup-action/releases) - [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.26.1...v1.27.0) --- updated-dependencies: - dependency-name: bufbuild/buf-setup-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos Rodriguez * e2e : migrate interchaintest.GetBalance to CosmosChain's GetBalance (#4683) * build(deps): Bump google.golang.org/grpc from 1.58.2 to 1.58.3 (#4855) * build(deps): Bump google.golang.org/grpc from 1.58.2 to 1.58.3 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.58.2 to 1.58.3. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.58.2...v1.58.3) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump grpc in e2e, go mod tidy in e2e, callbacks. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> * imp: add go mod tidy all script (#4845) * feat: add go mod tidy all script * feedback --------- Co-authored-by: Jim Fasarakis-Hilliard * chores: add v4.5.0 tag and remove v5.2.x (end of life) (#4840) * chore: fixing compatibility tests (#4876) * build(deps): Bump cosmossdk.io/x/tx from 0.10.0 to 0.11.0 (#4889) * build(deps): Bump cosmossdk.io/x/tx from 0.10.0 to 0.11.0 Bumps [cosmossdk.io/x/tx](https://github.com/cosmos/cosmos-sdk) from 0.10.0 to 0.11.0. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.11.0/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.10.0...v0.11.0) --- updated-dependencies: - dependency-name: cosmossdk.io/x/tx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * The typical dance, again. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim * build(deps): Bump cosmossdk.io/api from 0.7.1 to 0.7.2 (#4890) * build(deps): Bump cosmossdk.io/api from 0.7.1 to 0.7.2 Bumps [cosmossdk.io/api](https://github.com/cosmos/cosmos-sdk) from 0.7.1 to 0.7.2. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.7.1...api/v0.7.2) --- updated-dependencies: - dependency-name: cosmossdk.io/api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * The typical dance. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim Co-authored-by: Carlos Rodriguez * imp: add init-simapp script (#4844) * feat: add init-simapp script * Apply suggestions from code review Co-authored-by: Damian Nolan --------- Co-authored-by: Carlos Rodriguez Co-authored-by: Damian Nolan Co-authored-by: Jim Fasarakis-Hilliard * chore: fixes for legacy amino encoding for ledger signing (#4812) * chore(wip): fixes for legacy amino encoding for ledger signing * chore: cleanup, format and add additional fee annotations * fix: register legacy amino codec in 29-fee * build(deps): Bump bufbuild/buf-setup-action from 1.27.0 to 1.27.1 (#4906) Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.27.0 to 1.27.1. - [Release notes](https://github.com/bufbuild/buf-setup-action/releases) - [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.27.0...v1.27.1) --- updated-dependencies: - dependency-name: bufbuild/buf-setup-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): Bump google.golang.org/grpc from 1.58.3 to 1.59.0 (#4904) * build(deps): Bump google.golang.org/grpc from 1.58.3 to 1.59.0 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.58.3 to 1.59.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.58.3...v1.59.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump grpc in e2e, go mod tidy in e2e, callbacks. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim * remove test that does not apply to v6.1.x and v6.2.x release lines * small improvements to v8 migration docs * Automate Discord Notification for New Releases (#4918) * Create discord_notify.yml Add GitHub Action for Discord release notifications * Rename discord_notify.yml to discord-notify.yml --------- Co-authored-by: Jim Fasarakis-Hilliard Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> * docs: add google analytics 4 support (#4933) * deps(docs): ran 'npm i --save @docusaurus/plugin-google-gtag' * feat(docs): added google analytics 4 to docs * Add note for adding a build tag in new e2e files. (#4937) * docs: add microsoft clarity support (#4935) * deps(docs): ran 'npm i --save @gracefullight/docusaurus-plugin-microsoft-clarity' * feat(docs): added microsoft clarity support * chores for new patch releases for v4, v5, v6, v7 (#4922) * release chores * remove tag from tests * remove tag from tests * build(deps): Bump actions/setup-node from 3 to 4 (#4941) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(msg): register proto interface (#4944) * build(deps): Bump tj-actions/changed-files from 39 to 40 (#4962) Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 39 to 40. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v39...v40) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: remove redundant code (#4952) * deps(e2e): update hermes tag (#4968) * Register message service descriptor (#4969) * docs: fee middleware tutorial improvements (#4979) * docs: removed duplicate code snippet * docs: consistent use of yaml vs yml * docs: using 'auto_register_counterparty_payee' * docs: added Fee Middleware docs to prereqs * docs: fixed broken link * docs: improved fee tutorial * imp: review item * (mod/capability) Use AppModule directly in favour of AppModuleBasic in mod/capability (#4982) * removing appmodulebasic and all nil/unneeded functions * lint * test file changes * lint --------- Co-authored-by: Damian Nolan * deps: bump Cosmos SDK to tip of `release/v0.50.x` (#4976) * deps: bump to Cosmos SDK @ 0469fc17e1587850e7de390af282df5215287a21 * lint * Apply suggestions from code review Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> --------- Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * Add a test for 07-tendermint's GetTimestampAtHeight (#4972) Co-authored-by: Carlos Rodriguez * build(deps): Bump bufbuild/buf-setup-action from 1.27.1 to 1.27.2 (#4988) Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.27.1 to 1.27.2. - [Release notes](https://github.com/bufbuild/buf-setup-action/releases) - [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.27.1...v1.27.2) --- updated-dependencies: - dependency-name: bufbuild/buf-setup-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * refactor(simapp): re-wire autocli with latest client/v2 changes (#4843) * refactor: wire autocli * go mod tidy all + fix textual * removing initmodule from ica (#4977) * remoing appmodulebasic interface from capability and initmodule function which mimicks initgenesis * undoing capability change * imp(statemachine)!: add length validation of string fields in messages Co-authored-by: Jacob Gadikian Co-authored-by: Du Nguyen Co-authored-by: Charly * chore: EoL for v4 and v5 (#4995) * simplifying code in packet_test (#4980) * reducing boilerplate code * lint * gofumpt --------- Co-authored-by: Carlos Rodriguez Co-authored-by: DimitrisJim * build(deps): Bump cosmossdk.io/store from 1.0.0-rc.0 to 1.0.0 (#5009) * build(deps): Bump cosmossdk.io/store from 1.0.0-rc.0 to 1.0.0 Bumps [cosmossdk.io/store](https://github.com/cosmos/cosmos-sdk) from 1.0.0-rc.0 to 1.0.0. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/math/v1.0.0-rc.0...log/v1.0.0) --- updated-dependencies: - dependency-name: cosmossdk.io/store dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore: go mod tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: chatton * fix: docs typos (#5014) * Fix typos 01-overview.md * Fix Typos 00-intro.md Fixed typos & tweaked intro language * style: raname sidebar Tutorials to Developer Portal --------- Co-authored-by: srdtrk * docs: fix typos (#5019) * fix expect pointer error when unmarshalling misbehaviour file (#5020) * fix expect pointer error when unmarshalling misbehaviour file * Update CHANGELOG.md --------- Co-authored-by: Carlos Rodriguez * build(deps): Bump cosmossdk.io/x/tx from 0.11.0 to 0.12.0 (#5017) * build(deps): Bump cosmossdk.io/x/tx from 0.11.0 to 0.12.0 Bumps [cosmossdk.io/x/tx](https://github.com/cosmos/cosmos-sdk) from 0.11.0 to 0.12.0. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.12.0/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.11.0...v0.12.0) --- updated-dependencies: - dependency-name: cosmossdk.io/x/tx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * bump callbacks * e2e: go mod tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos Rodriguez * build(deps): Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#5024) * build(deps): Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: make tidy-all --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Damian Nolan * build(deps): Bump golang.org/x/mod from 0.13.0 to 0.14.0 in /e2e (#5025) Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.13.0 to 0.14.0. - [Commits](https://github.com/golang/mod/compare/v0.13.0...v0.14.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): Bump cosmossdk.io/math from 1.1.3-rc.1 to 1.2.0 (#5034) * build(deps): Bump cosmossdk.io/math from 1.1.3-rc.1 to 1.2.0 Bumps [cosmossdk.io/math](https://github.com/cosmos/cosmos-sdk) from 1.1.3-rc.1 to 1.2.0. - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/math/v1.1.3-rc.1...log/v1.2.0) --- updated-dependencies: - dependency-name: cosmossdk.io/math dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: tidy all --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Damian Nolan * chore: fix error formatting of client status check in client recovery (#5039) * deps: bump SDK v0.50.1 (#5038) * deps: bump SDK v0.50.1 * update changelog * deps: downgrade cosmossdk.io/core to v0.11.0 * fix interchain accounts tests * implement app module basic correctly for capability module * bump SDK to v0.50.1 in capability module * downgrade cosmossdk.io/api to v0.7.2 * downgrade cosmossdk.io/api to v7.2.0 for callbacks * Bump dependencies (#5064) * deps: update mod/capability to v1.0.0 (#5046) Co-authored-by: Carlos Rodriguez * imp: updated urls (#5031) Co-authored-by: Carlos Rodriguez * docs: new social card for docs (#5080) * docs: added new social card * docs: updated social card * chore: add mergify backport for 08-wasm (#5077) * docs: add docs folder for v8.0.x (#5078) * docs: add docs folder for v8.0.x * fix links * docs: fixed with absolute url links * docs: fix more links --------- Co-authored-by: srdtrk Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Co-authored-by: Charly Co-authored-by: DimitrisJim Co-authored-by: chatton Co-authored-by: Cian Hatton Co-authored-by: Damian Nolan Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> Co-authored-by: Susannah Evans <65018876+womensrights@users.noreply.github.com> Co-authored-by: omahs <73983677+omahs@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: nguyen <144610611+trinitys7@users.noreply.github.com> Co-authored-by: Julien Robert Co-authored-by: Adi <103246632+adiraviraj@users.noreply.github.com> Co-authored-by: emidev98 <49301655+emidev98@users.noreply.github.com> Co-authored-by: Muku <44918265+muku314115@users.noreply.github.com> Co-authored-by: Jacob Gadikian Co-authored-by: Du Nguyen Co-authored-by: zadkiel88 <106065297+zadkiel88@users.noreply.github.com> Co-authored-by: srdtrk Co-authored-by: shuoer86 <129674997+shuoer86@users.noreply.github.com> Co-authored-by: mmsqe * chore: propagate IBC authority to 04-channel keeper to be used within upgrade cancellation (#5093) * chore: add authority to function params, test flow for checking msg sender against authority * linter * refactor: use isAuthority bool in favour of passing signer and authority to 04-channel --------- Co-authored-by: Damian Nolan * Amend validation of upgrade fields to use variable holding supported orderings. (#5152) * refactor: adapt testing endpoint query for channel upgrade proofs (#5165) * test: adding test for crossing hello trys with historical proofs (#5143) * test: adding test for crossing hello trys with historical proofs * chore: make format * chore: address TODO in test case with switch of proof query endpoint * chore: replace dummy error with correct error type (#5177) * Remove incorrect godoc (#5203) * chore: correct returned error (#5205) * chore: adding comment to add clarity to returned upgrade (#5214) * Verify channel upgrade can be completed after cancellation is successful (#5163) * Remove last packet sent from new upgrade constructor. (#5210) Co-authored-by: Damian Nolan * Reorder call to application callback so it happens after we write state. (#5230) Co-authored-by: Damian Nolan * chore: allow authorized senders to submit empty error receipt proof (#5232) * remove incorect code (#5235) Co-authored-by: Damian Nolan Co-authored-by: Cian Hatton * chore: panic instead of return err (#5246) * chore: add comment about version assignment (#5239) * Add to docstring with explanation about channel state (#5236) * Chore: replace `fmt.Sprintf` with `fmt.Errorf` in `upgrades.go` (#5291) * replace Sprintf with Errorf in WriteUpgradeAckChannel * replace Sprintf with Errorf in upgrade.go * fix: add event and event emission for `FLUSHCOMPLETE` (#5245) * add event emit * minor * add testing for moving to flushing complete event * minor * Remove setting counterparty upgrade info in upgrade try (#5238) * chore: updated tests to reflect the timeout and ack changes * chore: adding status check on channel when channel is flushing * review comment --------- Co-authored-by: Carlos Rodriguez * fix: allow error receipt to be nil in case of the msg sender is the authority (#5262) * fix + tests * shuffle about logic ordering * Added the MetadataFromVersion function * Move events to message server layer instead of core level (#5264) * wip: moving events up to the message server layer * wip: move events out to message server layer * chore: commenting out event tests * Fix merge issue. --------- Co-authored-by: DimitrisJim Co-authored-by: Charly * use function in a few other places, fix typo in function name, fix test * review comment * imp: use MetadataFromVersion function in 27-interchain-accounts (#5300) Co-authored-by: Carlos Rodriguez * remove channel id (#5307) Co-authored-by: Carlos Rodriguez * remove comment that unused (#5308) Co-authored-by: Carlos Rodriguez * Implement OnChanUpgradeInit on Controller Chain for interchain-accounts (#5141) * chore: adding controller implementation for OnChanUpgradeInit * chore: happy path test passing * chore: adding fail case * chore: adding additional test cases * chore: fix linting * chore: improving errors * chore: refactor to use test keeper function directly * chore: add check for enabled controller module * chore: call into middleware if provided * chore: addressing PR feedback * revert change in godoc of GetConnectionID * fix: typo in MetadataFromVersion func * chore: rm duplicate func --------- Co-authored-by: Carlos Rodriguez Co-authored-by: Damian Nolan * Add a helper function to create a mock contract. (#5162) * docs: improved channel closure docs (#5170) * docs: improved channel closure docs * docs: ran linter * chore: use `GetPrefixedDenom` to create IBC token denom (#5175) * build(deps): Bump DavidAnson/markdownlint-cli2-action from 13 to 14 (#5176) Bumps [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action) from 13 to 14.
Commits
  • 455b661 Update to version 14.0.0.
  • fa0be73 Freshen generated index.js file.
  • 1e5b660 Remove "command" input deprecated in v11.
  • b1a3c7b Add CONTRIBUTING.md.
  • feb7cc4 Freshen generated index.js file.
  • eeda667 Bump markdownlint-cli2 from 0.10.0 to 0.11.0
  • 4670aba Stop excluding generated file dist/index.js from diff check in npm test scrip...
  • 404090a Bump eslint from 8.53.0 to 8.54.0
  • c69f13c Remove deprecated ESLint rules after version update.
  • 55caa5f Bump eslint from 8.52.0 to 8.53.0
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=DavidAnson/markdownlint-cli2-action&package-manager=github_actions&previous-version=13&new-version=14)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* docs: readme improvements (#5171) * readme improvements * add link * chore(08-wasm): `Pin` code during app initialisation (#5161) * init InitializePinnedCodes * testing * call Pin during app inisitalization * linting * update docs * spacing * update docs * add extra line * chore: update tmproto, tmos aliases to cmtproto, cmtos * chore: use suite.Require().NoError(), rename gotErr to err * testing: nits * Use table driven tests for TestInitializedPinnedCodes --------- Co-authored-by: Carlos Rodriguez Co-authored-by: Damian Nolan Co-authored-by: DimitrisJim * e2e: timeout transfer with grandpa light client (#5018) * Change to StoreCodeUnchecked in Genesis and snapshotter (#5167) * change to store code unchecked * separate storeWasmCode and importWasmCode * add parameter to storeWasmCode to pass the store function * store code for msg server * fix: typos in godocs * Update modules/light-clients/08-wasm/internal/ibcwasm/expected_interfaces.go Co-authored-by: Damian Nolan * linting business --------- Co-authored-by: Carlos Rodriguez Co-authored-by: DimitrisJim Co-authored-by: Damian Nolan * build(deps): Bump JamesIves/github-pages-deploy-action from 4.4.3 to 4.5.0 (#5188) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.3 to 4.5.0.
Release notes

Sourced from JamesIves/github-pages-deploy-action's releases.

v4.5.0

What's Changed

New Contributors

Full Changelog: https://github.com/JamesIves/github-pages-deploy-action/compare/v4.4.3...v4.5.0

Commits
  • 65b5dfd Deploy Production Code for Commit 32bb2a8d7bda92f28b1fd223fc5793ab27f725eb 🚀
  • 32bb2a8 Merge branch 'dev' into releases/v4
  • 7879c16 feat: update to Node 20
  • 1c34508 build(deps-dev): bump @​types/node from 20.9.0 to 20.10.0 (#1479)
  • b957d05 Bump actions/checkout from 3 to 4 (#1429)
  • 3a4632d build(deps-dev): bump @​types/node from 20.4.9 to 20.9.0 (#1474)
  • 9de0269 build(deps): bump actions/setup-node from 3 to 4 (#1467)
  • 810af53 Update README.md
  • 24c1e2a doc: .gitignore matches not being deployed (#1459)
  • 0769273 fix: remove base.Dockerfile as it's not needed
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=JamesIves/github-pages-deploy-action&package-manager=github_actions&previous-version=4.4.3&new-version=4.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* build(deps): Bump github.com/hashicorp/go-metrics from 0.5.2 to 0.5.3 (#5182) * build(deps): Bump github.com/hashicorp/go-metrics from 0.5.2 to 0.5.3 Bumps [github.com/hashicorp/go-metrics](https://github.com/hashicorp/go-metrics) from 0.5.2 to 0.5.3. - [Release notes](https://github.com/hashicorp/go-metrics/releases) - [Commits](https://github.com/hashicorp/go-metrics/compare/v0.5.2...v0.5.3) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-metrics dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * go mod tidy e2e, callbacks, 08-wasm --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim * build(deps): Bump github.com/cometbft/cometbft from 0.38.1 to 0.38.2 (#5180) * build(deps): Bump github.com/cometbft/cometbft from 0.38.1 to 0.38.2 Bumps [github.com/cometbft/cometbft](https://github.com/cometbft/cometbft) from 0.38.1 to 0.38.2. - [Release notes](https://github.com/cometbft/cometbft/releases) - [Changelog](https://github.com/cometbft/cometbft/blob/main/CHANGELOG.md) - [Commits](https://github.com/cometbft/cometbft/compare/v0.38.1...v0.38.2) --- updated-dependencies: - dependency-name: github.com/cometbft/cometbft dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * go mod tidy e2e, callbacks, 08-wasm --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim * build(deps): Bump github.com/spf13/cast from 1.5.1 to 1.6.0 (#5181) * build(deps): Bump github.com/spf13/cast from 1.5.1 to 1.6.0 Bumps [github.com/spf13/cast](https://github.com/spf13/cast) from 1.5.1 to 1.6.0. - [Release notes](https://github.com/spf13/cast/releases) - [Commits](https://github.com/spf13/cast/compare/v1.5.1...v1.6.0) --- updated-dependencies: - dependency-name: github.com/spf13/cast dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * go mod tidy e2e, callbacks, 08-wasm. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim * docs: add IBC overview diagram (#5166) * add ibc overview diagram * lint fixes * Apply suggestions from code review Co-authored-by: DimitrisJim Co-authored-by: Charly --------- Co-authored-by: DimitrisJim Co-authored-by: Charly * Drop step installing tparse. (#5191) * Add capability to dependabot. (#5193) * build(deps): Bump sigs.k8s.io/yaml in /modules/capability (#5194) Bumps [sigs.k8s.io/yaml](https://github.com/kubernetes-sigs/yaml) from 1.3.0 to 1.4.0. - [Release notes](https://github.com/kubernetes-sigs/yaml/releases) - [Changelog](https://github.com/kubernetes-sigs/yaml/blob/master/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/yaml/compare/v1.3.0...v1.4.0) --- updated-dependencies: - dependency-name: sigs.k8s.io/yaml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): Bump github.com/cometbft/cometbft in /modules/capability (#5195) Bumps [github.com/cometbft/cometbft](https://github.com/cometbft/cometbft) from 0.38.0 to 0.38.2. - [Release notes](https://github.com/cometbft/cometbft/releases) - [Changelog](https://github.com/cometbft/cometbft/blob/main/CHANGELOG.md) - [Commits](https://github.com/cometbft/cometbft/compare/v0.38.0...v0.38.2) --- updated-dependencies: - dependency-name: github.com/cometbft/cometbft dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos Rodriguez * build(deps): Bump cosmossdk.io/store from 1.0.0 to 1.0.1 (#5199) * build(deps): Bump cosmossdk.io/store from 1.0.0 to 1.0.1 Bumps [cosmossdk.io/store](https://github.com/cosmos/cosmos-sdk) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/log/v1.0.0...math/v1.0.1) --- updated-dependencies: - dependency-name: cosmossdk.io/store dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * bump store in e2e, callbacks, capability, 08-wasm. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim * update mergify labels for 08-wasm release branches * imp: use bytes in wasm contract api instead of wrapped types (#5154) Co-authored-by: srdtrk Co-authored-by: Damian Nolan * build(deps): Bump docker/metadata-action from 5.0.0 to 5.1.0 (#5277) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.0.0 to 5.1.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/96383f45573cb7f253c731d3b3ab81c87ef81934...f19c3691d56f26e3f97547999df66a9ecbf0d9b0) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add workflow to build wasm simapp (#5286) * ci: workflow to trigger wasm E2Es with a specific tag (#5288) Co-authored-by: Damian Nolan * feat: add custom queries to wasm module (#5261) * feat: add custom queries to wasm module Signed-off-by: aeryz * linter stuff as per usual. * review comments Signed-off-by: aeryz * lint Signed-off-by: aeryz * Use wasmvm.Querier. * Lint this bad boy * Small test nits. * add default querier and update documentation --------- Signed-off-by: aeryz Co-authored-by: DimitrisJim Co-authored-by: Carlos Rodriguez * mergify task for callbacks v0.2.x and ibc-go v8.0.x (#5295) * build(deps): Bump docker/metadata-action from 5.1.0 to 5.2.0 (#5297) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.1.0 to 5.2.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/f19c3691d56f26e3f97547999df66a9ecbf0d9b0...e6428a5c4e294a61438ed7f43155db912025b6b3) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update CODEOWNERS for 08-wasm (#5296) seems like you missed yourself @crodriguezvega :smile: * update roadmap * build(deps): Bump docker/metadata-action from 5.2.0 to 5.3.0 (#5301) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/e6428a5c4e294a61438ed7f43155db912025b6b3...31cebacef4805868f9ce9a0cb03ee36c32df2ac4) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos Rodriguez * Don't panic during any store operations. (#5294) * Don't panic during any store operations. * Panic when creating wrapped store if substores are nil. * Address Damian's feedback. * Support wasm tests on forks (#5234) * chore: support wasm tests on forks * chore: use correct needs * chore: install python deps * chore: adding flag for forks * chore: use chain image passed in CI * Update e2e/testsuite/testconfig.go Co-authored-by: DimitrisJim --------- Co-authored-by: DimitrisJim Co-authored-by: Damian Nolan * docs: remove redundant code examples (#5309) * fix: remove 08-wasm from 02-client exported (#5306) * fix: remove 08-wasm from 02-client exported * fix grandpa test * add function to add 08-wasm to allowed clients * e2e: add gov proposal to add 08-wasm client to list of allowed clients * use cosmos chain when querying gov module address * make functions for querying allowed clients and to add 08-wasm * Update modules/light-clients/08-wasm/types/validation.go Co-authored-by: DimitrisJim * Update modules/light-clients/08-wasm/types/keys.go Co-authored-by: Damian Nolan * Update keys.go --------- Co-authored-by: DimitrisJim Co-authored-by: Damian Nolan * Remove pr labeler. (#5302) Remove labeler workflow. --------- Co-authored-by: Damian Nolan * fix: require authority to pass proof if channel state is in FLUSHCOMPLETE for upgrade cancellation (#5332) * disallow authority to cancel upgrade if channel is FLUSHCOMPLETE without error receipt * error case in test * docs: document MsgChannelUpgradeCancel (#5274) * docs: adding docs for MsgChannelUpgradeCancel * chore: fix dead link * Apply suggestions from code review * Update 06-channel-upgrades.md * fix link * Apply suggestions from code review Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: Carlos Rodriguez --------- Co-authored-by: Damian Nolan Co-authored-by: Carlos Rodriguez Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * ChannelUpgradeInit refactor (#5289) * remove unnecessary code * refactor * Update upgrade.go * Update upgrade.go --------- Co-authored-by: Carlos Rodriguez * Implement OnChanUpgradeTry on Host Chain for interchain-accounts (#5144) co-authored-by: Cian Hatton * Remove `GetSigners` from module 04-channel (#5352) * remove GetSigners from module 04-channel * linting * add tests GetSigners for remain msgs * add tests GetSigners for MsgTimeout * update with Colin's review --------- Co-authored-by: GLong Co-authored-by: Damian Nolan * fix markdown lint error * imp: rm app upgrade interface from IBCModule and use type assertions for app callback routing (#5375) * api: rm app upgrade interface from IBCModule interface * chore: use type assertions for app routing callbacks in core msg server handlers * lint: make lint-fix * chore: undo rename type accidental addition * fix: adding type assertions to app callbacks * lint fix * chore: rm Wrapf error creation in favour of Wrap when no args are present * Implement OnChanUpgradeAck on Controller Chain for interchain-accounts (#5160) co-authored-by: Charly * update error strings * chore: adding interface assertions for app upgrade interface (#5390) * Make sure that the error receipt we write always has a sequence greater than the existing one. (#5237) * chore : removed the restoreChannel method and added SetUpgradeErrorReceipt * refactor: remove unnecessary decrement when fast forwarding upgrade sequence (#5231) * update ChanUpgradeTry function * update with Aditya's suggestion * update with Carlos's review * add check in test * refactor: remove unnecessary - 1 on fast forward --------- Co-authored-by: Charly Co-authored-by: Đỗ Việt Hoàng Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com> * Allow verification of channels on TimeoutonClose and ChanCloseConfirm (#4388) * Allow verification of channels on TimeoutOnClose and ChanCloseConfirm * Add test case for counterparty upgrade sequence > 0 in msgs. * Add test cases in timeout, handshake that cover an invalid counterparty upgrade sequence. --------- Co-authored-by: Damian Nolan * imp: add passthrough handlers for callbacks mw module (#5376) Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: DimitrisJim * Remove ResponseResult from UpgradeTimeout response, channel-id from UpgradeTry response. (#5407) * Remove Response from timeout, remove channel-id from try resp. * fix proto numbering. * fix: set upgrade sequence correctly in channel recovery (#5374) * docs: `ChanUpgradeInit` and governance gating (#5347) * Add key for pruning sequence, get/set ops for storing/getting it. (#5412) * Add proto message for pruning acks, msgs, stubs for keeper/msg-server. (#5409) * Add proto message for pruning acks, msgs, stubs for keeper/msg-server. * Make pruning number of zero into error. * Apply suggestions from code review Co-authored-by: Carlos Rodriguez Co-authored-by: Damian Nolan * Rename num_to_prune to limit. * make proto-format, add documentation note on limit argument. --------- Co-authored-by: Carlos Rodriguez Co-authored-by: Damian Nolan * feat: add grpc/CLI for channel params query (#5430) * e2e: successful test where the channel is upgraded and fee middleware is enabled (#5358) * wip: happy path test upgrading a channel to wire fee middleware * change package name * trying to have the relayer started before executing governance proposal * passing happy path channel upgrade test * some refactoring * use sdkmath import alias * update docker images --------- Co-authored-by: Charly Co-authored-by: Damian Nolan * chore: update channel upgrades default timeout to 10 mins (#5433) * chore: update channel upgrades default timeout to 10 mins * chore: make lint-fix * imp: add upgrade sequence to identified channel (#5436) * imp: add upgrade sequence to identified channel * Add ValidateBasic tests for IdentifiedChannel. --------- Co-authored-by: DimitrisJim * docs: reasoning and use cases for channel upgradability (#5346) * revert "imp: remove `LatestSequenceSend` (#5108)" (#5432) * disallow ICA upgrades that change channel order + increase test coverage (#5415) * disallow changing ordering in ICA upgrade and increase test coverage * linting * review comments * panic wrap error * refactor: restructure timeout type (#5404) * refactor: apply issue design to timeout type * chore: add godocs * tests: add tests for elapsed and ErrTimeoutElapsed functions * rm: unfinished tests * test: tests for ErrTimeoutNotReached * test: add tests for ErrTimeoutNotReached * review suggestion: switcharoo * chore: add in-code comment --------- Co-authored-by: Carlos Rodriguez * Move order check in keeper function for host/controller. (#5464) Co-authored-by: Carlos Rodriguez * Pass appVersion to callback if version can be parsed. (#5468) * Pass appVersion to callback if version can be parsed. * Assert on rest of values passed. * Move cast to Upgradable module after checking app is set. (#5465) * Move cast to Upgradable module _after_ checking app is set. * Add test to check nil apps are allowed. * ICS4: Fix Sequencing logic in UpgradeTry (#5419) * fix sequencing logic and unit tests * added tests * reorder comments * add test * fix typo * refactored a couple of tests * relocate comment * fix: defer incrementing acc sequencing such that is happens on both success and failure tx execution * chore: update version strings in comments * test: wrap test code in suite.Run and add additional assertions * refactor: adapt crossing hellos cancellation test case to use suite.Run and add more assertions --------- Co-authored-by: Carlos Rodriguez Co-authored-by: Damian Nolan * Add implementations for OnChanUpgradeOpen and OnChanUpgradeRestore for controller. (#5467) * Add passthrough implementations for OnChanUpgradeOpen and OnChanUpgradeRestore for controller. * Drop unused expError from test functions. * imp: add logic for setting `NextSeqRecv`, `NextSeqAck` in `OnChanUpgradeOpen` (#5438) Co-authored-by: DimitrisJim * check counterparty `nextSequenceSend` in `recvPacket` (#5469) * add logic for setting next seq recv, update tests * update next seq recv and ack logic to spec * typos * update test * wip changes for spec * wip set counterparty upgrade * update naming * update endpoint * spec changes * test that counterparty upgrade has been set * update err message * pr review * naming nit * feat: check counterparty next sequence send in recv packet * add comment * lint * add error doc * only do defensive check if counterpartyUpgrade is set * remove unnecessary 0 check * merge conflict fix: add back deleted test --------- Co-authored-by: Charly Co-authored-by: Charly Co-authored-by: Aditya Sripal Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com> * Update keeper.go * Update metadata.go * update swagger * refactor tests to use write error receipt where possible * Add pruning logic, implementation in message server. (#5444) Co-authored-by: Carlos Rodriguez Co-authored-by: Charly Co-authored-by: Damian Nolan Co-authored-by: chatton Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Signed-off-by: aeryz Co-authored-by: Jim Fasarakis-Hilliard Co-authored-by: Charly Co-authored-by: Cian Hatton Co-authored-by: Charly Co-authored-by: Carlos Rodriguez Co-authored-by: Damian Nolan Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: chatton Co-authored-by: Nguyen Thanh Nhan Co-authored-by: sangier <45793271+sangier@users.noreply.github.com> Co-authored-by: sangier Co-authored-by: sangier Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> Co-authored-by: Susannah Evans <65018876+womensrights@users.noreply.github.com> Co-authored-by: omahs <73983677+omahs@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: nguyen <144610611+trinitys7@users.noreply.github.com> Co-authored-by: Julien Robert Co-authored-by: Adi <103246632+adiraviraj@users.noreply.github.com> Co-authored-by: emidev98 <49301655+emidev98@users.noreply.github.com> Co-authored-by: Muku <44918265+muku314115@users.noreply.github.com> Co-authored-by: Jacob Gadikian Co-authored-by: Du Nguyen Co-authored-by: zadkiel88 <106065297+zadkiel88@users.noreply.github.com> Co-authored-by: srdtrk Co-authored-by: shuoer86 <129674997+shuoer86@users.noreply.github.com> Co-authored-by: mmsqe Co-authored-by: GnaD <89174180+GNaD13@users.noreply.github.com> Co-authored-by: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Co-authored-by: sontrinh16 <48055119+sontrinh16@users.noreply.github.com> Co-authored-by: stepit <48993133+0xstepit@users.noreply.github.com> Co-authored-by: vuong <56973102+vuong177@users.noreply.github.com> Co-authored-by: Abdullah Eryuzlu <24809834+aeryz@users.noreply.github.com> Co-authored-by: Luke Ma Co-authored-by: GLong Co-authored-by: Đỗ Việt Hoàng Co-authored-by: Aditya (cherry picked from commit e3e8f343d05d3f7dfd958877562bca3aff89b758) --- .../core/03-connection/keeper/verify_test.go | 6 +++--- modules/core/04-channel/keeper/export_test.go | 6 +++--- .../core/04-channel/keeper/grpc_query_test.go | 2 +- modules/core/04-channel/keeper/keeper.go | 4 ++-- modules/core/04-channel/keeper/keeper_test.go | 6 +++--- modules/core/04-channel/keeper/upgrade.go | 20 ++++++++++--------- .../core/04-channel/keeper/upgrade_test.go | 7 +++---- modules/core/keeper/msg_server.go | 3 +-- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/modules/core/03-connection/keeper/verify_test.go b/modules/core/03-connection/keeper/verify_test.go index 28dd7dd7e4f..40d6c842544 100644 --- a/modules/core/03-connection/keeper/verify_test.go +++ b/modules/core/03-connection/keeper/verify_test.go @@ -744,7 +744,7 @@ func (suite *KeeperTestSuite) TestVerifyUpgradeErrorReceipt() { suite.coordinator.Setup(path) upgradeError = channeltypes.NewUpgradeError(1, channeltypes.ErrInvalidChannel) - suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.SetUpgradeErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, upgradeError.GetErrorReceipt()) + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.WriteErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, upgradeError) suite.chainA.Coordinator.CommitBlock(suite.chainA) suite.Require().NoError(path.EndpointB.UpdateClient()) @@ -799,8 +799,8 @@ func (suite *KeeperTestSuite) TestVerifyUpgradeErrorReceiptAbsence() { { name: "verification fails when the key exists", malleate: func() { - errorReceipt := channeltypes.NewUpgradeError(1, channeltypes.ErrInvalidChannel).GetErrorReceipt() - suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.SetUpgradeErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, errorReceipt) + upgradeErr := channeltypes.NewUpgradeError(1, channeltypes.ErrInvalidChannel) + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.WriteErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, upgradeErr) suite.chainA.Coordinator.CommitBlock(suite.chainA) suite.Require().NoError(path.EndpointB.UpdateClient()) }, diff --git a/modules/core/04-channel/keeper/export_test.go b/modules/core/04-channel/keeper/export_test.go index a1ecb519716..6977617e36a 100644 --- a/modules/core/04-channel/keeper/export_test.go +++ b/modules/core/04-channel/keeper/export_test.go @@ -25,7 +25,7 @@ func (k Keeper) CheckForUpgradeCompatibility(ctx sdk.Context, upgradeFields, cou return k.checkForUpgradeCompatibility(ctx, upgradeFields, counterpartyUpgradeFields) } -// WriteErrorReceipt is a wrapper around writeErrorReceipt to allow the function to be directly called in tests. -func (k Keeper) WriteErrorReceipt(ctx sdk.Context, portID, channelID string, upgradeError *types.UpgradeError) { - k.writeErrorReceipt(ctx, portID, channelID, upgradeError) +// SetUpgradeErrorReceipt is a wrapper around setUpgradeErrorReceipt to allow the function to be directly called in tests. +func (k Keeper) SetUpgradeErrorReceipt(ctx sdk.Context, portID, channelID string, errorReceipt types.ErrorReceipt) { + k.setUpgradeErrorReceipt(ctx, portID, channelID, errorReceipt) } diff --git a/modules/core/04-channel/keeper/grpc_query_test.go b/modules/core/04-channel/keeper/grpc_query_test.go index 12ff1fbabbd..6461e07b4c3 100644 --- a/modules/core/04-channel/keeper/grpc_query_test.go +++ b/modules/core/04-channel/keeper/grpc_query_test.go @@ -1758,7 +1758,7 @@ func (suite *KeeperTestSuite) TestQueryUpgradeError() { path := ibctesting.NewPath(suite.chainA, suite.chainB) suite.coordinator.Setup(path) upgradeErr = types.NewUpgradeError(uint64(1), fmt.Errorf("test error")) - suite.chainA.App.GetIBCKeeper().ChannelKeeper.SetUpgradeErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, upgradeErr.GetErrorReceipt()) + suite.chainA.App.GetIBCKeeper().ChannelKeeper.WriteErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, upgradeErr) req = &types.QueryUpgradeErrorRequest{ PortId: path.EndpointA.ChannelConfig.PortID, diff --git a/modules/core/04-channel/keeper/keeper.go b/modules/core/04-channel/keeper/keeper.go index a946e50665f..24fb0f0372c 100644 --- a/modules/core/04-channel/keeper/keeper.go +++ b/modules/core/04-channel/keeper/keeper.go @@ -507,8 +507,8 @@ func (k Keeper) GetUpgradeErrorReceipt(ctx sdk.Context, portID, channelID string return errorReceipt, true } -// SetUpgradeErrorReceipt sets the provided error receipt in store using the port and channel identifiers. -func (k Keeper) SetUpgradeErrorReceipt(ctx sdk.Context, portID, channelID string, errorReceipt types.ErrorReceipt) { +// setUpgradeErrorReceipt sets the provided error receipt in store using the port and channel identifiers. +func (k Keeper) setUpgradeErrorReceipt(ctx sdk.Context, portID, channelID string, errorReceipt types.ErrorReceipt) { store := ctx.KVStore(k.storeKey) bz := k.cdc.MustMarshal(&errorReceipt) store.Set(host.ChannelUpgradeErrorKey(portID, channelID), bz) diff --git a/modules/core/04-channel/keeper/keeper_test.go b/modules/core/04-channel/keeper/keeper_test.go index 588d1002de1..1c7cd8f87f6 100644 --- a/modules/core/04-channel/keeper/keeper_test.go +++ b/modules/core/04-channel/keeper/keeper_test.go @@ -479,12 +479,12 @@ func (suite *KeeperTestSuite) TestSetUpgradeErrorReceipt() { suite.Require().False(found) suite.Require().Empty(errorReceipt) - expErrorReceipt := types.NewUpgradeError(1, fmt.Errorf("testing")).GetErrorReceipt() - suite.chainA.App.GetIBCKeeper().ChannelKeeper.SetUpgradeErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, expErrorReceipt) + expError := types.NewUpgradeError(1, fmt.Errorf("testing")) + suite.chainA.App.GetIBCKeeper().ChannelKeeper.WriteErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, expError) errorReceipt, found = suite.chainA.App.GetIBCKeeper().ChannelKeeper.GetUpgradeErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) suite.Require().True(found) - suite.Require().Equal(expErrorReceipt, errorReceipt) + suite.Require().Equal(expError.GetErrorReceipt(), errorReceipt) } // TestDefaultSetParams tests the default params set are what is expected diff --git a/modules/core/04-channel/keeper/upgrade.go b/modules/core/04-channel/keeper/upgrade.go index b58d8146ee5..beb93b76480 100644 --- a/modules/core/04-channel/keeper/upgrade.go +++ b/modules/core/04-channel/keeper/upgrade.go @@ -676,7 +676,8 @@ func (k Keeper) WriteUpgradeCancelChannel(ctx sdk.Context, portID, channelID str previousState := channel.State - channel = k.restoreChannel(ctx, portID, channelID, sequence, channel, types.NewUpgradeError(sequence, types.ErrInvalidUpgrade)) + channel = k.restoreChannel(ctx, portID, channelID, sequence, channel) + k.WriteErrorReceipt(ctx, portID, channelID, types.NewUpgradeError(sequence, types.ErrInvalidUpgrade)) k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", previousState, "new-state", types.OPEN.String()) EmitChannelUpgradeCancelEvent(ctx, portID, channelID, channel, upgrade) @@ -794,7 +795,8 @@ func (k Keeper) WriteUpgradeTimeoutChannel( panic(fmt.Errorf("could not find existing upgrade when cancelling channel upgrade, channelID: %s, portID: %s", channelID, portID)) } - channel = k.restoreChannel(ctx, portID, channelID, channel.UpgradeSequence, channel, types.NewUpgradeError(channel.UpgradeSequence, types.ErrUpgradeTimeout)) + channel = k.restoreChannel(ctx, portID, channelID, channel.UpgradeSequence, channel) + k.WriteErrorReceipt(ctx, portID, channelID, types.NewUpgradeError(channel.UpgradeSequence, types.ErrUpgradeTimeout)) k.Logger(ctx).Info("channel state restored", "port-id", portID, "channel-id", channelID) @@ -957,12 +959,14 @@ func (k Keeper) abortUpgrade(ctx sdk.Context, portID, channelID string, err erro // the channel upgrade sequence has already been updated in ChannelUpgradeTry, so we can pass // its updated value. - k.restoreChannel(ctx, portID, channelID, channel.UpgradeSequence, channel, upgradeError) + k.restoreChannel(ctx, portID, channelID, channel.UpgradeSequence, channel) + k.WriteErrorReceipt(ctx, portID, channelID, upgradeError) + return nil } // restoreChannel will restore the channel state to its pre-upgrade state so that upgrade is aborted. -func (k Keeper) restoreChannel(ctx sdk.Context, portID, channelID string, upgradeSequence uint64, channel types.Channel, err *types.UpgradeError) types.Channel { +func (k Keeper) restoreChannel(ctx sdk.Context, portID, channelID string, upgradeSequence uint64, channel types.Channel) types.Channel { channel.State = types.OPEN channel.UpgradeSequence = upgradeSequence @@ -971,13 +975,11 @@ func (k Keeper) restoreChannel(ctx sdk.Context, portID, channelID string, upgrad // delete state associated with upgrade which is no longer required. k.deleteUpgradeInfo(ctx, portID, channelID) - k.SetUpgradeErrorReceipt(ctx, portID, channelID, err.GetErrorReceipt()) - return channel } -// writeErrorReceipt will write an error receipt from the provided UpgradeError. -func (k Keeper) writeErrorReceipt(ctx sdk.Context, portID, channelID string, upgradeError *types.UpgradeError) { +// WriteErrorReceipt will write an error receipt from the provided UpgradeError. +func (k Keeper) WriteErrorReceipt(ctx sdk.Context, portID, channelID string, upgradeError *types.UpgradeError) { channel, found := k.GetChannel(ctx, portID, channelID) if !found { panic(errorsmod.Wrapf(types.ErrChannelNotFound, "port ID (%s) channel ID (%s)", portID, channelID)) @@ -990,6 +992,6 @@ func (k Keeper) writeErrorReceipt(ctx sdk.Context, portID, channelID string, upg panic(errorsmod.Wrapf(types.ErrInvalidUpgradeSequence, "error receipt sequence (%d) must be greater than existing error receipt sequence (%d)", errorReceiptToWrite.Sequence, existingErrorReceipt.Sequence)) } - k.SetUpgradeErrorReceipt(ctx, portID, channelID, errorReceiptToWrite) + k.setUpgradeErrorReceipt(ctx, portID, channelID, errorReceiptToWrite) EmitErrorReceiptEvent(ctx, portID, channelID, channel, upgradeError) } diff --git a/modules/core/04-channel/keeper/upgrade_test.go b/modules/core/04-channel/keeper/upgrade_test.go index 268980c8846..463d2cb569d 100644 --- a/modules/core/04-channel/keeper/upgrade_test.go +++ b/modules/core/04-channel/keeper/upgrade_test.go @@ -532,8 +532,7 @@ func (suite *KeeperTestSuite) TestChanUpgrade_CrossingHellos_UpgradeSucceeds_Aft suite.Require().Error(err) suite.assertUpgradeError(err, types.NewUpgradeError(4, types.ErrInvalidUpgradeSequence)) - errorReceipt := err.(*types.UpgradeError).GetErrorReceipt() - suite.chainB.GetSimApp().IBCKeeper.ChannelKeeper.SetUpgradeErrorReceipt(suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, errorReceipt) + suite.chainB.GetSimApp().IBCKeeper.ChannelKeeper.WriteErrorReceipt(suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, err.(*types.UpgradeError)) suite.coordinator.CommitBlock(suite.chainB) }) @@ -2784,7 +2783,7 @@ func (suite *KeeperTestSuite) TestWriteErrorReceipt() { func() { // write an error sequence with a lower sequence number previousUpgradeError := types.NewUpgradeError(upgradeError.GetErrorReceipt().Sequence-1, types.ErrInvalidUpgrade) - suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.SetUpgradeErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, previousUpgradeError.GetErrorReceipt()) + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.WriteErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, previousUpgradeError) }, nil, }, @@ -2793,7 +2792,7 @@ func (suite *KeeperTestSuite) TestWriteErrorReceipt() { func() { // write an error sequence with a higher sequence number previousUpgradeError := types.NewUpgradeError(upgradeError.GetErrorReceipt().Sequence+1, types.ErrInvalidUpgrade) - suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.SetUpgradeErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, previousUpgradeError.GetErrorReceipt()) + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.WriteErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, previousUpgradeError) }, errorsmod.Wrap(types.ErrInvalidUpgradeSequence, "error receipt sequence (10) must be greater than existing error receipt sequence (11)"), }, diff --git a/modules/core/keeper/msg_server.go b/modules/core/keeper/msg_server.go index dfa2c0a9342..e6010ac3818 100644 --- a/modules/core/keeper/msg_server.go +++ b/modules/core/keeper/msg_server.go @@ -816,8 +816,7 @@ func (k Keeper) ChannelUpgradeTry(goCtx context.Context, msg *channeltypes.MsgCh if err != nil { ctx.Logger().Error("channel upgrade try failed", "error", errorsmod.Wrap(err, "channel upgrade try failed")) if channeltypes.IsUpgradeError(err) { - k.ChannelKeeper.SetUpgradeErrorReceipt(ctx, msg.PortId, msg.ChannelId, err.(*channeltypes.UpgradeError).GetErrorReceipt()) - keeper.EmitErrorReceiptEvent(ctx, msg.PortId, msg.ChannelId, channel, err) + k.ChannelKeeper.WriteErrorReceipt(ctx, msg.PortId, msg.ChannelId, err.(*channeltypes.UpgradeError)) // NOTE: a FAILURE result is returned to the client and an error receipt is written to state. // This signals to the relayer to begin the cancel upgrade handshake subprotocol. return &channeltypes.MsgChannelUpgradeTryResponse{Result: channeltypes.FAILURE}, nil