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

x/ibc proto migration #5704

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
e59c32d
proto: remove cdc from ICS05
fedekunze Feb 26, 2020
6ef884f
proto: start ICS07 proto files
fedekunze Feb 26, 2020
85cc953
proto: ICS20 types
fedekunze Feb 26, 2020
d172449
proto: ICS07 messages
fedekunze Feb 26, 2020
796fe70
proto: ICS04 messages
fedekunze Feb 26, 2020
8a38c3e
proto: various ICS proto definitions
fedekunze Feb 26, 2020
a1c9ae0
proto: fixes
fedekunze Feb 26, 2020
fad6b52
godocs for ICS 07 proto file
fedekunze Feb 27, 2020
8b83fb1
proto: generate files
fedekunze Feb 27, 2020
43e38d6
merge ICS23 changes
fedekunze Mar 2, 2020
d574210
merge ibc-alpha changes
fedekunze Mar 23, 2020
5510c34
ibc: protobuf changes
fedekunze Mar 23, 2020
2d251e4
codec: move ibc client proto interfaces
fedekunze Mar 23, 2020
fc70c2e
ibc: fix some msgs and types
fedekunze Mar 23, 2020
8da8960
proto: cycles and other fixes
fedekunze Mar 24, 2020
0db08a3
proto: changes and fixes
fedekunze Mar 24, 2020
5a5816f
update types
fedekunze Mar 24, 2020
fa84a19
merge ibc-alpha changes
fedekunze Mar 24, 2020
ff66afb
fix dep cycle
fedekunze Mar 25, 2020
dfe061d
codec/std: add msgs
fedekunze Mar 25, 2020
3475fca
commitment: proto changes
fedekunze Mar 25, 2020
ee12807
fix dep cycle with Status and Order
fedekunze Mar 25, 2020
daf8f01
add tmtypes proto3 to third party
fedekunze Mar 25, 2020
ccdb13b
fixes fixes fixes
fedekunze Mar 27, 2020
94a62ca
revert GetDestination{Channel.Port}
fedekunze Mar 27, 2020
01d4651
cleanup
fedekunze Mar 27, 2020
934a576
fixes
fedekunze Mar 27, 2020
a4749e3
util funcs for tm <-> proto
fedekunze Mar 27, 2020
ea46b7f
more cleanup
fedekunze Mar 27, 2020
cff3c94
more util funcs
fedekunze Mar 30, 2020
c8229a3
more fixes
fedekunze Mar 30, 2020
610fafc
Merge branch 'ibc-alpha' of https://github.com/cosmos/cosmos-sdk into…
fedekunze Mar 31, 2020
ced1d63
more test fixes
fedekunze Mar 31, 2020
077a13f
fixes
fedekunze Mar 31, 2020
554de2d
remove PacketData and PacketAck interfaces
fedekunze Apr 1, 2020
ba1cb08
FINALLY! build
fedekunze Apr 1, 2020
2ecbb5b
fix some tests
fedekunze Apr 1, 2020
c5d00b5
fix more tests
fedekunze Apr 1, 2020
8b3400f
lint
fedekunze Apr 2, 2020
3c38a61
proto cleanup
fedekunze Apr 2, 2020
048b8d1
Merge branch 'ibc-alpha' of https://github.com/cosmos/cosmos-sdk into…
fedekunze Apr 2, 2020
2614026
try fix ics07 errors
fedekunze Apr 2, 2020
5079c78
lint
fedekunze Apr 2, 2020
80ec515
merge ibc-alpha
fedekunze Apr 3, 2020
cced361
Merge branch 'ibc-alpha' of https://github.com/cosmos/cosmos-sdk into…
fedekunze Apr 3, 2020
48828f0
Merge branch 'ibc-alpha' of github.com:cosmos/cosmos-sdk into fedekun…
fedekunze Apr 3, 2020
773a6ec
merge tm-proto
fedekunze Apr 6, 2020
9bd476f
fixes
fedekunze Apr 6, 2020
99cab85
minor updates
fedekunze Apr 7, 2020
bc0f744
merge ibc-alpha changes
fedekunze Apr 8, 2020
9dd94c0
update proto files
fedekunze Apr 8, 2020
c8669df
build
fedekunze Apr 8, 2020
f8d64c8
updates from downstream
fedekunze Apr 14, 2020
0d62302
update proto deps
fedekunze Apr 14, 2020
524cce4
fix ics07 test
fedekunze Apr 14, 2020
e5d4641
changes from master
fedekunze Apr 16, 2020
dd9df29
fix build
fedekunze Apr 16, 2020
6dac284
test fixes
fedekunze Apr 16, 2020
4d3058a
updates from downstream
fedekunze Apr 21, 2020
1b7b9c8
fixes
fedekunze Apr 21, 2020
e422b08
proto ics09
fedekunze Apr 21, 2020
8d794fa
changes from master
fedekunze Apr 29, 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
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,20 @@ proto-update-deps:
@sed -i '' '9 s|proto/crypto/merkle/types.proto|third_party/proto/tendermint/proto/crypto/merkle/types.proto|g' $(TM_PROTO)/types/types.proto
@sed -i '' '10 s|proto/version/version.proto|third_party/proto/tendermint/proto/version/version.proto|g' $(TM_PROTO)/types/types.proto

@curl -sSL $(TM_URL)/proto/types/evidence.proto > $(TM_PROTO)/types/evidence.proto
@sed -i '' '7 s|proto/types/types.proto|third_party/proto/tendermint/proto/types/types.proto|g' $(TM_PROTO)/types/evidence.proto

@mkdir -p $(TM_PROTO)/evidence
@curl -sSL $(TM_URL)/proto/evidence/msgs.proto > $(TM_PROTO)/evidence/msgs.proto
@sed -i '' '7 s|proto/types/evidence.proto|third_party/proto/tendermint/proto/types/evidence.proto|g' $(TM_PROTO)/evidence/msgs.proto

@curl -sSL $(TM_URL)/proto/types/block.proto > $(TM_PROTO)/types/block.proto
@sed -i '' '7 s|proto/types/types.proto|third_party/proto/tendermint/proto/types/types.proto|g' $(TM_PROTO)/types/block.proto
@sed -i '' '8 s|proto/types/evidence.proto|third_party/proto/tendermint/proto/types/evidence.proto|g' $(TM_PROTO)/types/block.proto

@curl -sSL $(TM_URL)/proto/types/validator.proto > $(TM_PROTO)/types/validator.proto
@sed -i '' '7 s|proto/crypto/keys/types.proto|third_party/proto/tendermint/proto/crypto/keys/types.proto|g' $(TM_PROTO)/types/validator.proto

@mkdir -p $(TM_PROTO)/libs/bits
@curl -sSL $(TM_URL)/proto/libs/bits/types.proto > $(TM_PROTO)/libs/bits/types.proto

Expand Down
2 changes: 2 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ lint:
- UNARY_RPC
- COMMENT_FIELD
- PACKAGE_DIRECTORY_MATCH
- ENUM_VALUE_PREFIX
- ENUM_ZERO_VALUE_SUFFIX
ignore:
- third_party
- codec/testdata
Expand Down
3 changes: 3 additions & 0 deletions codec/amino.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

amino "github.com/tendermint/go-amino"
cryptoamino "github.com/tendermint/tendermint/crypto/encoding/amino"
protokeys "github.com/tendermint/tendermint/proto/crypto/keys"
tmtypes "github.com/tendermint/tendermint/types"
)

Expand Down Expand Up @@ -34,6 +35,8 @@ func New() *Codec {
// codec.
func RegisterCrypto(cdc *Codec) {
cryptoamino.RegisterAmino(cdc)
cryptoamino.RegisterKeyType(protokeys.PrivateKey{}, "tendermint/proto/PrivateKey")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marbar3778 I'm getting some errors with the encoding because it doesn't recognize the new priv/pubkey. Can you take a look when you have time?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you will have to define your own proto type. we decided to only support ed25519 in tendermints proto key types

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a pr to show how this could be done simply: #5997

if this works i can work on completing that PR

cryptoamino.RegisterKeyType(protokeys.PublicKey{}, "tendermint/proto/PublicKey")
}

// RegisterEvidences registers Tendermint evidence types with the provided Amino
Expand Down
4 changes: 2 additions & 2 deletions crypto/hd/fundraiser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestFundraiserCompatibility(t *testing.T) {
master, ch := hd.ComputeMastersFromSeed(seed)
priv, err := hd.DerivePrivateKeyForPath(master, ch, "44'/118'/0'/0/0")
require.NoError(t, err)
pub := secp256k1.PrivKey(priv).PubKey()
pub := secp256k1.PrivKey(priv[:]).PubKey()

t.Log("\tNODEJS GOLANG\n")
t.Logf("SEED \t%X %X\n", seedB, seed)
Expand All @@ -78,7 +78,7 @@ func TestFundraiserCompatibility(t *testing.T) {
require.Equal(t, priv[:], privB, "Expected priv keys to match")
var pubBFixed [33]byte
copy(pubBFixed[:], pubB)
require.Equal(t, pub, secp256k1.PubKey(pubBFixed), fmt.Sprintf("Expected pub keys to match for %d", i))
require.Equal(t, pub, secp256k1.PubKey(pubBFixed[:]), fmt.Sprintf("Expected pub keys to match for %d", i))

addr := pub.Address()
t.Logf("ADDR \t%X %X\n", addrB, addr)
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture/adr-015-ibc-packet-receiver.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func handleMsgTransfer(ctx Context, k Keeper, msg MsgTransfer) Result {
}

func handlePacketDataTransfer(ctx Context, k Keeper, packet Packet, data PacketDataTransfer) Result {
err := k.ReceiveTransfer(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetDestinationPort(), packet.GetDestinationChannel(), data)
err := k.ReceiveTransfer(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetDestPort(), packet.GetDestChannel(), data)
if err != nil {
// TODO: Source chain sent invalid packet, shutdown channel
}
Expand All @@ -257,7 +257,7 @@ func handlePacketDataTransfer(ctx Context, k Keeper, packet Packet, data PacketD
}

func handleCustomTimeoutPacket(ctx Context, k Keeper, packet CustomPacket) Result {
err := k.RecoverTransfer(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetDestinationPort(), packet.GetDestinationChannel(), data)
err := k.RecoverTransfer(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetDestPort(), packet.GetDestChannel(), data)
if err != nil {
// This chain sent invalid packet or cannot recover the funds
panic(err)
Expand Down
1 change: 1 addition & 0 deletions std/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
_ bank.Codec = (*Codec)(nil)
_ evidence.Codec = (*Codec)(nil)
_ gov.Codec = (*Codec)(nil)
// _ clienttypes.Codec = (*Codec)(nil)
)

// Codec defines the application-level codec. This codec contains all the
Expand Down
Loading