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

chore: Add dummy handler of MsgInjectedCheckpoint #395

Closed
wants to merge 3 commits into from
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

- [#391](https://github.com/babylonlabs-io/babylon/pull/391) Fix e2e `TestBTCRewardsDistribution` flunky
check of rewards
- [#395](https://github.com/babylonlabs-io/babylon/pull/395) Add dummy handler of MsgInjectedCheckpoint

## v1.0.0-rc3

Expand Down
11 changes: 0 additions & 11 deletions proto/babylon/checkpointing/v1/checkpoint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package babylon.checkpointing.v1;

import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
import "tendermint/abci/types.proto";

option go_package = "github.com/babylonlabs-io/babylon/x/checkpointing/types";

Expand Down Expand Up @@ -44,16 +43,6 @@ message RawCheckpointWithMeta {
repeated CheckpointStateUpdate lifecycle = 5;
}

// MsgInjectedCheckpoint wraps the checkpoint and the extended votes
// Note: this is a special message type that is only for internal ABCI++ usage
// for inserting checkpoint into the block
message MsgInjectedCheckpoint {
RawCheckpointWithMeta ckpt = 1;
// extended_commit_info is the commit info including the vote extensions
// from the previous proposal
tendermint.abci.ExtendedCommitInfo extended_commit_info = 2;
}

// CheckpointStatus is the status of a checkpoint.
enum CheckpointStatus {
option (gogoproto.goproto_enum_prefix) = false;
Expand Down
27 changes: 27 additions & 0 deletions proto/babylon/checkpointing/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ syntax = "proto3";
package babylon.checkpointing.v1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "babylon/checkpointing/v1/bls_key.proto";
import "babylon/checkpointing/v1/checkpoint.proto";
import "cosmos/staking/v1beta1/tx.proto";
import "cosmos/msg/v1/msg.proto";
import "tendermint/abci/types.proto";

option go_package = "github.com/babylonlabs-io/babylon/x/checkpointing/types";

Expand All @@ -15,6 +18,10 @@ service Msg {
// WrappedCreateValidator defines a method for registering a new validator
rpc WrappedCreateValidator(MsgWrappedCreateValidator)
returns (MsgWrappedCreateValidatorResponse);

// InjectedCheckpoint defines a dummy method for handling an injected checkpoint
rpc InjectedCheckpoint(MsgInjectedCheckpoint)
returns (MsgInjectedCheckpointResponse);
}

// MsgWrappedCreateValidator defines a wrapped message to create a validator
Expand All @@ -30,3 +37,23 @@ message MsgWrappedCreateValidator {
// MsgWrappedCreateValidatorResponse defines the MsgWrappedCreateValidator
// response type
message MsgWrappedCreateValidatorResponse {}

// MsgInjectedCheckpoint wraps the checkpoint and the extended votes
// Note: this is a special message type that is only for internal ABCI++ usage
// for inserting checkpoint into the block
message MsgInjectedCheckpoint {
option (cosmos.msg.v1.signer) = "placeholder_addr";

// placeholder_addr is the placeholder address requested by
// cosmos sdk as a message; this message in an internal message
// which only be handled in PreBlocker
string placeholder_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
RawCheckpointWithMeta ckpt = 2;
// extended_commit_info is the commit info including the vote extensions
// from the previous proposal
tendermint.abci.ExtendedCommitInfo extended_commit_info = 3;
}

// MsgInjectedCheckpointResponse defines the MsgInjectedCheckpoint
// response type
message MsgInjectedCheckpointResponse {}
161 changes: 79 additions & 82 deletions x/btcstaking/types/events.pb.go

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

8 changes: 7 additions & 1 deletion x/checkpointing/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,11 @@ func (m msgServer) WrappedCreateValidator(goCtx context.Context, msg *types.MsgW

m.k.epochingKeeper.EnqueueMsg(ctx, queueMsg)

return &types.MsgWrappedCreateValidatorResponse{}, err
return &types.MsgWrappedCreateValidatorResponse{}, nil
}

// InjectedCheckpoint is a dummy msg handler as MsgInjectedCheckpoint is an internal message handled in
// PreBlocker. This is to avoid errors from the explorers
func (m msgServer) InjectedCheckpoint(_ context.Context, _ *types.MsgInjectedCheckpoint) (*types.MsgInjectedCheckpointResponse, error) {
return &types.MsgInjectedCheckpointResponse{}, nil
}
Loading