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

ICS 23 upstream changes #5120

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
46d228a
add client
mossid Jun 7, 2019
65a904a
add counterpartymanager
mossid Jun 11, 2019
070e7d0
fix manager
mossid Jun 11, 2019
99ad6d4
add Is() to counterobject
mossid Jun 11, 2019
9956f0e
add readme, reflect ICS02 revision
mossid Jun 11, 2019
5f63918
reflect downstream ics
mossid Jun 11, 2019
ab3e4e6
test in progress
mossid Jun 13, 2019
e7dde78
add test
mossid Jun 13, 2019
579060f
in progres
mossid Jun 19, 2019
b3f4ef5
fin rebase
mossid Jun 25, 2019
7b74557
in progress
mossid Jun 25, 2019
b596fe1
fin rebase
mossid Jun 25, 2019
d41b984
add CLIObject in progress
mossid Jun 25, 2019
4ed87ef
cli in progress
mossid Jun 26, 2019
276f18c
add CLIObject
mossid Jun 26, 2019
1078211
separate testing from tendermint
mossid Jun 26, 2019
e64a0d2
add key to node
mossid Jun 26, 2019
e2a61ac
add root and storekey to tests/node, add codec
mossid Jun 26, 2019
c6c4c04
rm cli/query.go
mossid Jul 7, 2019
83afdaf
fix test
mossid Jul 7, 2019
21e0b15
fix lint
mossid Jul 7, 2019
203eaf3
fix lint
mossid Jul 7, 2019
0872511
add CLIObject in progress
mossid Jun 25, 2019
fdf09cc
cli in progress
mossid Jun 26, 2019
ae66357
add connection
mossid Jun 7, 2019
7c44da1
fix assertSymmetry
mossid Jun 7, 2019
043de51
fix remote
mossid Jun 10, 2019
b284119
reformat over dependent icss
mossid Jun 11, 2019
33b3b2d
add CounterManager.Query/90
mossid Jun 11, 2019
f835bab
reflect downstream ics
mossid Jun 11, 2019
6437f59
fix
mossid Jun 26, 2019
927a2d0
add test in progress
mossid Jun 26, 2019
c0ca538
add test in progress
mossid Jun 26, 2019
67818d5
add test in progress/
mossid Jun 28, 2019
d5bed42
add test in progress 02
mossid Jun 29, 2019
93f35b8
add test in progress 23
mossid Jun 29, 2019
82d8a7c
handshake test now working
mossid Jun 29, 2019
1b47501
modularize connection in progress
mossid Jul 4, 2019
a2a0233
fix all syntax errors
mossid Jul 5, 2019
2d4c723
test reworking
mossid Jul 5, 2019
20489fb
change connection structure
mossid Jul 7, 2019
0b4eab0
rm sendable/receivable
mossid Jul 7, 2019
9481364
add sendable/receivable method to object
mossid Jul 7, 2019
a3261d7
add checking availabiltiy
mossid Jul 7, 2019
ca9ecbc
add context() in test
mossid Jul 7, 2019
83b9f5a
fix most of lint
mossid Jul 7, 2019
94edc2f
fix lijt
mossid Jul 7, 2019
8da2598
add client
mossid Jun 7, 2019
9a07feb
add counterpartymanager
mossid Jun 11, 2019
1c204dc
fix manager
mossid Jun 11, 2019
6e5346b
add Is() to counterobject
mossid Jun 11, 2019
3370408
add readme, reflect ICS02 revision
mossid Jun 11, 2019
2d43e20
reflect downstream ics
mossid Jun 11, 2019
2bd98e1
test in progress
mossid Jun 13, 2019
0e52a48
add test
mossid Jun 13, 2019
d234530
in progres
mossid Jun 19, 2019
8caf0ba
fin rebase
mossid Jun 25, 2019
9799769
in progress
mossid Jun 25, 2019
e67b97b
fin rebase
mossid Jun 25, 2019
fb375d2
add CLIObject in progress
mossid Jun 25, 2019
092cd74
cli in progress
mossid Jun 26, 2019
9ddab33
add CLIObject
mossid Jun 26, 2019
d1fad94
separate testing from tendermint
mossid Jun 26, 2019
5bc0068
add key to node
mossid Jun 26, 2019
10f8e61
add root and storekey to tests/node, add codec
mossid Jun 26, 2019
eda101a
rm cli/query.go
mossid Jul 7, 2019
5c254fb
fix test
mossid Jul 7, 2019
6ada539
fix lint
mossid Jul 7, 2019
f7e1336
fix lint
mossid Jul 7, 2019
7bd4ba5
add handler/msgs/client
mossid Jul 9, 2019
f750ac4
rm relay
mossid Jul 9, 2019
a3e2f9c
finalize rebase on 23 root/path sep
mossid Jul 11, 2019
56712b1
fix lint, fix syntax
mossid Jul 11, 2019
d56fdbe
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Jul 11, 2019
ea91bb8
finalize rebase on merkle root/path separation
mossid Jul 13, 2019
812d3ab
add path
mossid Jul 13, 2019
02a3b1c
add comments for manual proof arguments
mossid Jul 13, 2019
631d737
pass proofs manually
mossid Jul 13, 2019
5266fc9
add client
mossid Jun 7, 2019
06257bd
add counterpartymanager
mossid Jun 11, 2019
5b089e7
fix manager
mossid Jun 11, 2019
d0f61b0
add Is() to counterobject
mossid Jun 11, 2019
a7b866f
add readme, reflect ICS02 revision
mossid Jun 11, 2019
392e3ab
reflect downstream ics
mossid Jun 11, 2019
5d46c96
test in progress
mossid Jun 13, 2019
b934d57
add test
mossid Jun 13, 2019
2ac7d8c
in progres
mossid Jun 19, 2019
a5d86b7
fin rebase
mossid Jun 25, 2019
acd44f3
in progress
mossid Jun 25, 2019
582fd6d
fin rebase
mossid Jun 25, 2019
cb3081d
add CLIObject in progress
mossid Jun 25, 2019
e48fd1c
cli in progress
mossid Jun 26, 2019
a372f56
add CLIObject
mossid Jun 26, 2019
67b1d73
separate testing from tendermint
mossid Jun 26, 2019
ee95a83
add key to node
mossid Jun 26, 2019
b6865aa
add root and storekey to tests/node, add codec
mossid Jun 26, 2019
631b72d
rm cli/query.go
mossid Jul 7, 2019
b9d8929
fix test
mossid Jul 7, 2019
dbd6b83
fix lint
mossid Jul 7, 2019
f6e5f90
fix lint
mossid Jul 7, 2019
892a120
add handler/msgs/client
mossid Jul 9, 2019
dce1148
rm relay
mossid Jul 9, 2019
26e8038
finalize rebase on 23 root/path sep
mossid Jul 11, 2019
812bea4
fix lint, fix syntax
mossid Jul 11, 2019
176c8ce
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Jul 13, 2019
00df063
fix querying
mossid Jul 13, 2019
19321f1
extract out context withstore
mossid Jul 13, 2019
486e862
fix 02-client test
mossid Jul 13, 2019
67a3e1b
fix 23-commitment test
mossid Jul 13, 2019
8e660ea
add query in progress
mossid Jul 15, 2019
dbd47aa
rm freebase, reformat query
mossid Jul 15, 2019
2369a7c
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Jul 15, 2019
5584ceb
add cli/handler/msg in progress
mossid Jul 15, 2019
503a399
add cli/msg/handler
mossid Jul 17, 2019
3351a6a
add CLIQuery, fix tests
mossid Jul 17, 2019
bed5276
fix golangci
mossid Jul 18, 2019
02a9ba5
add godoc in progress
mossid Jul 30, 2019
b0ca51a
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Jul 30, 2019
54a67b0
modify store
mossid Jul 31, 2019
6be03df
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Jul 31, 2019
e7f6708
cli refactor in progress
mossid Jul 31, 2019
0d134d5
cli refactor in progress
mossid Jul 31, 2019
811b384
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Aug 1, 2019
62b7d75
fix cli / merkle test
mossid Aug 1, 2019
d6fabbd
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Aug 1, 2019
7286fed
fix test
mossid Aug 14, 2019
f81d7b4
fix client
mossid Aug 14, 2019
30aff55
add CLIObject in progress
mossid Jun 25, 2019
9e46e5f
cli in progress
mossid Jun 26, 2019
ee8d154
add test in progress/
mossid Jun 28, 2019
10835cf
handshake test now working
mossid Jun 29, 2019
d7a5c30
in progress
mossid Jun 10, 2019
f951098
in progress
mossid Jun 10, 2019
7a0b255
add send/receive
mossid Jun 11, 2019
e8f16aa
in progress
mossid Jun 11, 2019
833aeab
fix packets
mossid Jun 11, 2019
8893b4b
in progress
mossid Jun 13, 2019
99de876
in progress
mossid Jul 6, 2019
48d9088
in progress
mossid Jul 7, 2019
b991e84
in progress
mossid Jul 7, 2019
9b5b38e
in progress
mossid Jul 7, 2019
ad8b7bf
in progress
mossid Jul 7, 2019
be293be
implement test in progress
mossid Jul 7, 2019
bf1d7f7
send/receive test working
mossid Jul 7, 2019
705b109
fix most of lint
mossid Jul 7, 2019
72090e7
finalize rebase on merkle path / root separatio
mossid Jul 13, 2019
5f57caa
manually pass proofs
mossid Jul 13, 2019
b01c3f9
add msgs/handler in progress
mossid Jul 17, 2019
2ae06c4
add client query/tx
mossid Jul 18, 2019
7ecd360
fix golangci
mossid Jul 18, 2019
33d1760
add MsgReceive
mossid Jul 18, 2019
bf762ba
fix relayer cli
mossid Jul 19, 2019
1061a78
finalize rebase, fix test
mossid Aug 15, 2019
7a863d7
comment out client
mossid Aug 15, 2019
af260c8
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Aug 15, 2019
17f18d7
merge from ics04 branch
mossid Aug 15, 2019
8b876ba
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Aug 15, 2019
e1abf49
merge from ics04 branch
mossid Aug 15, 2019
918c49a
Merge branch 'joon/ics-03-implementation' into joon/ics-04-implementa…
mossid Aug 15, 2019
073a67a
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Aug 15, 2019
eb7f614
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Aug 15, 2019
447eb3b
Merge branch 'joon/ics-03-implementation' into joon/ics-04-implementa…
mossid Aug 15, 2019
df2b7fe
add port
mossid Aug 15, 2019
51303fd
fix test
mossid Aug 15, 2019
c60fd53
add mocks
mossid Aug 21, 2019
ee9bad2
fix connid -> portid in handshake.go
mossid Aug 21, 2019
649ea6e
add mock
mossid Aug 26, 2019
5ea508b
add ibc module.go, finalize mock
mossid Sep 2, 2019
418ec86
add keeper
mossid Sep 2, 2019
0570f84
add StoreKey const
mossid Sep 2, 2019
6d1088f
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Sep 2, 2019
6299864
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Sep 2, 2019
ed6a7db
Merge branch 'joon/ics-03-implementation' into joon/ics-04-implementa…
mossid Sep 2, 2019
fc35efc
Merge branch 'joon/ics-04-implementation' into joon/ibc-sdk-interface
mossid Sep 3, 2019
075f7c9
fix test
mossid Sep 3, 2019
49c3176
Merge branch 'master' of github.com:cosmos/cosmos-sdk into joon/ibc-s…
mossid Sep 3, 2019
bb006fd
Merge branch 'master' of github.com:cosmos/cosmos-sdk into joon/ibc-s…
mossid Sep 12, 2019
08efad1
fix cli errors
mossid Sep 16, 2019
a7df43c
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Sep 17, 2019
acaaaf2
fix dependency
mossid Sep 17, 2019
c18ba68
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Sep 17, 2019
ab71a6e
Merge branch 'joon/ics-03-implementation' into joon/ics-04-implementa…
mossid Sep 17, 2019
4e53dcd
reflect method name change
mossid Sep 17, 2019
70a1c97
Merge branch 'joon/ics-04-implementation' into joon/ibc-sdk-interface
mossid Sep 17, 2019
f88d8d3
revise querier interface to work both on cli & store
mossid Sep 18, 2019
1e64e92
revise querier interface to work both on cli & store
mossid Sep 18, 2019
b4d7491
reflect downstream change
mossid Sep 18, 2019
bb09ad9
Merge branch 'joon/ics-23-implementation' into joon/ics-02-implementa…
mossid Sep 18, 2019
3ba9f9c
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Sep 18, 2019
de1a045
fix cli
mossid Sep 18, 2019
2ef039a
Merge branch 'joon/ics-02-implementation' into joon/ics-03-implementa…
mossid Sep 18, 2019
a600589
reflect downstream changes
mossid Sep 18, 2019
1fd3040
Merge branch 'joon/ics-03-implementation' into joon/ics-04-implementa…
mossid Sep 18, 2019
c90ed2d
reflect downstream changes
mossid Sep 18, 2019
ffed153
Merge branch 'joon/ics-04-implementation' into joon/ibc-sdk-interface
mossid Sep 18, 2019
cbfb043
fix from address in tx cli
mossid Sep 18, 2019
b15a44d
fix cli in progress(squash later)
mossid Sep 19, 2019
8820838
fix cli
mossid Sep 19, 2019
a72f6c5
remove timeout, add channel cli
mossid Sep 20, 2019
4b81cb5
fix golangci
mossid Sep 20, 2019
3866942
fix cli
mossid Sep 20, 2019
6e6c186
Clean up
tnachen Sep 25, 2019
025caf1
fix mock cli in progress
mossid Sep 25, 2019
c289635
Merge branch 'joon/ibc-sdk-interface' of github.com:cosmos/cosmos-sdk…
mossid Sep 25, 2019
1cea7e3
finalize cleanup, mock cli wip
mossid Sep 28, 2019
45dcdb3
add cli for mocksend
mossid Sep 28, 2019
56be11e
fix handler
mossid Sep 28, 2019
10bf523
rename mock packages
mossid Oct 1, 2019
fea2ba6
fix interface for gaia
mossid Oct 1, 2019
8b8bdb3
upstream ICS23 changes
fedekunze Oct 1, 2019
e03034b
conflicts with #4515
fedekunze Oct 1, 2019
5cd8c40
fixes
fedekunze Oct 1, 2019
c717b12
rename
fedekunze Oct 1, 2019
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
19 changes: 11 additions & 8 deletions x/ibc/23-commitment/merkle/merkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var _ commitment.Root = Root{}
// Root is Merkle root hash
// In Cosmos-SDK, the AppHash of the Header becomes Root.
type Root struct {
Hash []byte
Hash []byte `json:"hash"`
}

// NewRoot constructs a new Root
Expand All @@ -46,13 +46,13 @@ var _ commitment.Prefix = Prefix{}
// The constructed key from the Path and the key will be append(Path.KeyPath, append(Path.KeyPrefix, key...))
type Prefix struct {
// KeyPath is the list of keys prepended before the prefixed key
KeyPath [][]byte
KeyPath [][]byte `json:"key_path"`
// KeyPrefix is a byte slice prefixed before the key
KeyPrefix []byte
KeyPrefix []byte `json:"key_prefix"`
}

// NewPath() constructs new Prefix
func NewPath(keypath [][]byte, keyprefix []byte) Prefix {
// NewPrefix constructs new Prefix instance
func NewPrefix(keypath [][]byte, keyprefix []byte) Prefix {
return Prefix{
KeyPath: keypath,
KeyPrefix: keyprefix,
Expand All @@ -64,12 +64,16 @@ func (Prefix) CommitmentKind() string {
return merkleKind
}

func (prefix Prefix) Key(key []byte) []byte {
return join(prefix.KeyPrefix, key)
}

var _ commitment.Proof = Proof{}

// Proof is Merkle proof with the key information.
type Proof struct {
Proof *merkle.Proof
Key []byte
Proof *merkle.Proof `json:"proof"`
Key []byte `json:"key"`
}

// Implements commitment.Proof
Expand Down Expand Up @@ -114,6 +118,5 @@ type Value interface {
}

func NewProofFromValue(proof *merkle.Proof, prefix []byte, value Value) Proof {
// TODO: check HasPrefix
return Proof{proof, bytes.TrimPrefix(value.KeyBytes(), prefix)}
}
2 changes: 1 addition & 1 deletion x/ibc/23-commitment/merkle/merkle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestStore(t *testing.T) {
storeName := k.Name()
prefix := []byte{0x01, 0x03, 0x05, 0xAA, 0xBB}
mapp := state.NewMapping(k, cdc, prefix)
path := NewPath([][]byte{[]byte(storeName)}, prefix)
path := NewPrefix([][]byte{[]byte(storeName)}, prefix)

m := make(map[string][]byte)
kvpn := 10
Expand Down
40 changes: 40 additions & 0 deletions x/ibc/23-commitment/merkle/utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package merkle

import (
"errors"

abci "github.com/tendermint/tendermint/abci/types"

"github.com/cosmos/cosmos-sdk/store/types"
)

func QueryMultiStore(cms types.CommitMultiStore, storeName string, prefix []byte, key []byte) ([]byte, Proof, error) {
queryable, ok := cms.(types.Queryable)
if !ok {
panic("CommitMultiStore not queryable")
}
qres := queryable.Query(RequestQueryMultiStore(storeName, prefix, key))
if !qres.IsOK() {
return nil, Proof{}, errors.New(qres.Log)
}

return qres.Value, Proof{Key: key, Proof: qres.Proof}, nil
}

func RequestQueryMultiStore(storeName string, prefix []byte, key []byte) abci.RequestQuery {
// Suffixing path with "/key".
// iavl.Store.Query() switches over the last path element,
// and performs key-value query only if it is "/key"
return abci.RequestQuery{
Path: "/" + storeName + "/key",
Data: join(prefix, key),
Prove: true,
}
}

func join(a, b []byte) (res []byte) {
res = make([]byte, len(a)+len(b))
copy(res, a)
copy(res[len(a):], b)
return
}
2 changes: 1 addition & 1 deletion x/ibc/23-commitment/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Store interface {
Prove(path, value []byte) bool
}

var _ Store = (*prefix)(nil)
var _ Store = prefix{}

type prefix struct {
store Store
Expand Down