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

bump babylon v1.0.0-rc.4 #119

Merged
merged 4 commits into from
Jan 28, 2025
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ to create payload for phase-1/phase-2 PoP deletion
to sign Cosmos ADR-36 messages
- [#118](https://github.com/babylonlabs-io/btc-staker/pull/118) Add CLI command
to validate PoP JSON file
- [#119](https://github.com/babylonlabs-io/btc-staker/pull/119) Bump Babylon version
to v1.0.0-rc.4

## v0.14.0

Expand Down
14 changes: 7 additions & 7 deletions babylonclient/babyloncontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strings"
"time"

bct "github.com/babylonlabs-io/babylon/client/babylonclient"
btcctypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"

sdkErr "cosmossdk.io/errors"
Expand All @@ -33,7 +34,6 @@ import (
bq "github.com/cosmos/cosmos-sdk/types/query"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
sttypes "github.com/cosmos/cosmos-sdk/x/staking/types"
pv "github.com/cosmos/relayer/v2/relayer/provider"
"github.com/sirupsen/logrus"
"go.uber.org/zap"
)
Expand Down Expand Up @@ -506,14 +506,14 @@ func delegationDataToMsg(dg *DelegationData) (*btcstypes.MsgCreateBTCDelegation,

func (bc *BabylonController) reliablySendMsgs(
msgs []sdk.Msg,
) (*pv.RelayerTxResponse, error) {
) (*bct.RelayerTxResponse, error) {
// TODO Empty errors ??
return bc.bbnClient.ReliablySendMsgs(context.Background(), msgs, []*sdkErr.Error{}, []*sdkErr.Error{})
}

// TODO: for now return sdk.TxResponse, it will ease up debugging/testing
// ultimately we should create our own type ate
func (bc *BabylonController) Delegate(dg *DelegationData) (*pv.RelayerTxResponse, error) {
func (bc *BabylonController) Delegate(dg *DelegationData) (*bct.RelayerTxResponse, error) {
delegateMsg, err := delegationDataToMsg(dg)
if err != nil {
return nil, err
Expand Down Expand Up @@ -793,7 +793,7 @@ func (bc *BabylonController) QueryHeaderDepth(headerHash *chainhash.Hash) (uint3
}

// InsertBtcBlockHeaders Insert BTC block header using rpc client
func (bc *BabylonController) InsertBtcBlockHeaders(headers []*wire.BlockHeader) (*pv.RelayerTxResponse, error) {
func (bc *BabylonController) InsertBtcBlockHeaders(headers []*wire.BlockHeader) (*bct.RelayerTxResponse, error) {
msg := &btclctypes.MsgInsertHeaders{
Signer: bc.getTxSigner(),
Headers: chainToChainBytes(headers),
Expand Down Expand Up @@ -956,7 +956,7 @@ func (bc *BabylonController) CreateCovenantMessage(

func (bc *BabylonController) SubmitMultipleCovenantMessages(
covenantMsgs []*btcstypes.MsgAddCovenantSigs,
) (*pv.RelayerTxResponse, error) {
) (*bct.RelayerTxResponse, error) {
var msgs []sdk.Msg

for _, covenantMsg := range covenantMsgs {
Expand Down Expand Up @@ -990,7 +990,7 @@ func (bc *BabylonController) GetBBNClient() *bbnclient.Client {
return bc.bbnClient
}

func (bc *BabylonController) InsertSpvProofs(submitter string, proofs []*btcctypes.BTCSpvProof) (*pv.RelayerTxResponse, error) {
func (bc *BabylonController) InsertSpvProofs(submitter string, proofs []*btcctypes.BTCSpvProof) (*bct.RelayerTxResponse, error) {
msg := &btcctypes.MsgInsertBTCSpvProof{
Submitter: submitter,
Proofs: proofs,
Expand All @@ -1015,7 +1015,7 @@ func (bc *BabylonController) QueryBtcLightClientTipHeight() (uint32, error) {

func (bc *BabylonController) ActivateDelegation(
stakingTxHash chainhash.Hash,
proof *btcctypes.BTCSpvProof) (*pv.RelayerTxResponse, error) {
proof *btcctypes.BTCSpvProof) (*bct.RelayerTxResponse, error) {
msg := &btcstypes.MsgAddBTCDelegationInclusionProof{
Signer: bc.getTxSigner(),
StakingTxHash: stakingTxHash.String(),
Expand Down
12 changes: 6 additions & 6 deletions babylonclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package babylonclient

import (
"fmt"
bct "github.com/babylonlabs-io/babylon/client/babylonclient"

sdkmath "cosmossdk.io/math"
"github.com/babylonlabs-io/babylon/testutil/datagen"
Expand All @@ -13,7 +14,6 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
pv "github.com/cosmos/relayer/v2/relayer/provider"
)

type BTCCheckpointParams struct {
Expand Down Expand Up @@ -78,7 +78,7 @@ type BabylonClient interface {
BTCCheckpointParams() (*BTCCheckpointParams, error)
Params() (*StakingParams, error)
ParamsByBtcHeight(btcHeight uint32) (*StakingParams, error)
Delegate(dg *DelegationData) (*pv.RelayerTxResponse, error)
Delegate(dg *DelegationData) (*bct.RelayerTxResponse, error)
QueryFinalityProviders(limit uint64, offset uint64) (*FinalityProvidersClientResponse, error)
QueryFinalityProvider(btcPubKey *btcec.PublicKey) (*FinalityProviderClientResponse, error)
QueryHeaderDepth(headerHash *chainhash.Hash) (uint32, error)
Expand Down Expand Up @@ -138,15 +138,15 @@ func (m *MockBabylonClient) GetPubKey() *secp256k1.PubKey {
}
}

func (m *MockBabylonClient) Delegate(dg *DelegationData) (*pv.RelayerTxResponse, error) {
func (m *MockBabylonClient) Delegate(dg *DelegationData) (*bct.RelayerTxResponse, error) {
msg, err := delegationDataToMsg(dg)
if err != nil {
return nil, err
}

m.SentMessages <- msg

return &pv.RelayerTxResponse{Code: 0}, nil
return &bct.RelayerTxResponse{Code: 0}, nil
}

func (m *MockBabylonClient) QueryFinalityProviders(_ uint64, _ uint64) (*FinalityProvidersClientResponse, error) {
Expand Down Expand Up @@ -180,8 +180,8 @@ func (m *MockBabylonClient) QueryDelegationInfo(_ *chainhash.Hash) (*DelegationI
}

func (m *MockBabylonClient) Undelegate(
_ *UndelegationRequest) (*pv.RelayerTxResponse, error) {
return &pv.RelayerTxResponse{Code: 0}, nil
_ *UndelegationRequest) (*bct.RelayerTxResponse, error) {
return &bct.RelayerTxResponse{Code: 0}, nil
}

func (m *MockBabylonClient) GetLatestBlockHeight() (uint64, error) {
Expand Down
10 changes: 5 additions & 5 deletions babylonclient/msgsender.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"sync"

pv "github.com/cosmos/relayer/v2/relayer/provider"
bct "github.com/babylonlabs-io/babylon/client/babylonclient"
"golang.org/x/sync/semaphore"

"github.com/babylonlabs-io/btc-staker/utils"
Expand All @@ -19,7 +19,7 @@ var (
)

type sendDelegationRequest struct {
utils.Request[*pv.RelayerTxResponse]
utils.Request[*bct.RelayerTxResponse]
dg *DelegationData
requiredInclusionBlockDepth uint32
}
Expand All @@ -29,7 +29,7 @@ func newSendDelegationRequest(
requiredInclusionBlockDepth uint32,
) sendDelegationRequest {
return sendDelegationRequest{
Request: utils.NewRequest[*pv.RelayerTxResponse](),
Request: utils.NewRequest[*bct.RelayerTxResponse](),
dg: dg,
requiredInclusionBlockDepth: requiredInclusionBlockDepth,
}
Expand Down Expand Up @@ -175,10 +175,10 @@ func (m *BabylonMsgSender) handleSentToBabylon() {
func (m *BabylonMsgSender) SendDelegation(
dg *DelegationData,
requiredInclusionBlockDepth uint32,
) (*pv.RelayerTxResponse, error) {
) (*bct.RelayerTxResponse, error) {
req := newSendDelegationRequest(dg, requiredInclusionBlockDepth)

return utils.SendRequestAndWaitForResponseOrQuit[*pv.RelayerTxResponse, *sendDelegationRequest](
return utils.SendRequestAndWaitForResponseOrQuit[*bct.RelayerTxResponse, *sendDelegationRequest](
&req,
m.sendDelegationRequestChan,
m.quit,
Expand Down
Loading
Loading