-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into andrew/penumbra_pclientd
- Loading branch information
Showing
93 changed files
with
6,436 additions
and
1,205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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{}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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{}, | ||
) | ||
} |
Oops, something went wrong.