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

Remove valset/data commitment confirm logic from state machine #720

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.18
require (
github.com/celestiaorg/nmt v0.10.0
github.com/celestiaorg/quantum-gravity-bridge v1.2.0
github.com/cosmos/cosmos-sdk v0.44.3
github.com/ethereum/go-ethereum v1.10.17
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
Expand All @@ -17,7 +16,6 @@ require (
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.5.0
github.com/stretchr/testify v1.8.0
github.com/tendermint/tendermint v0.34.20
github.com/tendermint/tm-db v0.6.7
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect
Expand All @@ -30,6 +28,8 @@ require (
require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/math v1.0.0-beta.2
github.com/cosmos/cosmos-sdk v0.0.0-00010101000000-000000000000
Copy link
Collaborator

Choose a reason for hiding this comment

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

[question] this version number seems odd, is it intended?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's certainly not. I am still investigating it

Copy link
Member Author

Choose a reason for hiding this comment

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

this is probably coming from the conflicting cosmos-sdk and celestia-core versions.
I guess it will be fixed when we merge the cosmos-sdk QGB branch to the default one and we rebase on master.
Will merge for now and take a look on it later

github.com/tendermint/tendermint v0.34.20
)

require (
Expand Down Expand Up @@ -126,7 +126,6 @@ require (
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/onsi/gomega v1.10.3 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
Expand Down
559 changes: 559 additions & 0 deletions go.sum

Large diffs are not rendered by default.

91 changes: 0 additions & 91 deletions proto/qgb/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,52 +33,6 @@ service Query {
option (google.api.http).get = "/qgb/attestations/nonce/latest";
}

// Data commitment confirm queries

// DataCommitmentConfirm Queries the data commitment confirm by the commitment
// and the validator address
// Returns nil if not found.
rpc DataCommitmentConfirm(QueryDataCommitmentConfirmRequest)
returns (QueryDataCommitmentConfirmResponse) {
option (google.api.http).get =
"/qgb/data_commitment/confirm/begin/"
"{begin_block}/end/{end_block}/address/{address}";
}
// DataCommitmentConfirmsByExactRange Queries data commitment confirms by an
// exact block range.
// Returns empty array if no element is found.
rpc DataCommitmentConfirmsByExactRange(
QueryDataCommitmentConfirmsByExactRangeRequest)
returns (QueryDataCommitmentConfirmsByExactRangeResponse) {
option (google.api.http).get =
"/qgb/data_commitment/confirms/exact/begin_block/"
"{begin_block}/end_block/{end_block}";
}

// valset confirm queries

// ValsetConfirm Queries ValSetConfirm
// Returns nil if not found.
rpc ValsetConfirm(QueryValsetConfirmRequest)
returns (QueryValsetConfirmResponse) {
option (google.api.http).get = "/qgb/valset/confirm";
}
// LastValsetRequestBeforeNonce Queries last Valset request before nonce.
// And, even if the current nonce is a valset, if will return the previous
// one.
// If the provided nonce is 1. It will return an error. Because, there is
// no valset before nonce 1.
rpc LastValsetRequestBeforeNonce(QueryLastValsetRequestBeforeNonceRequest)
returns (QueryLastValsetRequestBeforeNonceResponse) {
option (google.api.http).get = "/qgb/valset/request/before/{nonce}";
}
// ValsetConfirmsByNonce
// Returns empty array if no element is found.
rpc ValsetConfirmsByNonce(QueryValsetConfirmsByNonceRequest)
returns (QueryValsetConfirmsByNonceResponse) {
option (google.api.http).get = "/qgb/confirms/{nonce}";
}

// misc

// LastUnbondingHeight
Expand Down Expand Up @@ -112,23 +66,6 @@ message QueryLatestAttestationNonceRequest {}
// QueryLatestAttestationNonceResponse Latest attestation nonce response
message QueryLatestAttestationNonceResponse { uint64 nonce = 1; }

// QueryValsetConfirmsByNonceRequest
message QueryValsetConfirmsByNonceRequest { uint64 nonce = 1; }

// QueryValsetConfirmsByNonceResponse
message QueryValsetConfirmsByNonceResponse {
repeated MsgValsetConfirm confirms = 1 [ (gogoproto.nullable) = false ];
}

// QueryValsetConfirmRequest ValSet confirm query request
message QueryValsetConfirmRequest {
uint64 nonce = 1;
string address = 2;
}

// QueryValsetConfirmResponse ValSet confirm query response
message QueryValsetConfirmResponse { MsgValsetConfirm confirm = 1; }

// QueryLastValsetRequestBeforeNonceRequest last Valset request before universal
// nonce request
message QueryLastValsetRequestBeforeNonceRequest { uint64 nonce = 1; }
Expand All @@ -137,34 +74,6 @@ message QueryLastValsetRequestBeforeNonceRequest { uint64 nonce = 1; }
// response
message QueryLastValsetRequestBeforeNonceResponse { Valset valset = 1; }

// QueryDataCommitmentConfirmsRequest Data commitment confirm by commitment and
// validator address request
message QueryDataCommitmentConfirmRequest {
uint64 begin_block = 1;
uint64 end_block = 2;
string address = 3;
}

// QueryDataCommitmentConfirmsResponse Data commitment confirm by commitment and
// validator address response
message QueryDataCommitmentConfirmResponse {
MsgDataCommitmentConfirm confirm = 1;
}

// QueryDataCommitmentConfirmsByExactRangeRequest Data commitment confirms by
// exact range request
message QueryDataCommitmentConfirmsByExactRangeRequest {
uint64 begin_block = 1;
uint64 end_block = 2;
}

// QueryDataCommitmentConfirmsByExactRangeResponse Data commitment confirms by
// exact range response
message QueryDataCommitmentConfirmsByExactRangeResponse {
repeated MsgDataCommitmentConfirm confirms = 1
[ (gogoproto.nullable) = false ];
}

// QueryLastUnbondingHeightRequest
message QueryLastUnbondingHeightRequest {}

Expand Down
21 changes: 0 additions & 21 deletions x/qgb/client/cli/datacommitment.go

This file was deleted.

32 changes: 0 additions & 32 deletions x/qgb/client/cli/txcommand.go

This file was deleted.

21 changes: 0 additions & 21 deletions x/qgb/client/cli/valsetconfirm.go

This file was deleted.

35 changes: 0 additions & 35 deletions x/qgb/client/main/main.go

This file was deleted.

1 change: 1 addition & 0 deletions x/qgb/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

// Can be deleted after implementing the Orchestrator and Relayer as per QGB ADR-005.
// NewHandler uses the provided qgb keeper to create an sdk.Handler.
func NewHandler(k keeper.Keeper) sdk.Handler {
msgServer := keeper.NewMsgServerImpl(k)
Expand Down
Loading