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

ADR 015 Implementation #5401

Merged
merged 39 commits into from
Jan 14, 2020
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
66b5f56
implement in progress
mossid Dec 12, 2019
54d329a
rm unneccessary change under simapp, modify baseapp for codetxbreak
mossid Dec 12, 2019
4ddd022
fix test in progress
mossid Dec 12, 2019
764c02c
Merge branch 'ibc-alpha' of github.com:cosmos/cosmos-sdk into joon/ad…
mossid Dec 20, 2019
0bc1dd2
fix test error
mossid Dec 20, 2019
70a2ba6
fix golangci
mossid Dec 20, 2019
07f9d57
address minor comments
mossid Jan 2, 2020
4f6e9f0
mv antehandler to ante/, address comments
mossid Jan 2, 2020
1eb8e77
fix GetCommitment => GetData, fix syntax
mossid Jan 3, 2020
43e5cc8
Merge branch 'ibc-alpha' of github.com:cosmos/cosmos-sdk into joon/ad…
mossid Jan 7, 2020
2ed95bd
Merge branch 'ibc-alpha' of github.com:cosmos/cosmos-sdk into joon/ad…
mossid Jan 7, 2020
df4676e
checkout types/ to ibc-alpha
mossid Jan 7, 2020
c527db2
checkout to origin/ibc-alpha
mossid Jan 7, 2020
974c8ea
fix branch problem
mossid Jan 7, 2020
bc13263
fix syntax error
mossid Jan 7, 2020
3f6b012
recover PacketI interface
mossid Jan 7, 2020
9aee39d
mv recvpacket rest from 20 -> 04
mossid Jan 7, 2020
e1ab431
address minor comments
mossid Jan 8, 2020
12bd7ef
Apply suggestions from code review
mossid Jan 8, 2020
a868338
rm wrong files
mossid Jan 8, 2020
425f9c4
Apply suggestions from code review
fedekunze Jan 8, 2020
e5f6d51
PacketDataI field is now named, not embed
mossid Jan 9, 2020
6cfb61c
Merge branch 'joon/adr-015-impl-3' of github.com:cosmos/cosmos-sdk in…
mossid Jan 9, 2020
84d07cc
add acknowledgement hashing
mossid Jan 9, 2020
82f51c0
rename finalization functiosn
mossid Jan 10, 2020
0d2e9c9
Apply suggestions from code review
cwgoes Jan 10, 2020
568de83
Rename GetCommitment() to GetBytes()
cwgoes Jan 10, 2020
4c5615c
Add recv sequence incr to RecvPacket()
cwgoes Jan 10, 2020
158bd7a
Revert but where is PacketExecuted() called
cwgoes Jan 10, 2020
b483944
Call PacketExecuted(), check seq in RecvPacket()
cwgoes Jan 10, 2020
e42404a
The port is called "bank"
cwgoes Jan 10, 2020
05073c8
Apply suggestions from code review
cwgoes Jan 10, 2020
115fa5e
Update simapp/app.go
cwgoes Jan 10, 2020
415d6da
Remove omitempty
cwgoes Jan 10, 2020
a2d30b6
Add godoc
cwgoes Jan 10, 2020
f358a63
Move events
cwgoes Jan 10, 2020
2c91a6e
set ProofVerificationDecorator on AnteHandler
fedekunze Jan 14, 2020
1339b55
Apply suggestions from code review
cwgoes Jan 14, 2020
4bea0ef
format
fedekunze Jan 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add recv sequence incr to RecvPacket()
  • Loading branch information
cwgoes committed Jan 10, 2020
commit 4c5615cab0bef71cd4049ff17d1a3c83eb97bbb1
18 changes: 18 additions & 0 deletions x/ibc/04-channel/keeper/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,24 @@ func (k Keeper) RecvPacket(
)
}

if channel.Ordering == types.ORDERED {
nextSequenceRecv, found := k.GetNextSequenceRecv(ctx, packet.GetDestPort(), packet.GetDestChannel())
if !found {
return nil, types.ErrSequenceReceiveNotFound
}

if packet.GetSequence() != nextSequenceRecv {
return nil, sdkerrors.Wrapf(
types.ErrInvalidPacket,
"packet sequence ≠ next receive sequence (%d ≠ %d)", packet.GetSequence(), nextSequenceRecv,
)
}

nextSequenceRecv++

k.SetNextSequenceRecv(ctx, packet.GetDestPort(), packet.GetDestChannel(), nextSequenceRecv)
}

if uint64(ctx.BlockHeight()) >= packet.GetTimeoutHeight() {
return nil, types.ErrPacketTimeout
}
Expand Down