Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into andrew/penumbra_pclientd
Browse files Browse the repository at this point in the history
  • Loading branch information
jtieri committed Aug 2, 2023
2 parents aa41ee8 + 8e02aef commit 486217b
Show file tree
Hide file tree
Showing 93 changed files with 6,436 additions and 1,205 deletions.
5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ updates:
interval: "weekly"
open-pull-requests-limit: 10
labels:
- dependencies

- dependencies
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 10
labels:
- gh-action-version
27 changes: 27 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
pull_request_rules:
- name: backport to maintained branches
conditions:
- base~=^(main|v4|v4-ics|v5|v6)$
- label=BACKPORT
actions:
backport:
branches:
- main
- v4-ics
- v4
- v5
- v6
assignees:
- "{{ author }}"
labels:
- automerge
- backported
title: "`[BP: {{ destination_branch }} <- #{{ number }}]` {{ title }}"

- name: automerge backported PR's for maintained branches
conditions:
- label=automerge
- base~=^(v4|v4-ics|v5|v6)$
actions:
merge:
method: squash
44 changes: 11 additions & 33 deletions .github/workflows/tests.yml → .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
name: Run Go Tests
name: Run End-To-End Tests

on:
pull_request:
push:
branches:
- main
paths:
- "**.go"
- "**.mod"
- "**.sum"

jobs:
test-unit:
name: unit-tests
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: checkout interchaintest
uses: actions/checkout@v3
# Ensures that only a single workflow per PR will run at a time. Cancels in-progress jobs if new commit is pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# cleanup environment on self-hosted test runner
- name: clean
run: |-
rm -rf ~/.interchaintest
# run tests
- name: run unit tests
# -short flag purposefully omitted because there are some longer unit tests
run: go test -race -timeout 10m -p 2 $(go list ./... | grep -v /cmd | grep -v /examples)
jobs:
test-conformance:
name: test-conformance
runs-on: [self-hosted, linux]
Expand All @@ -53,7 +29,7 @@ jobs:
# run tests
- name: run conformance tests
run: (go test -race -timeout 30m -v -p 2 ./cmd/interchaintest) || (echo "\n\n*****CHAIN and RELAYER LOGS*****" && cat "$HOME/.interchaintest/logs/interchaintest.log" && exit 1)
run: (go test -race -timeout 30m -failfast -v -p 2 ./cmd/interchaintest) || (echo "\n\n*****CHAIN and RELAYER LOGS*****" && cat "$HOME/.interchaintest/logs/interchaintest.log" && exit 1)
test-ibc-examples:
name: test-ibc-examples
runs-on: [self-hosted, linux]
Expand All @@ -63,6 +39,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: 1.19
cache: false

- name: checkout interchaintest
uses: actions/checkout@v3
Expand All @@ -74,7 +51,7 @@ jobs:
# run tests
- name: run example ibc tests
run: go test -race -timeout 30m -v -p 2 ./examples/ibc
run: go test -race -timeout 30m -failfast -v -p 2 ./examples/ibc
test-cosmos-examples:
name: test-cosmos-examples
runs-on: [self-hosted, linux]
Expand All @@ -84,6 +61,7 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: 1.19
cache: false

- name: checkout interchaintest
uses: actions/checkout@v3
Expand All @@ -95,4 +73,4 @@ jobs:
# run tests
- name: run example cosmos tests
run: go test -race -timeout 30m -v -p 2 ./examples/cosmos
run: go test -race -failfast -timeout 30m -v -p 2 ./examples/cosmos
8 changes: 2 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
golangci:
name: lint
Expand All @@ -17,4 +13,4 @@ jobs:
with:
version: latest
only-new-issues: true
args: --timeout=3m
args: --timeout=5m
20 changes: 0 additions & 20 deletions .github/workflows/prior-version-pr.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run Unit Tests

on:
pull_request:

# Ensures that only a single workflow per PR will run at a time. Cancels in-progress jobs if new commit is pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test-unit:
name: unit-tests
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: checkout interchaintest
uses: actions/checkout@v3

# run tests
- name: run unit tests
# -short flag purposefully omitted because there are some longer unit tests
run: go test -race -timeout 10m -failfast -p 2 $(go list ./... | grep -v /cmd | grep -v /examples)
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ It allows users to quickly spin up custom testnets and dev environments to test

<br>

### Maintained Branches

| **Branch Name** | **IBC-Go** | **Cosmos-sdk** | **Maintained** |
|:----------------------------------------------------------------------------:|:----------:|:--------------:|:-------------------:|
| main | v7 | v0.47 ||
| [v6](https://github.com/strangelove-ventures/interchaintest/tree/v6) | v6 | v0.46 ||
| [v5](https://github.com/strangelove-ventures/interchaintest/tree/v5) | v5 | v0.46 ||
| [v4](https://github.com/strangelove-ventures/interchaintest/tree/v4) | v4 | v0.45 ||
| [v4-ics](https://github.com/strangelove-ventures/interchaintest/tree/v4-ics) | v4 | v0.45.x-ics ||
| [v3](https://github.com/strangelove-ventures/interchaintest/tree/v3) | v3 | v0.45 |❌<br>(June 25 2023) |
| [v3-ics](https://github.com/strangelove-ventures/interchaintest/tree/v3-ics) | v3 | v0.45.11-ics |❌<br>(April 24 2023)|

## Table Of Contents
- [Building Binary](#building-binary)
- **Usage:**
Expand All @@ -37,7 +49,7 @@ It allows users to quickly spin up custom testnets and dev environments to test

## Building Binary

While it is not necessary to build the binary, sometimes it can be more convenient, *specifically* when running conformance test with custom chain sets.
While it is not necessary to build the binary, sometimes it can be more convenient, *specifically* when running conformance test with custom chain sets.

Building binary:
```shell
Expand All @@ -46,7 +58,7 @@ cd interchaintest
make interchaintest
```

This places the binary in `interchaintest/.bin/interchaintest`
This places the binary in `interchaintest/bin/interchaintest`

Note that this is not in your Go path.

Expand All @@ -62,4 +74,4 @@ Please read the [logging style guide](./docs/logging.md).
Significant bugs that were more easily fixed with `interchaintest`:

- [Juno network halt reproduction](https://github.com/strangelove-ventures/interchaintest/pull/7)
- [Juno network halt fix confirmation](https://github.com/strangelove-ventures/interchaintest/pull/8)
- [Juno network halt fix confirmation](https://github.com/strangelove-ventures/interchaintest/pull/8)
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) {

}

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{},
)
}
Loading

0 comments on commit 486217b

Please sign in to comment.