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/hyperspace #382

Merged
merged 55 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
48896c7
chore: update to 0.47
julienrbrt Nov 3, 2022
17d8411
bump go
julienrbrt Nov 4, 2022
236a820
updates
julienrbrt Dec 13, 2022
b80db9e
updates
julienrbrt Dec 13, 2022
cc55b43
feedback
julienrbrt Dec 13, 2022
0bf5f38
Fix BroadcastSync for cosmos broadcaster (#360)
chatton Jan 11, 2023
0350de5
public grpc, register tmlightclient codecs as no longer by default, a…
agouin Jan 11, 2023
cfaab30
Bump ibc-go to latest commit
agouin Jan 13, 2023
0fcd87d
deps: upgrade to ibc-go/v7 and bump ibctest go mod (#372)
damiannolan Jan 24, 2023
8936b0f
Initial commit for hyperspace relayer
misko9 Jan 25, 2023
5357971
Add support for creating the core config and modifying chain configs.
misko9 Jan 27, 2023
110192a
Move hyperspace to its own package
misko9 Jan 27, 2023
a6c0934
Populate hyperspace's cosmos config with key information, i.e. KeyEntry
misko9 Jan 30, 2023
cb722ba
Add wasm code id and wasm client type to cosmos chain config
misko9 Jan 30, 2023
91540a4
chore: align User interface with CosmosWallet and fix issue with broa…
chatton Jan 31, 2023
e0e4e0f
Merge remote-tracking branch 'origin/main' into v0.47
agouin Feb 1, 2023
8556491
Hyperspace create-client is populating client-ids in chain configs.
misko9 Feb 2, 2023
fe7a90e
Add CreateConnections, GetClients, and ParseGetClientsOuput.
misko9 Feb 3, 2023
e62d439
Temporarily force simd for chain A and rococo-local for chain B
misko9 Feb 3, 2023
93ace02
Create connection working in hyperspace/interchaintest
misko9 Feb 3, 2023
e992e30
Add create channel and get connections. Create channels works.
misko9 Feb 3, 2023
0b9af62
Reduce session length to 20 blocks again. Debugging starting the
misko9 Feb 4, 2023
c82764f
Start hyperspace relayer
misko9 Feb 4, 2023
e1ddd4a
IBC transfers working in both directions
misko9 Feb 10, 2023
8c6ca8c
Poll for cosmos chain balance to reduce test time
misko9 Feb 10, 2023
312733c
Use interchaintest generated relayer wallet in hyperspace's cosmos chain
misko9 Feb 13, 2023
a9ea13e
add query channels (#397)
edjroz Feb 14, 2023
cb40dba
Add test for requiring governance on PushNewWasmCode msg
misko9 Feb 15, 2023
3ee0a18
Fix denom trace param
misko9 Feb 16, 2023
e4a76f6
Add submitting a proposal for a new wasm contract. Clean up the test
misko9 Feb 17, 2023
1b01075
Merge branch 'v0.47' into feat/hyperspace
misko9 Feb 17, 2023
4728817
Bump to ibc-go v7, cosmos-sdk v0.47, polkadot v0.9.36, update parachains
misko9 Feb 18, 2023
13384cd
Refactor hyperspace into more manageable files
misko9 Feb 18, 2023
903d8bb
Add GeneratePath() to hyperspace relayer and move hyperspace-specific
misko9 Feb 20, 2023
c768581
Add LinkPath to hyperspace relayer interface
misko9 Feb 20, 2023
f425890
Override cosmos chain block time in test
misko9 Feb 21, 2023
cd16f12
Scale polkadot/parachain additional wallets by a factor of 1mil relative
misko9 Feb 21, 2023
6b37a7d
Update test framework with latest changes from ibc-go, hyperspace,
misko9 Mar 17, 2023
999313f
Update to gzip the wasm contract and reduce gas wanted now that gas
misko9 Mar 19, 2023
d76b929
Update codecs, update hyperspace/parachain commits to use, and remove
misko9 Mar 22, 2023
a6c0457
Merge branch 'main' into feat/hyperspace (#492)
anhductn2001 Apr 12, 2023
95069c7
Change the UidGid of polkadot node to match what is built into the
misko9 Apr 12, 2023
28d6d57
Fix polkadot keys unit tests
misko9 Apr 12, 2023
897c6c8
Merge branch 'main' into feat/hyperspace
misko9 Apr 12, 2023
02362af
Fix go.sum after merge from main
misko9 Apr 12, 2023
9ba288b
style: go fmt
misko9 Apr 12, 2023
4be09f5
Update parachain's query ibc balance to match it new api, re-enable
misko9 Apr 13, 2023
fc3aea1
Update cli for wasm light client and update the grandpa contract to
misko9 Apr 14, 2023
292e34b
refactor how hyperspace commander parses get client and get connection
misko9 Apr 14, 2023
0e7cf4b
Remove some prints and fix typo
misko9 Apr 14, 2023
8cecb1b
Merge branch 'main' into feat/hyperspace
misko9 Apr 14, 2023
0d0b1ea
style: go fmt
misko9 Apr 15, 2023
5ffa308
fix lint errors
misko9 Apr 15, 2023
d634654
update go.mod
misko9 Apr 15, 2023
155253c
Merge branch 'main' into feat/hyperspace
misko9 Apr 17, 2023
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
123 changes: 123 additions & 0 deletions chain/cosmos/08-wasm-types/client_state.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
package types

import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
)

var _ exported.ClientState = (*ClientState)(nil)

func (c ClientState) ClientType() string {
return ""
}

func (c ClientState) GetLatestHeight() exported.Height {
return c.LatestHeight
}

func (c ClientState) Validate() error {
return nil
}

func (c ClientState) Status(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec) exported.Status {
return exported.Active
}

func (c ClientState) ExportMetadata(store sdk.KVStore) []exported.GenesisMetadata {
return []exported.GenesisMetadata{}
}

func (c ClientState) ZeroCustomFields() exported.ClientState {
return &c
}

func (c ClientState) GetTimestampAtHeight(
ctx sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
) (uint64, error) {
return 0, nil
}

func (c ClientState) Initialize(context sdk.Context, marshaler codec.BinaryCodec, store sdk.KVStore, state exported.ConsensusState) error {
return nil
}

func (c ClientState) VerifyMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
delayBlockPeriod uint64,
proof []byte,
path exported.Path,
value []byte,
) error {
return nil
}

func (c ClientState) VerifyNonMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
delayBlockPeriod uint64,
proof []byte,
path exported.Path,
) error {
return nil
}

// VerifyClientMessage must verify a ClientMessage. A ClientMessage could be a Header, Misbehaviour, or batch update.
// It must handle each type of ClientMessage appropriately. Calls to CheckForMisbehaviour, UpdateState, and UpdateStateOnMisbehaviour
// will assume that the content of the ClientMessage has been verified and can be trusted. An error should be returned
// if the ClientMessage fails to verify.
func (c ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) error {
return nil
}

func (c ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, msg exported.ClientMessage) bool {
return true
}

// UpdateStateOnMisbehaviour should perform appropriate state changes on a client state given that misbehaviour has been detected and verified
func (c ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) {

joeabbey marked this conversation as resolved.
Show resolved Hide resolved
}

func (c ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) []exported.Height {
return []exported.Height{c.LatestHeight}
}

func (c ClientState) CheckSubstituteAndUpdateState(
ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore,
substituteClientStore sdk.KVStore, substituteClient exported.ClientState,
) error {
return nil
}

func (c ClientState) VerifyUpgradeAndUpdateState(
ctx sdk.Context,
cdc codec.BinaryCodec,
store sdk.KVStore,
newClient exported.ClientState,
newConsState exported.ConsensusState,
proofUpgradeClient,
proofUpgradeConsState []byte,
) error {
return nil
}

// NewClientState creates a new ClientState instance.
func NewClientState(latestSequence uint64, consensusState *ConsensusState) *ClientState {
return &ClientState{
Data: []byte{0},
CodeId: []byte{},
LatestHeight: clienttypes.Height{},
}
}
32 changes: 32 additions & 0 deletions chain/cosmos/08-wasm-types/codec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package types

import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
)

// RegisterInterfaces registers the tendermint concrete client-related
// implementations and interfaces.
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*exported.ClientState)(nil),
&ClientState{},
)
registry.RegisterImplementations(
(*exported.ConsensusState)(nil),
&ConsensusState{},
)
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgStoreCode{},
)
registry.RegisterImplementations(
(*exported.ClientMessage)(nil),
&Misbehaviour{},
)
registry.RegisterImplementations(
(*exported.ClientMessage)(nil),
&Header{},
)
}
19 changes: 19 additions & 0 deletions chain/cosmos/08-wasm-types/consensus_state.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package types

import (
"github.com/cosmos/ibc-go/v7/modules/core/exported"
)

var _ exported.ConsensusState = (*ConsensusState)(nil)

func (m ConsensusState) ClientType() string {
return ""
joeabbey marked this conversation as resolved.
Show resolved Hide resolved
}

func (m ConsensusState) GetTimestamp() uint64 {
return m.Timestamp
}

func (m ConsensusState) ValidateBasic() error {
return nil
}
15 changes: 15 additions & 0 deletions chain/cosmos/08-wasm-types/header.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package types

import (
"github.com/cosmos/ibc-go/v7/modules/core/exported"
)

var _ exported.ClientMessage = &Header{}

func (m Header) ClientType() string {
return ""
}

func (m Header) ValidateBasic() error {
return nil
}
17 changes: 17 additions & 0 deletions chain/cosmos/08-wasm-types/misbehavior.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package types

import (
exported "github.com/cosmos/ibc-go/v7/modules/core/exported"
)

var (
_ exported.ClientMessage = &Misbehaviour{}
)

func (m Misbehaviour) ClientType() string {
return ""
}

func (m Misbehaviour) ValidateBasic() error {
return nil
}
57 changes: 57 additions & 0 deletions chain/cosmos/08-wasm-types/module.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package types

import (
"encoding/json"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/types/module"
//grpc "github.com/cosmos/gogoproto/grpc"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
)

var _ module.AppModuleBasic = AppModuleBasic{}

// AppModuleBasic defines the basic application module used by the tendermint light client.
// Only the RegisterInterfaces function needs to be implemented. All other function perform
// a no-op.
type AppModuleBasic struct{}

// Name returns the tendermint module name.
func (AppModuleBasic) Name() string {
return "08-wasm"
}

// RegisterLegacyAminoCodec performs a no-op. The Wasm client does not support amino.
func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {}

// RegisterInterfaces registers module concrete types into protobuf Any. This allows core IBC
// to unmarshal wasm light client types.
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
RegisterInterfaces(registry)
}

// DefaultGenesis performs a no-op. Genesis is not supported for the tendermint light client.
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return nil
}

// ValidateGenesis performs a no-op. Genesis is not supported for the tendermint light cilent.
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {
return nil
}

// RegisterGRPCGatewayRoutes performs a no-op.
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {}

// GetTxCmd performs a no-op. Please see the 02-client cli commands.
func (AppModuleBasic) GetTxCmd() *cobra.Command {
return nil
}

// GetQueryCmd performs a no-op. Please see the 02-client cli commands.
func (AppModuleBasic) GetQueryCmd() *cobra.Command {
return nil
}
21 changes: 21 additions & 0 deletions chain/cosmos/08-wasm-types/msgs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package types

import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

var (
_ sdk.Msg = &MsgStoreCode{}
)

func (m MsgStoreCode) ValidateBasic() error {
return nil
}

func (m MsgStoreCode) GetSigners() []sdk.AccAddress {
signer, err := sdk.AccAddressFromBech32(m.Signer)
if err != nil {
panic(err)
}
return []sdk.AccAddress{signer}
}
Loading