Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(sequencer): added reward addr and whitelisted relayers #1313

Merged
merged 6 commits into from
Oct 29, 2024
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
2 changes: 2 additions & 0 deletions ibctesting/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ func (s *utilSuite) registerSequencer() {
RestApiUrls: []string{"https://api.wpd.evm.rollapp.noisnemyd.xyz:443"},
},
bond,
s.hubChain().SenderAccount.GetAddress().String(),
[]string{},
)
s.Require().NoError(err) // message committed
_, err = s.hubChain().SendMsgs(msgCreateSequencer)
Expand Down
15 changes: 14 additions & 1 deletion proto/dymensionxyz/dymension/sequencer/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package dymensionxyz.dymension.sequencer;
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/msg/v1/msg.proto";

option go_package = "github.com/dymensionxyz/dymension/v3/x/sequencer/types";

Expand All @@ -17,4 +16,18 @@ message EventIncreasedBond {
cosmos.base.v1beta1.Coin added_amount = 2 [(gogoproto.nullable) = false];
// bond is the new active bond amount of the sequencer
repeated cosmos.base.v1beta1.Coin bond = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}

message EventUpdateRewardAddress {
// Operator is the bech32-encoded address of the actor sending the update
string creator = 1;
// RewardAddr is a bech32 encoded sdk acc address
string reward_addr = 2;
}

message EventUpdateWhitelistedRelayers {
// Operator is the bech32-encoded address of the actor sending the update
string creator = 1;
// Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings.
repeated string relayers = 2;
}
5 changes: 5 additions & 0 deletions proto/dymensionxyz/dymension/sequencer/sequencer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ message Sequencer {
// notice_period_time defines the time when the sequencer will finish it's notice period if started
google.protobuf.Timestamp notice_period_time = 11
[ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ];

// RewardAddr is a bech32 encoded sdk acc address
string reward_addr = 12;
// WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings.
repeated string whitelisted_relayers = 13;
}

// BondReduction defines an object which holds the information about the sequencer and its queued unbonding amount
Expand Down
29 changes: 29 additions & 0 deletions proto/dymensionxyz/dymension/sequencer/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ service Msg {
rpc CreateSequencer (MsgCreateSequencer) returns (MsgCreateSequencerResponse);
// UpdateSequencerInformation defines a method for updating the sequencer's metadata.
rpc UpdateSequencerInformation (MsgUpdateSequencerInformation) returns (MsgUpdateSequencerInformationResponse);
// UpdateRewardAddress defines a method for updating the sequencer's reward address.
rpc UpdateRewardAddress(MsgUpdateRewardAddress) returns (MsgUpdateRewardAddressResponse);
// UpdateWhitelistedRelayers defines a method for updating the sequencer's whitelisted relater list.
rpc UpdateWhitelistedRelayers(MsgUpdateWhitelistedRelayers) returns (MsgUpdateWhitelistedRelayersResponse);
// Unbond defines a method for removing coins from sequencer's bond
rpc Unbond (MsgUnbond) returns (MsgUnbondResponse);
// IncreaseBond defines a method for increasing a sequencer's bond amount
Expand Down Expand Up @@ -63,6 +67,11 @@ message MsgCreateSequencer {
SequencerMetadata metadata = 4 [(gogoproto.nullable) = false];
// entry bond for the sequencer.
cosmos.base.v1beta1.Coin bond = 5 [(gogoproto.nullable) = false];
// RewardAddr is the bech32-encoded sequencer's reward address. Empty is valid.
// If empty, the creator address is used.
string reward_addr = 6;
// WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings.
repeated string whitelisted_relayers = 7;
}

message MsgCreateSequencerResponse {}
Expand All @@ -77,6 +86,26 @@ message MsgUpdateSequencerInformation {

message MsgUpdateSequencerInformationResponse {}

message MsgUpdateRewardAddress {
option (cosmos.msg.v1.signer) = "creator";
// Creator is the bech32-encoded address of the actor sending the update
string creator = 1;
// RewardAddr is a bech32 encoded sdk acc address
string reward_addr = 2;
}

message MsgUpdateRewardAddressResponse {}

message MsgUpdateWhitelistedRelayers {
option (cosmos.msg.v1.signer) = "creator";
// Creator is the bech32-encoded address of the actor sending the update
string creator = 1;
// Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings.
repeated string relayers = 2;
}

message MsgUpdateWhitelistedRelayersResponse {}

// MsgUnbond defines a SDK message for performing an undelegation from a
// bond and a sequencer.
message MsgUnbond {
Expand Down
Loading
Loading