Skip to content
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
2 changes: 1 addition & 1 deletion babylon/btccheckpoint/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ message GenesisState {
// Epochs data for each stored epoch
repeated EpochEntry epochs = 3 [ (gogoproto.nullable) = false ];
// Submission data for each stored submission key
repeated SubmissionEntry submissions = 4 [(gogoproto.nullable) = false ];
repeated SubmissionEntry submissions = 4 [ (gogoproto.nullable) = false ];
}

// EpochEntry represents data for a specific epoch number.
Expand Down
17 changes: 9 additions & 8 deletions babylon/btcstaking/v1/btcstaking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ message FinalityProvider {
// highest_voted_height is the highest height for which the
// finality provider has voted
uint32 highest_voted_height = 9;
// bsn_id is the ID of the BSN the finality provider is securing
string bsn_id = 10;
// NOTE: consumer_id field is not yet backported to the release branch.
// To keep it consistent with the code on main branch, consumer_info has field number 11 instead of 10.

// commission_info contains information details of the finality provider commission.
CommissionInfo commission_info = 11;
}
Expand Down Expand Up @@ -113,7 +114,8 @@ message BTCDelegation {
ProofOfPossessionBTC pop = 3;
// fp_btc_pk_list is the list of BIP-340 PKs of the finality providers that
// this BTC delegation delegates to
// If there are more than 1 PKs, then this means the delegation is multi-staked
// If there is more than 1 PKs, then this means the delegation is restaked
// to multiple finality providers
repeated bytes fp_btc_pk_list = 4
[ (gogoproto.customtype) =
"github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey" ];
Expand Down Expand Up @@ -279,9 +281,8 @@ message CovenantAdaptorSignatures {
bytes cov_pk = 1
[ (gogoproto.customtype) =
"github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey" ];
// adaptor_sigs is a list of adaptor signatures, each encrypted
// by the finality provider public keys involved in the multi-staking
// procedure
// adaptor_sigs is a list of adaptor signatures, each encrypted by a restaked
// BTC finality provider's public key
repeated bytes adaptor_sigs = 2;
}

Expand All @@ -299,8 +300,8 @@ message SelectiveSlashingEvidence {
// fp_btc_pk is the BTC PK of the finality provider who
// launches the selective slashing offence
bytes fp_btc_pk = 2
[ (gogoproto.customtype) =
"github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey" ];
[ (gogoproto.customtype) =
"github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey" ];
// recovered_fp_btc_sk is the finality provider's BTC SK recovered from
// the covenant adaptor/Schnorr signature pair. It is the consequence
// of selective slashing.
Expand Down
46 changes: 3 additions & 43 deletions babylon/btcstaking/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@ package babylon.btcstaking.v1;
import "gogoproto/gogo.proto";
import "babylon/btcstaking/v1/btcstaking.proto";
import "amino/amino.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";

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

// EventNewFinalityProvider is the event emitted when new finality provider is created
message EventNewFinalityProvider {
FinalityProvider fp = 1;
}

// EventFinalityProviderCreated is the event emitted when a finality provider is created
message EventFinalityProviderCreated {
// btc_pk_hex is the hex string of Bitcoin secp256k1 PK of this finality provider
Expand All @@ -32,8 +25,6 @@ message EventFinalityProviderCreated {
string security_contact = 7;
// details define other optional details.
string details = 8;
// bsn_id is the id of the BSN
string bsn_id = 9 [(amino.dont_omitempty) = true];
}

// EventFinalityProviderEdited is the event emitted when a finality provider is edited
Expand Down Expand Up @@ -82,19 +73,19 @@ message EventPowerDistUpdate {
// is slashed
// TODO: unify with existing slashing events
message EventSlashedFinalityProvider {
bytes pk = 1 [(gogoproto.customtype) = "github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey"];
bytes pk = 1 [ (gogoproto.customtype) = "github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey" ];
}

// EventJailedFinalityProvider defines an event that a finality provider
// is jailed after being detected sluggish
message EventJailedFinalityProvider {
bytes pk = 1 [(gogoproto.customtype) = "github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey"];
bytes pk = 1 [ (gogoproto.customtype) = "github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey" ];
}

// EventUnjailedFinalityProvider defines an event that a jailed finality provider
// is unjailed after the jailing period is passed
message EventUnjailedFinalityProvider {
bytes pk = 1 [(gogoproto.customtype) = "github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey"];
bytes pk = 1 [ (gogoproto.customtype) = "github.com/babylonlabs-io/babylon/v4/types.BIP340PubKey" ];
}

// ev is the event that affects voting power distribution
Expand Down Expand Up @@ -261,34 +252,3 @@ message EventUnexpectedUnbondingTx {
// spend_stake_tx_block_index is the spend_stake_tx index in the block
uint32 spend_stake_tx_block_index = 4 [(amino.dont_omitempty) = true];
}

// EventAddBsnRewards event that rewards were added for BSN finality providers
message EventAddBsnRewards {
// Sender is the babylon address which paid for the rewards
string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// BsnConsumerId is the ID of the BSN consumer
string bsn_consumer_id = 2;
// TotalRewards is the total amount of rewards that were distributed
repeated cosmos.base.v1beta1.Coin total_rewards = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// BabylonCommission is the amount of commission collected by Babylon
repeated cosmos.base.v1beta1.Coin babylon_commission = 4 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// FpRatios contains the finality providers and their respective reward ratios
repeated EventFpRewardInfo fp_ratios = 5 [(gogoproto.nullable) = false];
}

// EventFpRewardInfo contains finality provider reward information for events
message EventFpRewardInfo {
// BtcPK is the Bitcoin secp256k1 PK of the finality provider
string fp_btc_pk_hex = 1 [(amino.dont_omitempty) = true];
// TotalRewards is the total amount allocated to this finality provider
repeated cosmos.base.v1beta1.Coin total_rewards = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
}
18 changes: 4 additions & 14 deletions babylon/btcstaking/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "gogoproto/gogo.proto";
import "babylon/btcstaking/v1/params.proto";
import "babylon/btcstaking/v1/btcstaking.proto";
import "babylon/btcstaking/v1/events.proto";
import "babylon/btcstaking/v1/packet.proto";

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

Expand All @@ -24,12 +23,12 @@ message GenesisState {
repeated BTCDelegator btc_delegators = 6;
// all the events and its indexes.
repeated EventIndex events = 7;
// Reserved for previous collection of the allowed staking transaction hashes (hex encoded)
reserved 8;
// collection of the allowed staking transaction hashes (hex encoded)
repeated string allowed_staking_tx_hashes = 8;
// largest BTC block reorg
LargestBtcReOrg largest_btc_reorg = 9;
// all consumer chain events
repeated ConsumerEvent consumer_events = 10;
// Reserved for consumer chain events
reserved 10;
// Reserved for previous collection of the allowed multi-staking transaction hashes (hex encoded)
reserved 11;
// FpBbnAddr defines a list of the finality provider indexed by their babylon address.
Expand Down Expand Up @@ -69,12 +68,3 @@ message EventIndex {
// event the event stored.
EventPowerDistUpdate event = 3;
}

// ConsumerEvent contains the events belonging to a specific consumer chain.
message ConsumerEvent {
// consumer_id is the identifier of the consumer chain
string consumer_id = 1;
// events holds all the events (NewFinalityProvider, ActiveBTCDelegation, UnbondedBTCDelegation)
// for the consumer chain
BTCStakingIBCPacket events = 2;
}
9 changes: 3 additions & 6 deletions babylon/btcstaking/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,13 @@ message Params {
];
// base gas fee for delegation creation
uint64 delegation_creation_base_gas_fee = 13;
// DEPRECATED: allow_list_expiration_height is the height at which the allow list expires
// allow_list_expiration_height is the height at which the allow list expires
// i.e all staking transactions are allowed to enter Babylon chain afterwards
// setting it to 0 means allow list is disabled (LEGACY)
uint64 allow_list_expiration_height = 14 [deprecated = true];
// setting it to 0 means allow list is disabled
uint64 allow_list_expiration_height = 14;
// btc_activation_height is the btc height from which parameters are activated
// (inclusive)
uint32 btc_activation_height = 15;
// max_finality_providers is the maximum number of finality providers that can
// be used in staking script
uint32 max_finality_providers = 16;
}

// HeightVersionPair pairs a btc height with a version of the parameters
Expand Down
Loading