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: add endblocker with valsetupdate type #15829

Merged
merged 10 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
843 changes: 697 additions & 146 deletions api/cosmos/base/abci/v1beta1/abci.pulsar.go

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions proto/cosmos/base/abci/v1beta1/abci.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cosmos.base.abci.v1beta1;

import "gogoproto/gogo.proto";
import "tendermint/abci/types.proto";
import "tendermint/crypto/keys.proto";
import "tendermint/types/block.proto";
import "google/protobuf/any.proto";

Expand Down Expand Up @@ -175,3 +176,11 @@ message SearchBlocksResult {
// List of blocks in current page
repeated tendermint.types.Block blocks = 6;
}

// ValidatorUpdate
message ValidatorUpdate {
option (gogoproto.stringer) = true;

tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false];
int64 power = 2;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

we only need this type to make it work, should we just depend on comet for it? @aaronc @alexanderbez

Copy link
Contributor

Choose a reason for hiding this comment

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

The pubkey? I think that's fine

Copy link
Member Author

@tac0turtle tac0turtle Apr 13, 2023

Choose a reason for hiding this comment

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

The validator update type

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're defining parts of ABCI ourselves, I would say let's define the entire type, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

since this endblock is tied to comet i may leave it for now.

6 changes: 2 additions & 4 deletions runtime/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import (
"encoding/json"
"fmt"

abci "github.com/cometbft/cometbft/abci/types"
"golang.org/x/exp/slices"

runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1"
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"

storetypes "cosmossdk.io/store/types"
abci "github.com/cometbft/cometbft/abci/types"
"golang.org/x/exp/slices"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand Down
9 changes: 1 addition & 8 deletions runtime/services.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package runtime

import (
"context"

appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
Expand All @@ -26,14 +24,9 @@ func (a *App) registerRuntimeServices(cfg module.Configurator) error {
}

// ======================================================
// ValidatorUpdateService & BlockInfoService
// BlockInfoService
// ======================================================

// ValidatorUpdateService is the service that runtime will provide to the module that sets validator updates.
type ValidatorUpdateService interface {
SetValidatorUpdates(context.Context, []abci.ValidatorUpdate)
}

// BlockInfoService is the service that runtime will provide to modules which need Comet block information.
type BlockInfoService interface {
GetHeight() int64 // GetHeight returns the height of the block
Expand Down
117 changes: 117 additions & 0 deletions testutil/mock/types_module_module.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading