Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: Removing restorechannel and adding SetUpgradeErrorReceipt #5405

Merged
merged 366 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
366 commits
Select commit Hold shift + click to select a range
7f3b04d
Add a check for connection state in UpgradeAck. (#3954)
DimitrisJim Jun 28, 2023
86bb6bf
update WriteUpgradeTry to change flush status to `FLUSHCOMPLETE` if t…
charleenfei Jun 28, 2023
16ed527
Add flush status check in SendPacket (#3912)
chatton Jun 28, 2023
32930e7
Add ChanUpgradeOpen core handler. (#3844)
DimitrisJim Jun 29, 2023
a7793bc
Add flushing check to WriteUpgradeAckChannel (#3976)
chatton Jun 30, 2023
e81d2f8
remove depguard from golangci-lint (#4000)
chatton Jul 4, 2023
25fcad4
Set channel state to NOTINFLUSH when Closing (#3995)
chatton Jul 5, 2023
5767ad7
Set Counterparty Last Sequence Send (#4005)
chatton Jul 5, 2023
92f9e56
Add FlushStatus Checks to RecvPacket (#3914)
chatton Jul 5, 2023
118cb71
Add implementation for message server handling of ChanUpgradeOpen. (#…
DimitrisJim Jul 5, 2023
c249e1e
helper function for validating a counterparty upgrade against the sel…
chatton Jul 5, 2023
05c43dc
Make AbortUpgrade panic on failure (#4011)
chatton Jul 6, 2023
dffdb92
Amend AcknowledgePacket to handle flushing (#3922)
DimitrisJim Jul 6, 2023
3203f07
Amend timeout to handle in-flight packets. (#3923)
DimitrisJim Jul 6, 2023
641ad00
change comment
Jul 8, 2023
ef239b4
chore: adding callback for OnChanUpgradeRestore in abort scenarios (#…
damiannolan Jul 10, 2023
fcd8ded
Pass in counterparty portID, channelID when verifying channel in Chan…
DimitrisJim Jul 12, 2023
af76ade
Remove manual setting of flush status in ChanUpgradeOpen. (#4064)
DimitrisJim Jul 12, 2023
8e53c77
Use counterparty portid, channelid when verifying channel upgrade err…
DimitrisJim Jul 13, 2023
f731de5
feat: adding `OnChanUpgradeInit` handler implementation to `29-fee` (…
damiannolan Jul 17, 2023
0e7e57e
feat: adding `OnChanUpgradeTry` handler implementation for `29-fee` (…
damiannolan Jul 17, 2023
42c79ad
feat: adding `OnChanUpgradeAck` handler implementation to `29-fee` (#…
damiannolan Jul 18, 2023
82ea953
Use counterparty connection hops when verifying channel state (#4074)
DimitrisJim Jul 19, 2023
dcc004f
chore: adding comment to 29-fee OnChanUpgradeOpen callback (#4123)
damiannolan Jul 19, 2023
c39b53e
Add tests for WriteUpgradeOpenChannel. (#4077)
DimitrisJim Jul 19, 2023
98db69b
Add tests for WriteUpgradeCancel. (#4076)
DimitrisJim Jul 19, 2023
ac1acbb
Move channel to OPEN if all in-flight packets have been flushed in Up…
DimitrisJim Jul 19, 2023
347346b
imp: use HasInflightPackets to check if channel has finished flushing…
DimitrisJim Jul 20, 2023
c2bd97b
feat: adding `OnChanUpgradeInit` implementation to transfer (#4126)
damiannolan Jul 24, 2023
edd0cc1
Remove superfluous ignore directive. (#4158)
DimitrisJim Jul 24, 2023
ec2a8c8
feat: adding OnChanUpgradeTry implementation to transfer (#4137)
damiannolan Jul 24, 2023
ace3acd
Call app callback after writting state in Cancel and Timeout. (#4166)
DimitrisJim Jul 24, 2023
4072cbd
helper function to clear state stored during an upgrade (#4147)
Jul 24, 2023
d9e8131
add `IsUpgradError` func for readability (#4144)
Jul 25, 2023
65511d2
add check that channel exists in upgrade gRPCs (#4156)
Jul 25, 2023
f3c9539
consistent connection lookup calls in 04-channel (#4146)
Jul 27, 2023
e00fb0f
nit: error formatting improvements for channel upgrades (#4097)
Jul 27, 2023
bf87c3d
added test for event emission (#4020)
chatton Aug 2, 2023
4c3e57e
feat: implement `OnChanUpgradeAck` for transfer (#4215)
damiannolan Aug 2, 2023
c862d24
refactor: simplify OnChanUpgradeTry transfer testing to call module c…
damiannolan Aug 2, 2023
157896d
test: adding test for events in channel upgrade try (#4226)
chatton Aug 3, 2023
e7c54e5
Add store functions for counterparty upgrade. (#4293)
DimitrisJim Aug 7, 2023
9886cbd
Add FLUSHING/FLUSHCOMPLETE to Channel state. (#4300)
DimitrisJim Aug 7, 2023
99a537d
feat: adding `ChannelUpgradeConfirm` rpc and msgs (#4302)
damiannolan Aug 8, 2023
7735de1
chore: move verification before startFlushUpgradeHandshake (#4285)
chatton Aug 8, 2023
d5e63d4
rebase `04-channel-upgrades` branch (#4160)
Aug 8, 2023
a8b36fa
Revert "rebase `04-channel-upgrades` branch (#4160)"
damiannolan Aug 8, 2023
200f4b5
Merge branch 'main' into 04-channel-upgrades
damiannolan Aug 8, 2023
3dac601
rm unnecessary test matrix file
damiannolan Aug 8, 2023
a02c059
make lint-fix
damiannolan Aug 8, 2023
2f25298
satisfy revive linter
damiannolan Aug 8, 2023
18b64e8
updating feature banch ci workflow for golangci-lint
damiannolan Aug 8, 2023
ac86b3d
bumping golangci-lint action to v3.6.0
damiannolan Aug 8, 2023
1daa1d8
define go version as string in workflow
damiannolan Aug 8, 2023
5721b4d
Delete counterparty upgrade in deleteUpgradeInfo. Move function to ke…
DimitrisJim Aug 8, 2023
e7d651d
Remove check for counterparty timeout in ChanUpgradeTry. (#4301)
DimitrisJim Aug 8, 2023
9d9fb4e
Store counterparty upgrade after ack finishes. (#4299)
DimitrisJim Aug 9, 2023
8fa23dc
call verification of counterparty channel, upgrade in upgradetry. (#4…
DimitrisJim Aug 9, 2023
e7ea589
Add verification calls in ChanUpgradeAck. (#4312)
DimitrisJim Aug 9, 2023
99282a4
Add ChanUpgradeConfirm to endpoint. (#4314)
DimitrisJim Aug 10, 2023
b7573a3
Merge branch 'main' into 04-channel-upgrades
damiannolan Aug 10, 2023
ce03b99
Remove verification calls in StartFlushUpgradeHandshake (#4317)
DimitrisJim Aug 10, 2023
edef7c9
test: add events test for ChannelUpgradeTimeout (#4284)
chatton Aug 14, 2023
b048943
test: add event emission test for ChanUpgradeCancel (#4281)
chatton Aug 14, 2023
0d6d9f1
Check counterparty timeout hasn't elapsed in ChanUpgradeAck. (#4305)
DimitrisJim Aug 15, 2023
5478216
refactor: modify `ChannelUpgradeInit` to only store upgrade fields (#…
damiannolan Aug 15, 2023
4bb551c
Add test for event emission ChanUpgradeAck (#4228)
chatton Aug 15, 2023
65c5a7e
Adding test for events for ChanUpgradeOpen (#4230)
chatton Aug 15, 2023
2b221e6
Move check to fail on incompatible upgrade after proof verification. …
DimitrisJim Aug 15, 2023
d5b35a7
Add functions checkForUpgradeCompatibility and syncUpgradeSequence (#…
chatton Aug 16, 2023
7cd3ddf
refactor: modify upgrade init to not change channel state (#4357)
damiannolan Aug 16, 2023
f648383
refactor: cleanup upgrade init app callback args (#4359)
damiannolan Aug 16, 2023
e6139d0
Add WriteUpgradeConfirm function. (#4303)
DimitrisJim Aug 16, 2023
09e144c
Modify startFlushUpgradeHandshake to be used as a write function (#4360)
chatton Aug 16, 2023
bf37961
Remove restore logic in upgrade TRY handler (#4362)
chatton Aug 17, 2023
b43711d
refactor: remove `FlushStatus` from ack handler and msg (#4364)
damiannolan Aug 17, 2023
61d9853
Amend checkForUpgradeCompatibility to check that versions match (#4366)
DimitrisJim Aug 17, 2023
cd62620
refactor: modify ack handler expected channel state (#4371)
damiannolan Aug 17, 2023
e2c8326
Channel Upgrade Ack (#4372)
chatton Aug 17, 2023
2e8b370
feat: adding `chanUpgradeConfirm` implementation to `04-channel` (#4373)
damiannolan Aug 17, 2023
cd250cb
feat: adding msg server implementation for `ChanUpgradeConfirm` (#4376)
damiannolan Aug 17, 2023
e78a308
Remove check on flush status for send packet. (#4384)
DimitrisJim Aug 18, 2023
c0fd304
Channel Upgrade Open (#4379)
chatton Aug 21, 2023
0f431ca
Implement Channel Upgrade Cancel (#4404)
chatton Aug 22, 2023
2c17724
Refactor `TestWriteUpgradeCancelChannel` (#4424)
ThanhNhann Aug 23, 2023
5c12378
Refactor `TestWriteUpgradeOpenChannel` (#4431)
ThanhNhann Aug 23, 2023
f1e8ae8
refactor: acknowledgePacket handling flushing / flush complete state …
damiannolan Aug 23, 2023
f230633
Add UpgradeTimeout as a params field in the channel submodule (#4411)
chatton Aug 23, 2023
5b1071d
Refactor TestWriteUpgradeTry to remove flush status checks (#4430)
chatton Aug 24, 2023
9c54f23
refactor: use `expResult` in acknowledgePacket tests (#4439)
damiannolan Aug 24, 2023
7302d9b
Implement ChanUpgradeTimeout with spec changes (#4438)
chatton Aug 24, 2023
9372c6c
Amend recvPacket as per spec. (#4386)
DimitrisJim Aug 24, 2023
d6469e0
Update error receipt event emission to use correct event type (#4451)
chatton Aug 24, 2023
f638139
Account for moving channel state to flush complete in timeout process…
chatton Aug 24, 2023
b1131d2
Remove init, try, ack upgrade states (#4455)
chatton Aug 24, 2023
b1ef4c1
refactor: remove `FlushStatus` from channel end (#4457)
damiannolan Aug 24, 2023
404da25
Refactor channel upgradability msgs to reflect updated spec (#4456)
chatton Aug 24, 2023
9d7ddac
Amend timeoutPacket to allow timeouts on any channel state. (#4367)
DimitrisJim Aug 24, 2023
656e1e1
Refactor recvPacket tests to use expError. (#4471)
DimitrisJim Aug 28, 2023
03c55bd
refactor: remove counterparty last sequence send state entry (#4473)
damiannolan Aug 28, 2023
9401a2b
Don't write channel to state when not modified. (#4495)
DimitrisJim Aug 29, 2023
5847b84
refactor: rename channel upgradability flush states (#4488)
damiannolan Aug 29, 2023
0369df2
Don't emit event information for unchanged upgrade. (#4492)
DimitrisJim Aug 29, 2023
efd4321
Add tests for WriteUpgradeConfirm. (#4490)
DimitrisJim Aug 29, 2023
d1df1c6
Allow receiving of packets if the counterparty latest sequence send h…
DimitrisJim Aug 29, 2023
22dc59d
chore: re-enable disabled test case in `chanUpgradeTry` (#4501)
damiannolan Aug 29, 2023
5b58962
Resolve commented out testcases for Channel Upgrades (#4474)
chatton Aug 29, 2023
312d217
refactor: adding additional upgrade fields args to onChanUpgradeOpen …
damiannolan Aug 30, 2023
0851a7a
tests: adding followup tests for in-flight packets on chanUpgradeConf…
damiannolan Aug 30, 2023
c67918f
Use only timestamp only for upgrade timeouts. (#4482)
chatton Aug 30, 2023
b5a3937
Timing out packets on ordered channels when in flushing state aborts …
chatton Aug 30, 2023
f035200
Change UpgradeTimeout to from absolute to relative (#4511)
chatton Aug 30, 2023
e8f9268
refactor: fee middleware onChanUpgradeInit callback (#4514)
damiannolan Aug 30, 2023
633de7e
refactor: fee middleware onChanUpgradeTry callback (#4515)
damiannolan Aug 30, 2023
23a16f2
refactor: implementation for onChanUpgradeAck ics29 (#4523)
damiannolan Aug 31, 2023
81be4fe
feat: adding fee middleware onChanUpgradeOpen callback impl (#4524)
damiannolan Aug 31, 2023
10a6b0c
Merge branch 'main' into 04-channel-upgrades
chatton Sep 4, 2023
b0cb9f1
Merge branch 'main' into 04-channel-upgrades
chatton Sep 5, 2023
a1db4e0
test: adding integration test for fee transfer channel upgrade (#4533)
damiannolan Sep 26, 2023
4383d62
Merge branch 'main' into 04-channel-upgrades
chatton Sep 26, 2023
63c3010
Merge branch 'main' into 04-channel-upgrades
damiannolan Sep 26, 2023
b6e9bd2
fix: check that `MsgChannelUpgradeInit` is signed by authority (#4773)
charleenfei Oct 6, 2023
75da9f5
Chore: consistent argument order (#4545)
ThanhNhann Oct 6, 2023
658b00f
Add ParseProposalIDFromEvents helper function (#4942)
ThanhNhann Oct 25, 2023
34cbe05
imp: remove `LatestSequenceSend` (#5108)
sangier Nov 14, 2023
fa3f92f
chore: rebase 04-channel-upgrades feature branch (#5085)
Nov 15, 2023
081646c
chore: propagate IBC authority to 04-channel keeper to be used within…
charleenfei Nov 22, 2023
b41b510
Merge branch 'main' into 04-channel-upgrades
chatton Nov 22, 2023
6b9d1e9
Amend validation of upgrade fields to use variable holding supported …
DimitrisJim Nov 22, 2023
ee240e2
refactor: adapt testing endpoint query for channel upgrade proofs (#5…
damiannolan Nov 27, 2023
690e885
test: adding test for crossing hello trys with historical proofs (#5143)
damiannolan Nov 27, 2023
39df8d2
chore: replace dummy error with correct error type (#5177)
chatton Nov 28, 2023
afc82cd
Remove incorrect godoc (#5203)
chatton Nov 29, 2023
0cfd4e5
chore: correct returned error (#5205)
chatton Nov 29, 2023
bbfbcc4
chore: adding comment to add clarity to returned upgrade (#5214)
chatton Nov 29, 2023
4cfd509
Verify channel upgrade can be completed after cancellation is success…
chatton Nov 29, 2023
6fb0f79
Remove last packet sent from new upgrade constructor. (#5210)
DimitrisJim Nov 29, 2023
743b6da
Reorder call to application callback so it happens after we write sta…
DimitrisJim Nov 29, 2023
30fb5af
chore: allow authorized senders to submit empty error receipt proof (…
chatton Nov 29, 2023
6506d9d
remove incorect code (#5235)
GNaD13 Nov 29, 2023
fa97576
chore: panic instead of return err (#5246)
hieuvubk Nov 29, 2023
b3c5164
chore: add comment about version assignment (#5239)
chatton Nov 30, 2023
eaabb85
Add to docstring with explanation about channel state (#5236)
chatton Nov 30, 2023
ff90976
Chore: replace `fmt.Sprintf` with `fmt.Errorf` in `upgrades.go` (#5291)
ThanhNhann Dec 1, 2023
63d7fc1
fix: add event and event emission for `FLUSHCOMPLETE` (#5245)
sontrinh16 Dec 1, 2023
3c396ee
Remove setting counterparty upgrade info in upgrade try (#5238)
chatton Dec 3, 2023
f23dfef
fix: allow error receipt to be nil in case of the msg sender is the a…
charleenfei Dec 4, 2023
d4d01d5
Added the MetadataFromVersion function
vishal-kanna Dec 4, 2023
4e85359
Merge branch '04-channel-upgrades' into 04-channel-upgrades
vishal-kanna Dec 4, 2023
25c8247
Move events to message server layer instead of core level (#5264)
chatton Dec 4, 2023
fcaf520
use function in a few other places, fix typo in function name, fix test
Dec 4, 2023
dbb7ad8
Merge branch '04-channel-upgrades' into 04-channel-upgrades
Dec 4, 2023
5dfb933
review comment
Dec 4, 2023
a394cc6
imp: use MetadataFromVersion function in 27-interchain-accounts (#5300)
vishal-kanna Dec 5, 2023
181bd1a
remove channel id (#5307)
GNaD13 Dec 5, 2023
f48f46d
remove comment that unused (#5308)
GNaD13 Dec 5, 2023
b3ecc31
Implement OnChanUpgradeInit on Controller Chain for interchain-accoun…
chatton Dec 5, 2023
b193740
Add a helper function to create a mock contract. (#5162)
DimitrisJim Nov 22, 2023
f620584
docs: improved channel closure docs (#5170)
srdtrk Nov 27, 2023
1b67482
chore: use `GetPrefixedDenom` to create IBC token denom (#5175)
0xstepit Nov 27, 2023
fa2b6c8
build(deps): Bump DavidAnson/markdownlint-cli2-action from 13 to 14 (…
dependabot[bot] Nov 27, 2023
63e9660
docs: readme improvements (#5171)
Nov 27, 2023
147f976
chore(08-wasm): `Pin` code during app initialisation (#5161)
vuong177 Nov 28, 2023
e784660
e2e: timeout transfer with grandpa light client (#5018)
charleenfei Nov 28, 2023
cd1684a
Change to StoreCodeUnchecked in Genesis and snapshotter (#5167)
GNaD13 Nov 28, 2023
89514b1
build(deps): Bump JamesIves/github-pages-deploy-action from 4.4.3 to …
dependabot[bot] Nov 28, 2023
d3acbcd
build(deps): Bump github.com/hashicorp/go-metrics from 0.5.2 to 0.5.3…
dependabot[bot] Nov 28, 2023
920670d
build(deps): Bump github.com/cometbft/cometbft from 0.38.1 to 0.38.2 …
dependabot[bot] Nov 28, 2023
a7a6de2
build(deps): Bump github.com/spf13/cast from 1.5.1 to 1.6.0 (#5181)
dependabot[bot] Nov 28, 2023
0f414ce
docs: add IBC overview diagram (#5166)
Nov 28, 2023
24d0a25
Drop step installing tparse. (#5191)
DimitrisJim Nov 28, 2023
42b3bf2
Add capability to dependabot. (#5193)
DimitrisJim Nov 28, 2023
b81f11b
build(deps): Bump sigs.k8s.io/yaml in /modules/capability (#5194)
dependabot[bot] Nov 28, 2023
58fb0fe
build(deps): Bump github.com/cometbft/cometbft in /modules/capability…
dependabot[bot] Nov 28, 2023
52bc5bd
build(deps): Bump cosmossdk.io/store from 1.0.0 to 1.0.1 (#5199)
dependabot[bot] Nov 29, 2023
fe77a0f
update mergify labels for 08-wasm release branches
Nov 29, 2023
afd5b52
imp: use bytes in wasm contract api instead of wrapped types (#5154)
Nov 30, 2023
1d56642
build(deps): Bump docker/metadata-action from 5.0.0 to 5.1.0 (#5277)
dependabot[bot] Nov 30, 2023
52d2aa1
Add workflow to build wasm simapp (#5286)
chatton Nov 30, 2023
30ba757
ci: workflow to trigger wasm E2Es with a specific tag (#5288)
chatton Nov 30, 2023
4575cc3
feat: add custom queries to wasm module (#5261)
aeryz Dec 1, 2023
3dfbf1c
mergify task for callbacks v0.2.x and ibc-go v8.0.x (#5295)
Dec 1, 2023
9a67c36
build(deps): Bump docker/metadata-action from 5.1.0 to 5.2.0 (#5297)
dependabot[bot] Dec 1, 2023
1ecb112
Update CODEOWNERS for 08-wasm (#5296)
DimitrisJim Dec 4, 2023
a1ae8ea
update roadmap
Dec 4, 2023
6a4493c
build(deps): Bump docker/metadata-action from 5.2.0 to 5.3.0 (#5301)
dependabot[bot] Dec 4, 2023
be5ecc6
Don't panic during any store operations. (#5294)
DimitrisJim Dec 4, 2023
b4f9340
Support wasm tests on forks (#5234)
chatton Dec 4, 2023
c3ab069
docs: remove redundant code examples (#5309)
lukema95 Dec 5, 2023
c1fe926
fix: remove 08-wasm from 02-client exported (#5306)
Dec 5, 2023
21a1729
Remove pr labeler. (#5302)
DimitrisJim Dec 5, 2023
9eef6ac
Merge branch 'main' into 04-channel-upgrades
damiannolan Dec 5, 2023
4a3d0a5
fix: require authority to pass proof if channel state is in FLUSHCOMP…
charleenfei Dec 7, 2023
73181ec
docs: document MsgChannelUpgradeCancel (#5274)
chatton Dec 7, 2023
1dfc9b7
ChannelUpgradeInit refactor (#5289)
hieuvubk Dec 7, 2023
d6ca63e
Merge branch 'main' into 04-channel-upgrades
Dec 9, 2023
fed5372
Implement OnChanUpgradeTry on Host Chain for interchain-accounts (#5144)
chatton Dec 11, 2023
b36d112
Merge branch 'main' into 04-channel-upgrades
Dec 11, 2023
0f8b4f8
Remove `GetSigners` from module 04-channel (#5352)
ThanhNhann Dec 11, 2023
40ace04
fix markdown lint error
Dec 11, 2023
e1d4b20
Merge branch 'main' into 04-channel-upgrades
Dec 11, 2023
8865e29
imp: rm app upgrade interface from IBCModule and use type assertions …
damiannolan Dec 12, 2023
6718e3c
Implement OnChanUpgradeAck on Controller Chain for interchain-account…
chatton Dec 12, 2023
dc9ff35
Merge branch '04-channel-upgrades' of https://github.com/cosmos/ibc-g…
vishal-kanna Dec 12, 2023
a7c37f0
Merge branch '04-channel-upgrades' of https://github.com/vishal-kanna…
vishal-kanna Dec 12, 2023
b3f5fc1
update error strings
Dec 13, 2023
a99c84c
chore: adding interface assertions for app upgrade interface (#5390)
damiannolan Dec 13, 2023
0323942
Make sure that the error receipt we write always has a sequence great…
chatton Dec 13, 2023
9c0ca86
Merge branch '04-channel-upgrades' of https://github.com/cosmos/ibc-g…
vishal-kanna Dec 13, 2023
09ad8bb
chore : removed the restoreChannel method and added SetUpgradeErrorRe…
vishal-kanna Dec 13, 2023
baa0318
refactor: remove unnecessary decrement when fast forwarding upgrade s…
ThanhNhann Dec 13, 2023
20ae53a
Merge branch 'main' into 04-channel-upgrades
Dec 13, 2023
72a3d09
Allow verification of channels on TimeoutonClose and ChanCloseConfirm…
DimitrisJim Dec 14, 2023
355d401
imp: add passthrough handlers for callbacks mw module (#5376)
charleenfei Dec 14, 2023
3eef53f
Remove ResponseResult from UpgradeTimeout response, channel-id from U…
DimitrisJim Dec 14, 2023
da415f5
fix: set upgrade sequence correctly in channel recovery (#5374)
charleenfei Dec 14, 2023
d6408a3
docs: `ChanUpgradeInit` and governance gating (#5347)
charleenfei Dec 14, 2023
868ec7f
Add key for pruning sequence, get/set ops for storing/getting it. (#5…
DimitrisJim Dec 14, 2023
1ccb724
Add proto message for pruning acks, msgs, stubs for keeper/msg-server…
DimitrisJim Dec 14, 2023
9732694
chore: resolved merge conflicts
vishal-kanna Dec 16, 2023
914a78d
feat: add grpc/CLI for channel params query (#5430)
Dec 18, 2023
c88abcc
e2e: successful test where the channel is upgraded and fee middleware…
Dec 18, 2023
7967cfd
chore: update channel upgrades default timeout to 10 mins (#5433)
damiannolan Dec 18, 2023
beb46ae
imp: add upgrade sequence to identified channel (#5436)
Dec 18, 2023
4d2ce43
docs: reasoning and use cases for channel upgradability (#5346)
charleenfei Dec 18, 2023
9c346c5
revert "imp: remove `LatestSequenceSend` (#5108)" (#5432)
charleenfei Dec 18, 2023
9782bef
disallow ICA upgrades that change channel order + increase test cover…
Dec 18, 2023
7445417
panic wrap error
Dec 19, 2023
26fbb37
Merge branch 'main' into 04-channel-upgrades
Dec 19, 2023
5ec221a
refactor: restructure timeout type (#5404)
colin-axner Dec 19, 2023
2ef99d1
Move order check in keeper function for host/controller. (#5464)
DimitrisJim Dec 20, 2023
5bad8f2
Pass appVersion to callback if version can be parsed. (#5468)
DimitrisJim Dec 20, 2023
ef9a479
Move cast to Upgradable module after checking app is set. (#5465)
DimitrisJim Dec 20, 2023
ab1f96f
ICS4: Fix Sequencing logic in UpgradeTry (#5419)
AdityaSripal Dec 20, 2023
21a2cbf
Add implementations for OnChanUpgradeOpen and OnChanUpgradeRestore fo…
DimitrisJim Dec 20, 2023
34edc2e
imp: add logic for setting `NextSeqRecv`, `NextSeqAck` in `OnChanUpgr…
charleenfei Dec 20, 2023
bb58693
check counterparty `nextSequenceSend` in `recvPacket` (#5469)
Dec 20, 2023
45278cc
Merge branch '04-channel-upgrades' into removing-restorechannel
Dec 20, 2023
53c0c52
Update keeper.go
Dec 20, 2023
4c37a70
Update metadata.go
Dec 20, 2023
09c4de8
update swagger
Dec 21, 2023
6c0db8d
Merge branch 'main' into 04-channel-upgrades
Dec 21, 2023
b96513b
Merge branch '04-channel-upgrades' into removing-restorechannel
Dec 21, 2023
a095777
refactor tests to use write error receipt where possible
Dec 21, 2023
01c3699
Add pruning logic, implementation in message server. (#5444)
DimitrisJim Dec 21, 2023
df57fc4
Merge branch '04-channel-upgrades' into removing-restorechannel
Dec 21, 2023
271a2d5
Merge branch 'main' into removing-restorechannel
Dec 21, 2023
0f313e4
Merge branch 'main' into removing-restorechannel
Jan 1, 2024
f98a893
Merge branch 'main' into removing-restorechannel
chatton Jan 4, 2024
3c4f25d
Merge branch 'main' into removing-restorechannel
Jan 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/core/03-connection/keeper/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,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())
Expand Down Expand Up @@ -798,8 +798,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())
},
Expand Down
6 changes: 3 additions & 3 deletions modules/core/04-channel/keeper/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion modules/core/04-channel/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions modules/core/04-channel/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions modules/core/04-channel/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 11 additions & 9 deletions modules/core/04-channel/keeper/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand All @@ -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))
Expand All @@ -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)
}
7 changes: 3 additions & 4 deletions modules/core/04-channel/keeper/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand Down Expand Up @@ -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,
},
Expand All @@ -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)"),
},
Expand Down
3 changes: 1 addition & 2 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading