diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index a8328aad..efa0f8ae 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -49749,6 +49749,7 @@ paths: - DKG_REQUEST_STATUS_PENDING - DKG_REQUEST_STATUS_COMPLETED - DKG_REQUEST_STATUS_FAILED + - DKG_REQUEST_STATUS_TIMEDOUT default: DKG_REQUEST_STATUS_UNSPECIFIED title: DKG Request description: >- @@ -49946,6 +49947,7 @@ paths: - DKG_REQUEST_STATUS_PENDING: DKG_REQUEST_STATUS_PENDING defines the status of the DKG request which is pending - DKG_REQUEST_STATUS_COMPLETED: DKG_REQUEST_STATUS_COMPLETED defines the status of the DKG request which is completed - DKG_REQUEST_STATUS_FAILED: DKG_REQUEST_STATUS_FAILED defines the status of the DKG request which failed + - DKG_REQUEST_STATUS_TIMEDOUT: DKG_REQUEST_STATUS_TIMEDOUT defines the status of the DKG request which timed out in: query required: false type: string @@ -49954,6 +49956,7 @@ paths: - DKG_REQUEST_STATUS_PENDING - DKG_REQUEST_STATUS_COMPLETED - DKG_REQUEST_STATUS_FAILED + - DKG_REQUEST_STATUS_TIMEDOUT default: DKG_REQUEST_STATUS_UNSPECIFIED tags: - Query @@ -50006,6 +50009,7 @@ paths: - DKG_REQUEST_STATUS_PENDING - DKG_REQUEST_STATUS_COMPLETED - DKG_REQUEST_STATUS_FAILED + - DKG_REQUEST_STATUS_TIMEDOUT default: DKG_REQUEST_STATUS_UNSPECIFIED title: DKG Request description: >- @@ -50259,6 +50263,7 @@ paths: - DKG_REQUEST_STATUS_PENDING - DKG_REQUEST_STATUS_COMPLETED - DKG_REQUEST_STATUS_FAILED + - DKG_REQUEST_STATUS_TIMEDOUT default: DKG_REQUEST_STATUS_UNSPECIFIED title: DKG Request description: >- @@ -82532,6 +82537,7 @@ definitions: - DKG_REQUEST_STATUS_PENDING - DKG_REQUEST_STATUS_COMPLETED - DKG_REQUEST_STATUS_FAILED + - DKG_REQUEST_STATUS_TIMEDOUT default: DKG_REQUEST_STATUS_UNSPECIFIED title: DKG Request side.btcbridge.DKGRequestStatus: @@ -82541,6 +82547,7 @@ definitions: - DKG_REQUEST_STATUS_PENDING - DKG_REQUEST_STATUS_COMPLETED - DKG_REQUEST_STATUS_FAILED + - DKG_REQUEST_STATUS_TIMEDOUT default: DKG_REQUEST_STATUS_UNSPECIFIED title: >- - DKG_REQUEST_STATUS_UNSPECIFIED: DKG_REQUEST_STATUS_UNSPECIFIED defines @@ -82548,6 +82555,7 @@ definitions: - DKG_REQUEST_STATUS_PENDING: DKG_REQUEST_STATUS_PENDING defines the status of the DKG request which is pending - DKG_REQUEST_STATUS_COMPLETED: DKG_REQUEST_STATUS_COMPLETED defines the status of the DKG request which is completed - DKG_REQUEST_STATUS_FAILED: DKG_REQUEST_STATUS_FAILED defines the status of the DKG request which failed + - DKG_REQUEST_STATUS_TIMEDOUT: DKG_REQUEST_STATUS_TIMEDOUT defines the status of the DKG request which timed out side.btcbridge.MsgCompleteDKGResponse: type: object description: MsgCompleteDKGResponse defines the Msg/CompleteDKG response type. @@ -82760,6 +82768,7 @@ definitions: - DKG_REQUEST_STATUS_PENDING - DKG_REQUEST_STATUS_COMPLETED - DKG_REQUEST_STATUS_FAILED + - DKG_REQUEST_STATUS_TIMEDOUT default: DKG_REQUEST_STATUS_UNSPECIFIED title: DKG Request description: >- @@ -82912,6 +82921,7 @@ definitions: - DKG_REQUEST_STATUS_PENDING - DKG_REQUEST_STATUS_COMPLETED - DKG_REQUEST_STATUS_FAILED + - DKG_REQUEST_STATUS_TIMEDOUT default: DKG_REQUEST_STATUS_UNSPECIFIED title: DKG Request description: >- @@ -82961,6 +82971,7 @@ definitions: - DKG_REQUEST_STATUS_PENDING - DKG_REQUEST_STATUS_COMPLETED - DKG_REQUEST_STATUS_FAILED + - DKG_REQUEST_STATUS_TIMEDOUT default: DKG_REQUEST_STATUS_UNSPECIFIED title: DKG Request description: >- diff --git a/proto/side/btcbridge/bitcoin.proto b/proto/side/btcbridge/bitcoin.proto index 5199fbc5..3b749cfa 100644 --- a/proto/side/btcbridge/bitcoin.proto +++ b/proto/side/btcbridge/bitcoin.proto @@ -101,6 +101,8 @@ enum DKGRequestStatus { DKG_REQUEST_STATUS_COMPLETED = 2; // DKG_REQUEST_STATUS_FAILED defines the status of the DKG request which failed DKG_REQUEST_STATUS_FAILED = 3; + // DKG_REQUEST_STATUS_TIMEDOUT defines the status of the DKG request which timed out + DKG_REQUEST_STATUS_TIMEDOUT = 4; } // DKG Request diff --git a/proto/side/btcbridge/tx.proto b/proto/side/btcbridge/tx.proto index aea54641..30d1328c 100644 --- a/proto/side/btcbridge/tx.proto +++ b/proto/side/btcbridge/tx.proto @@ -63,11 +63,9 @@ message MsgSubmitWithdrawTransaction { // this is relayer address who submit the bitcoin transaction to the side chain string sender = 1; string blockhash = 2; - // the previous tx bytes in base64 format - string prev_tx_bytes = 3; // the tx bytes in base64 format - string tx_bytes = 4; - repeated string proof = 5; + string tx_bytes = 3; + repeated string proof = 4; } // MsgSubmitWithdrawTransactionResponse defines the Msg/SubmitWithdrawTransaction response type. diff --git a/x/btcbridge/abci.go b/x/btcbridge/abci.go index bdb98f6d..6cedfdb8 100644 --- a/x/btcbridge/abci.go +++ b/x/btcbridge/abci.go @@ -14,7 +14,7 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) { for _, req := range pendingDKGRequests { // check if the DKG request expired if !ctx.BlockTime().Before(*req.Expiration) { - req.Status = types.DKGRequestStatus_DKG_REQUEST_STATUS_FAILED + req.Status = types.DKGRequestStatus_DKG_REQUEST_STATUS_TIMEDOUT continue } diff --git a/x/btcbridge/genesis.go b/x/btcbridge/genesis.go index 32486aa1..377433f7 100644 --- a/x/btcbridge/genesis.go +++ b/x/btcbridge/genesis.go @@ -20,7 +20,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) // import utxos for _, utxo := range genState.Utxos { - k.SetUTXO(ctx, utxo) + k.SaveUTXO(ctx, utxo) } } @@ -30,6 +30,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.Params = k.GetParams(ctx) genesis.BestBlockHeader = k.GetBestBlockHeader(ctx) genesis.BlockHeaders = k.GetAllBlockHeaders(ctx) + genesis.Utxos = k.GetAllUTXOs(ctx) // this line is used by starport scaffolding # genesis/module/export diff --git a/x/btcbridge/keeper/keeper.go b/x/btcbridge/keeper/keeper.go index 6f1fcbde..05b5b049 100644 --- a/x/btcbridge/keeper/keeper.go +++ b/x/btcbridge/keeper/keeper.go @@ -215,46 +215,51 @@ func (k Keeper) ValidateTransaction(ctx sdk.Context, txBytes string, prevTxBytes } // Create a new transaction - var tx wire.MsgTx - err = tx.Deserialize(bytes.NewReader(rawTx)) + var msgTx wire.MsgTx + err = msgTx.Deserialize(bytes.NewReader(rawTx)) if err != nil { fmt.Println("Error deserializing transaction:", err) return nil, nil, err } - uTx := btcutil.NewTx(&tx) + tx := btcutil.NewTx(&msgTx) // Validate the transaction - if err := blockchain.CheckTransactionSanity(uTx); err != nil { + if err := blockchain.CheckTransactionSanity(tx); err != nil { fmt.Println("Transaction is not valid:", err) return nil, nil, err } - // Decode the previous transaction - rawPrevTx, err := base64.StdEncoding.DecodeString(prevTxBytes) - if err != nil { - fmt.Println("Error decoding transaction from base64:", err) - return nil, nil, err - } + var prevTx *btcutil.Tx - // Create a new transaction - var prevMsgTx wire.MsgTx - err = prevMsgTx.Deserialize(bytes.NewReader(rawPrevTx)) - if err != nil { - fmt.Println("Error deserializing transaction:", err) - return nil, nil, err - } + // Check the previous tx if given + if len(prevTxBytes) > 0 { + // Decode the previous transaction + rawPrevTx, err := base64.StdEncoding.DecodeString(prevTxBytes) + if err != nil { + fmt.Println("Error decoding transaction from base64:", err) + return nil, nil, err + } - prevTx := btcutil.NewTx(&prevMsgTx) + // Create a new transaction + var prevMsgTx wire.MsgTx + err = prevMsgTx.Deserialize(bytes.NewReader(rawPrevTx)) + if err != nil { + fmt.Println("Error deserializing transaction:", err) + return nil, nil, err + } - // Validate the transaction - if err := blockchain.CheckTransactionSanity(prevTx); err != nil { - fmt.Println("Transaction is not valid:", err) - return nil, nil, err - } + prevTx = btcutil.NewTx(&prevMsgTx) - if uTx.MsgTx().TxIn[0].PreviousOutPoint.Hash.String() != prevTx.Hash().String() { - return nil, nil, types.ErrInvalidBtcTransaction + // Validate the transaction + if err := blockchain.CheckTransactionSanity(prevTx); err != nil { + fmt.Println("Transaction is not valid:", err) + return nil, nil, err + } + + if tx.MsgTx().TxIn[0].PreviousOutPoint.Hash.String() != prevTx.Hash().String() { + return nil, nil, types.ErrInvalidBtcTransaction + } } // check if the proof is valid @@ -263,10 +268,10 @@ func (k Keeper) ValidateTransaction(ctx sdk.Context, txBytes string, prevTxBytes return nil, nil, err } - if !types.VerifyMerkleProof(proof, uTx.Hash(), root) { + if !types.VerifyMerkleProof(proof, tx.Hash(), root) { k.Logger(ctx).Error("Invalid merkle proof", "txhash", tx, "root", root, "proof", proof) return nil, nil, types.ErrTransactionNotIncluded } - return uTx, prevTx, nil + return tx, prevTx, nil } diff --git a/x/btcbridge/keeper/keeper_deposit.go b/x/btcbridge/keeper/keeper_deposit.go index 514f245c..24922d17 100644 --- a/x/btcbridge/keeper/keeper_deposit.go +++ b/x/btcbridge/keeper/keeper_deposit.go @@ -66,7 +66,7 @@ func (k Keeper) Mint(ctx sdk.Context, tx *btcutil.Tx, prevTx *btcutil.Tx, height } // check if the receiver is one of the vault addresses - vault := types.SelectVaultByBitcoinAddress(params.Vaults, addr.EncodeAddress()) + vault := types.SelectVaultByAddress(params.Vaults, addr.EncodeAddress()) if vault == nil { continue } diff --git a/x/btcbridge/keeper/keeper_tss.go b/x/btcbridge/keeper/keeper_tss.go index 95b597d8..5cbea8cc 100644 --- a/x/btcbridge/keeper/keeper_tss.go +++ b/x/btcbridge/keeper/keeper_tss.go @@ -216,7 +216,7 @@ func (k Keeper) CheckVaults(ctx sdk.Context, vaults []string) error { } for _, v := range vaults { - if types.SelectVaultByBitcoinAddress(currentVaults, v) != nil { + if types.SelectVaultByAddress(currentVaults, v) != nil { return types.ErrInvalidDKGCompletionRequest } } diff --git a/x/btcbridge/keeper/keeper_utxo.go b/x/btcbridge/keeper/keeper_utxo.go index 2ddd3abd..4fe48b23 100644 --- a/x/btcbridge/keeper/keeper_utxo.go +++ b/x/btcbridge/keeper/keeper_utxo.go @@ -339,6 +339,12 @@ func (bk *BaseUTXOKeeper) SpendUTXOs(ctx sdk.Context, utxos []*types.UTXO) error return nil } +// SaveUTXO saves the given utxo +// Intended to be used out of the module, such as genesis import +func (bk *BaseUTXOKeeper) SaveUTXO(ctx sdk.Context, utxo *types.UTXO) { + bk.saveUTXO(ctx, utxo) +} + // saveUTXO saves the given utxo func (bk *BaseUTXOKeeper) saveUTXO(ctx sdk.Context, utxo *types.UTXO) { bk.SetUTXO(ctx, utxo) diff --git a/x/btcbridge/keeper/keeper_withdraw.go b/x/btcbridge/keeper/keeper_withdraw.go index ee6072c3..8fc30787 100644 --- a/x/btcbridge/keeper/keeper_withdraw.go +++ b/x/btcbridge/keeper/keeper_withdraw.go @@ -252,7 +252,7 @@ func (k Keeper) FilterWithdrawRequestsByAddr(ctx sdk.Context, req *types.QueryWi func (k Keeper) ProcessBitcoinWithdrawTransaction(ctx sdk.Context, msg *types.MsgSubmitWithdrawTransaction) (*chainhash.Hash, error) { ctx.Logger().Info("accept bitcoin withdraw tx", "blockhash", msg.Blockhash) - tx, _, err := k.ValidateTransaction(ctx, msg.TxBytes, msg.PrevTxBytes, msg.Blockhash, msg.Proof) + tx, _, err := k.ValidateTransaction(ctx, msg.TxBytes, "", msg.Blockhash, msg.Proof) if err != nil { return nil, err } @@ -294,15 +294,15 @@ func (k Keeper) spendUTXOs(ctx sdk.Context, uTx *btcutil.Tx) { } } -// handleTxFee performs the fee handling for the btc withdrawal tx +// handleBtcTxFee performs the network fee handling for the btc withdrawal tx // Make sure that the given psbt is valid -// There are at most two outputs and the change output is the last one if any +// There are at most three outpus and the change output is the last one if any func (k Keeper) handleBtcTxFee(p *psbt.Packet, changeAddr string) (*types.UTXO, error) { - recipientOut := p.UnsignedTx.TxOut[0] + recipientOut := p.UnsignedTx.TxOut[1] changeOut := new(wire.TxOut) - if len(p.UnsignedTx.TxOut) > 1 { - changeOut = p.UnsignedTx.TxOut[1] + if len(p.UnsignedTx.TxOut) > 2 { + changeOut = p.UnsignedTx.TxOut[2] } else { changeOut = wire.NewTxOut(0, types.MustPkScriptFromAddress(changeAddr)) p.UnsignedTx.TxOut = append(p.UnsignedTx.TxOut, changeOut) diff --git a/x/btcbridge/types/bitcoin.go b/x/btcbridge/types/bitcoin.go index 41ef6de4..14a76b92 100644 --- a/x/btcbridge/types/bitcoin.go +++ b/x/btcbridge/types/bitcoin.go @@ -21,7 +21,7 @@ const ( MinRelayFee = 1000 // default sig hash type - DefaultSigHashType = txscript.SigHashAll + DefaultSigHashType = txscript.SigHashDefault ) // BuildPsbt builds a bitcoin psbt from the given params. diff --git a/x/btcbridge/types/bitcoin.pb.go b/x/btcbridge/types/bitcoin.pb.go index 7fb2ba1e..ed674752 100644 --- a/x/btcbridge/types/bitcoin.pb.go +++ b/x/btcbridge/types/bitcoin.pb.go @@ -81,6 +81,8 @@ const ( DKGRequestStatus_DKG_REQUEST_STATUS_COMPLETED DKGRequestStatus = 2 // DKG_REQUEST_STATUS_FAILED defines the status of the DKG request which failed DKGRequestStatus_DKG_REQUEST_STATUS_FAILED DKGRequestStatus = 3 + // DKG_REQUEST_STATUS_TIMEDOUT defines the status of the DKG request which timed out + DKGRequestStatus_DKG_REQUEST_STATUS_TIMEDOUT DKGRequestStatus = 4 ) var DKGRequestStatus_name = map[int32]string{ @@ -88,6 +90,7 @@ var DKGRequestStatus_name = map[int32]string{ 1: "DKG_REQUEST_STATUS_PENDING", 2: "DKG_REQUEST_STATUS_COMPLETED", 3: "DKG_REQUEST_STATUS_FAILED", + 4: "DKG_REQUEST_STATUS_TIMEDOUT", } var DKGRequestStatus_value = map[string]int32{ @@ -95,6 +98,7 @@ var DKGRequestStatus_value = map[string]int32{ "DKG_REQUEST_STATUS_PENDING": 1, "DKG_REQUEST_STATUS_COMPLETED": 2, "DKG_REQUEST_STATUS_FAILED": 3, + "DKG_REQUEST_STATUS_TIMEDOUT": 4, } func (x DKGRequestStatus) String() string { @@ -809,71 +813,72 @@ func init() { func init() { proto.RegisterFile("side/btcbridge/bitcoin.proto", fileDescriptor_b004a69efe3c7d84) } var fileDescriptor_b004a69efe3c7d84 = []byte{ - // 1015 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0xaf, 0x93, 0x34, 0x9b, 0xbc, 0x76, 0x43, 0x76, 0xa8, 0x42, 0x9a, 0x96, 0xb4, 0x8a, 0x10, - 0x2a, 0x8b, 0xe4, 0xa8, 0x45, 0x20, 0xae, 0x49, 0xed, 0xb6, 0x51, 0xba, 0x6d, 0x71, 0x52, 0x15, - 0x71, 0xb1, 0xc6, 0xf6, 0x90, 0x8c, 0x9a, 0x78, 0x8c, 0x67, 0x1c, 0xd2, 0x2b, 0x9f, 0x60, 0xc5, - 0x85, 0xef, 0xc0, 0x81, 0xcf, 0xb1, 0xc7, 0x3d, 0x72, 0x02, 0xd4, 0xde, 0x39, 0x71, 0x46, 0x68, - 0xc6, 0x76, 0xfe, 0x6d, 0xd8, 0xdb, 0xfc, 0xde, 0xfb, 0x3d, 0xbf, 0xdf, 0xfb, 0x33, 0x63, 0xd8, - 0xe7, 0xd4, 0x23, 0x4d, 0x47, 0xb8, 0x4e, 0x48, 0xbd, 0x01, 0x69, 0x3a, 0x54, 0xb8, 0x8c, 0xfa, - 0x7a, 0x10, 0x32, 0xc1, 0x50, 0x49, 0x7a, 0xf5, 0x99, 0xb7, 0xb6, 0x33, 0x60, 0x03, 0xa6, 0x5c, - 0x4d, 0x79, 0x8a, 0x59, 0xb5, 0xdd, 0x01, 0x63, 0x83, 0x11, 0x69, 0x2a, 0xe4, 0x44, 0xdf, 0x37, - 0xb1, 0xff, 0x90, 0xb8, 0x0e, 0x56, 0x5d, 0x82, 0x8e, 0x09, 0x17, 0x78, 0x1c, 0x24, 0x84, 0xba, - 0xcb, 0xf8, 0x98, 0xf1, 0xa6, 0x83, 0x39, 0x69, 0x4e, 0x8e, 0x1d, 0x22, 0xf0, 0x71, 0x73, 0xae, - 0xa0, 0xb6, 0x1b, 0xfb, 0xed, 0x38, 0x69, 0x0c, 0x12, 0xd7, 0xde, 0x8a, 0xf4, 0x00, 0x87, 0x78, - 0x9c, 0x38, 0x1b, 0xff, 0x68, 0xb0, 0xd5, 0x1e, 0x31, 0xf7, 0xfe, 0x82, 0x60, 0x8f, 0x84, 0xa8, - 0x0a, 0xcf, 0x26, 0x24, 0xe4, 0x94, 0xf9, 0x55, 0xed, 0x50, 0x3b, 0xca, 0x59, 0x29, 0x44, 0x08, - 0x72, 0x43, 0xcc, 0x87, 0xd5, 0xcc, 0xa1, 0x76, 0x54, 0xb4, 0xd4, 0x19, 0x55, 0x20, 0x3f, 0x24, - 0x74, 0x30, 0x14, 0xd5, 0xac, 0x22, 0x27, 0x08, 0xe9, 0xf0, 0x61, 0x10, 0x92, 0x09, 0x65, 0x11, - 0xb7, 0x1d, 0xf9, 0x75, 0x5b, 0x85, 0xe6, 0x54, 0xe8, 0x8b, 0xd4, 0x15, 0xe7, 0x95, 0xdf, 0x39, - 0x80, 0xad, 0x31, 0x09, 0xef, 0x47, 0xc4, 0x0e, 0x19, 0x13, 0xd5, 0x4d, 0xc5, 0x83, 0xd8, 0x64, - 0x31, 0x26, 0xd0, 0x0e, 0x6c, 0xfa, 0xcc, 0x77, 0x49, 0x35, 0xaf, 0xf2, 0xc4, 0x40, 0x4a, 0x72, - 0xa8, 0xe0, 0xd5, 0x67, 0xb1, 0x24, 0x79, 0x96, 0x36, 0xd9, 0xbb, 0x6a, 0x41, 0x11, 0xd5, 0x19, - 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fa, 0x18, 0x76, 0xdf, 0x89, 0xbe, 0xbe, 0x3a, 0xeb, 0x58, 0xaf, 0x4c, 0xa3, - 0x9c, 0x45, 0x35, 0xa8, 0xac, 0xba, 0xcf, 0x5a, 0x9d, 0x4b, 0xd3, 0x28, 0xe7, 0x5e, 0xfe, 0xa2, - 0x41, 0x79, 0xb5, 0xbd, 0xa8, 0x01, 0x75, 0xa3, 0x7b, 0x6e, 0x5b, 0xe6, 0x37, 0xb7, 0x66, 0xaf, - 0xbf, 0x5e, 0x71, 0x1d, 0x6a, 0x6b, 0x38, 0x37, 0xe6, 0x95, 0xd1, 0xb9, 0x3a, 0x2f, 0x6b, 0xe8, - 0x10, 0xf6, 0xd7, 0xf8, 0x4f, 0xaf, 0x5f, 0xdd, 0x5c, 0x9a, 0x33, 0xd5, 0x6b, 0x18, 0x89, 0xb2, - 0x6c, 0xfb, 0xe2, 0xcd, 0x63, 0x5d, 0x7b, 0xfb, 0x58, 0xd7, 0xfe, 0x7a, 0xac, 0x6b, 0xaf, 0x9f, - 0xea, 0x1b, 0x6f, 0x9f, 0xea, 0x1b, 0xbf, 0x3f, 0xd5, 0x37, 0xbe, 0xd3, 0x07, 0x54, 0x0c, 0x23, - 0x47, 0x77, 0xd9, 0xb8, 0x29, 0x37, 0x45, 0x2d, 0x9a, 0xcb, 0x46, 0x0a, 0x34, 0xa7, 0x0b, 0xff, - 0x44, 0xf1, 0x10, 0x10, 0xee, 0xe4, 0x15, 0xe1, 0x8b, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf0, - 0x6c, 0xad, 0xdf, 0xed, 0x07, 0x00, 0x00, + // 1028 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0x4d, 0x6f, 0xeb, 0x44, + 0x17, 0xae, 0x93, 0x34, 0x37, 0x39, 0xed, 0xcd, 0x9b, 0x3b, 0x6f, 0x15, 0xd2, 0xb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c8, 0x29, 0xf3, 0xab, 0xda, 0xa1, 0x76, 0x94, 0xb3, 0x52, 0x88, 0x10, + 0xe4, 0x86, 0x98, 0x0f, 0xab, 0x99, 0x43, 0xed, 0xa8, 0x68, 0xa9, 0x33, 0xaa, 0x40, 0x7e, 0x48, + 0xe8, 0x60, 0x28, 0xaa, 0x59, 0x45, 0x4e, 0x10, 0xd2, 0xe1, 0xff, 0x41, 0x48, 0x26, 0x94, 0x45, + 0xdc, 0x76, 0xe4, 0xd7, 0x6d, 0x15, 0x9a, 0x53, 0xa1, 0xaf, 0x52, 0x57, 0x9c, 0x57, 0x7e, 0xe7, + 0x00, 0xb6, 0xc6, 0x24, 0x7c, 0x18, 0x11, 0x3b, 0x64, 0x4c, 0x54, 0x37, 0x15, 0x0f, 0x62, 0x93, + 0xc5, 0x98, 0x40, 0x3b, 0xb0, 0xe9, 0x33, 0xdf, 0x25, 0xd5, 0xbc, 0xca, 0x13, 0x03, 0x29, 0xc9, + 0xa1, 0x82, 0x57, 0x5f, 0xc4, 0x92, 0xe4, 0x59, 0xda, 0x64, 0xef, 0xaa, 0x05, 0x45, 0x54, 0x67, + 0x54, 0x86, 0xac, 0x2f, 0xa6, 0xd5, 0xa2, 0x32, 0xc9, 0x63, 0xe3, 0x67, 0x0d, 0x2a, 0xed, 0x78, + 0x84, 0xf7, 0x54, 0x0c, 0xbd, 0x10, 0x7f, 0x6f, 0x91, 0xef, 0x22, 0xc2, 0x85, 0xec, 0x00, 0xf6, + 0xbc, 0x90, 0x70, 0xae, 0x3a, 0x50, 0xb4, 0x52, 0x88, 0x6a, 0x50, 0xe0, 0x92, 0x24, 0x75, 0x64, + 0xd4, 0xb7, 0x66, 0x58, 0xa5, 0x9d, 0x52, 0x4f, 0xf5, 0xa1, 0x68, 0xa9, 0xb3, 0xb4, 0x05, 0xdc, + 0x11, 0x49, 0xd9, 0xea, 0x8c, 0xbe, 0x80, 0x3c, 0x17, 0x58, 0x44, 0x5c, 0x15, 0x59, 0x3a,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x65, 0x65, 0xd5, 0x6b, 0xdc, 0xbd, 0xce, 0xb5, 0x69, 0xdc, 0xf6, 0x7b, 0xe5, 0x5c, 0xfb, 0xe2, + 0xed, 0x53, 0x5d, 0x7b, 0xf7, 0x54, 0xd7, 0xfe, 0x78, 0xaa, 0x6b, 0x6f, 0x9e, 0xeb, 0x1b, 0xef, + 0x9e, 0xeb, 0x1b, 0xbf, 0x3e, 0xd7, 0x37, 0xbe, 0xd1, 0x07, 0x54, 0x0c, 0x23, 0x47, 0x77, 0xd9, + 0xb8, 0x29, 0x57, 0x49, 0x6d, 0xa2, 0xcb, 0x46, 0x0a, 0x34, 0xa7, 0x0b, 0x3f, 0x4d, 0xf1, 0x18, + 0x10, 0xee, 0xe4, 0x15, 0xe1, 0xb3, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x8c, 0x88, 0xd4, + 0x0e, 0x08, 0x00, 0x00, } func (m *BlockHeader) Marshal() (dAtA []byte, err error) { diff --git a/x/btcbridge/types/codec.go b/x/btcbridge/types/codec.go index a18ad841..4941bef4 100644 --- a/x/btcbridge/types/codec.go +++ b/x/btcbridge/types/codec.go @@ -11,6 +11,9 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgSubmitBlockHeaders{}, "btcbridge/MsgSubmitBlockHeaders", nil) cdc.RegisterConcrete(&MsgSubmitDepositTransaction{}, "btcbridge/MsgSubmitDepositTransaction", nil) cdc.RegisterConcrete(&MsgSubmitWithdrawTransaction{}, "btcbridge/MsgSubmitWithdrawTransaction", nil) + cdc.RegisterConcrete(&MsgWithdrawToBitcoin{}, "btcbridge/MsgWithdrawToBitcoin", nil) + cdc.RegisterConcrete(&MsgSubmitWithdrawSignatures{}, "btcbridge/MsgSubmitWithdrawSignatures", nil) + cdc.RegisterConcrete(&MsgCompleteDKG{}, "btcbridge/MsgCompleteDKG", nil) cdc.RegisterConcrete(&MsgUpdateParams{}, "btcbridge/MsgUpdateParams", nil) // this line is used by starport scaffolding # 2 } @@ -19,6 +22,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitBlockHeaders{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitDepositTransaction{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitWithdrawTransaction{}) + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgWithdrawToBitcoin{}) + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitWithdrawSignatures{}) + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCompleteDKG{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}) // this line is used by starport scaffolding # 3 diff --git a/x/btcbridge/types/errors.go b/x/btcbridge/types/errors.go index d7470a72..b500f055 100644 --- a/x/btcbridge/types/errors.go +++ b/x/btcbridge/types/errors.go @@ -8,51 +8,43 @@ import ( // x/btcbridge module sentinel errors var ( - ErrSenderAddressNotAuthorized = errorsmod.Register(ModuleName, 1000, "sender address not authorized") - ErrInvalidHeader = errorsmod.Register(ModuleName, 1100, "invalid block header") - ErrReorgFailed = errorsmod.Register(ModuleName, 1101, "failed to reorg chain") - ErrForkedBlockHeader = errorsmod.Register(ModuleName, 1102, "Invalid forked block header") - - ErrInvalidSenders = errorsmod.Register(ModuleName, 2100, "invalid allowed senders") - - ErrInvalidBtcTransaction = errorsmod.Register(ModuleName, 3100, "invalid bitcoin transaction") - ErrBlockNotFound = errorsmod.Register(ModuleName, 3101, "block not found") - ErrTransactionNotIncluded = errorsmod.Register(ModuleName, 3102, "transaction not included in block") - ErrNotConfirmed = errorsmod.Register(ModuleName, 3200, "transaction not confirmed") - ErrExceedMaxAcceptanceDepth = errorsmod.Register(ModuleName, 3201, "exceed max acceptance block depth") - ErrUnsupportedScriptType = errorsmod.Register(ModuleName, 3202, "unsupported script type") - ErrTransactionAlreadyMinted = errorsmod.Register(ModuleName, 3203, "transaction already minted") - ErrInvalidDepositTransaction = errorsmod.Register(ModuleName, 3204, "invalid deposit transaction") - ErrInvalidWithdrawTransaction = errorsmod.Register(ModuleName, 3205, "invalid withdrawal transaction") - - ErrInvalidSignatures = errorsmod.Register(ModuleName, 4200, "invalid signatures") - ErrInsufficientBalance = errorsmod.Register(ModuleName, 4201, "insufficient balance") - ErrWithdrawRequestNotExist = errorsmod.Register(ModuleName, 4202, "withdrawal request does not exist") - ErrWithdrawRequestConfirmed = errorsmod.Register(ModuleName, 4203, "withdrawal request has been confirmed") - ErrInvalidStatus = errorsmod.Register(ModuleName, 4204, "invalid status") - - ErrUTXODoesNotExist = errorsmod.Register(ModuleName, 5100, "utxo does not exist") - ErrUTXOLocked = errorsmod.Register(ModuleName, 5101, "utxo locked") - ErrUTXOUnlocked = errorsmod.Register(ModuleName, 5102, "utxo unlocked") - - ErrInvalidAmount = errorsmod.Register(ModuleName, 6100, "invalid amount") - ErrInvalidFeeRate = errorsmod.Register(ModuleName, 6101, "invalid fee rate") - ErrAssetNotSupported = errorsmod.Register(ModuleName, 6102, "asset not supported") - ErrDustOutput = errorsmod.Register(ModuleName, 6103, "too small output amount") - ErrInsufficientUTXOs = errorsmod.Register(ModuleName, 6104, "insufficient utxos") - ErrFailToSerializePsbt = errorsmod.Register(ModuleName, 6105, "failed to serialize psbt") - ErrInvalidRunes = errorsmod.Register(ModuleName, 6106, "invalid runes") - ErrInvalidRuneId = errorsmod.Register(ModuleName, 6107, "invalid rune id") - - ErrInvalidParams = errorsmod.Register(ModuleName, 7100, "invalid module params") - - ErrInvalidDepositAmount = errorsmod.Register(ModuleName, 8100, "invalid deposit amount") - ErrInvalidWithdrawAmount = errorsmod.Register(ModuleName, 8101, "invalid withdrawal amount") - ErrInvalidSequence = errorsmod.Register(ModuleName, 8102, "invalid sequence") - - ErrInvalidDKGParams = errorsmod.Register(ModuleName, 9100, "invalid dkg params") - ErrDKGRequestDoesNotExist = errorsmod.Register(ModuleName, 9101, "dkg request does not exist") - ErrDKGCompletionRequestExists = errorsmod.Register(ModuleName, 9102, "dkg completion request already exists") - ErrInvalidDKGCompletionRequest = errorsmod.Register(ModuleName, 9103, "invalid dkg completion request") - ErrUnauthorizedDKGCompletionRequest = errorsmod.Register(ModuleName, 9104, "unauthorized dkg completion request") + ErrInvalidHeader = errorsmod.Register(ModuleName, 1100, "invalid block header") + ErrReorgFailed = errorsmod.Register(ModuleName, 1101, "failed to reorg chain") + ErrForkedBlockHeader = errorsmod.Register(ModuleName, 1102, "Invalid forked block header") + + ErrBlockNotFound = errorsmod.Register(ModuleName, 2101, "block not found") + ErrTransactionNotIncluded = errorsmod.Register(ModuleName, 2102, "transaction not included in block") + ErrNotConfirmed = errorsmod.Register(ModuleName, 2103, "transaction not confirmed") + ErrExceedMaxAcceptanceDepth = errorsmod.Register(ModuleName, 2104, "exceed max acceptance block depth") + ErrUnsupportedScriptType = errorsmod.Register(ModuleName, 2105, "unsupported script type") + ErrInvalidBtcTransaction = errorsmod.Register(ModuleName, 2106, "invalid bitcoin transaction") + ErrTransactionAlreadyMinted = errorsmod.Register(ModuleName, 2107, "transaction already minted") + ErrInvalidDepositTransaction = errorsmod.Register(ModuleName, 2108, "invalid deposit transaction") + ErrInvalidDepositAmount = errorsmod.Register(ModuleName, 2109, "invalid deposit amount") + + ErrInvalidAmount = errorsmod.Register(ModuleName, 3100, "invalid amount") + ErrInvalidFeeRate = errorsmod.Register(ModuleName, 3101, "invalid fee rate") + ErrAssetNotSupported = errorsmod.Register(ModuleName, 3102, "asset not supported") + ErrInvalidWithdrawAmount = errorsmod.Register(ModuleName, 3103, "invalid withdrawal amount") + ErrDustOutput = errorsmod.Register(ModuleName, 3104, "too small output amount") + ErrInsufficientUTXOs = errorsmod.Register(ModuleName, 3105, "insufficient utxos") + ErrFailToSerializePsbt = errorsmod.Register(ModuleName, 3106, "failed to serialize psbt") + ErrInvalidSignatures = errorsmod.Register(ModuleName, 3107, "invalid signatures") + ErrWithdrawRequestNotExist = errorsmod.Register(ModuleName, 3108, "withdrawal request does not exist") + ErrWithdrawRequestConfirmed = errorsmod.Register(ModuleName, 3109, "withdrawal request has been confirmed") + + ErrUTXODoesNotExist = errorsmod.Register(ModuleName, 4100, "utxo does not exist") + ErrUTXOLocked = errorsmod.Register(ModuleName, 4101, "utxo locked") + ErrUTXOUnlocked = errorsmod.Register(ModuleName, 4102, "utxo unlocked") + + ErrInvalidRunes = errorsmod.Register(ModuleName, 5100, "invalid runes") + ErrInvalidRuneId = errorsmod.Register(ModuleName, 5101, "invalid rune id") + + ErrInvalidParams = errorsmod.Register(ModuleName, 6100, "invalid module params") + + ErrInvalidDKGParams = errorsmod.Register(ModuleName, 7100, "invalid dkg params") + ErrDKGRequestDoesNotExist = errorsmod.Register(ModuleName, 7101, "dkg request does not exist") + ErrDKGCompletionRequestExists = errorsmod.Register(ModuleName, 7102, "dkg completion request already exists") + ErrInvalidDKGCompletionRequest = errorsmod.Register(ModuleName, 7103, "invalid dkg completion request") + ErrUnauthorizedDKGCompletionRequest = errorsmod.Register(ModuleName, 7104, "unauthorized dkg completion request") ) diff --git a/x/btcbridge/types/message_submit_deposit_transaction.go b/x/btcbridge/types/message_submit_deposit_transaction.go index 8377e1e1..5f6d6252 100644 --- a/x/btcbridge/types/message_submit_deposit_transaction.go +++ b/x/btcbridge/types/message_submit_deposit_transaction.go @@ -7,17 +7,19 @@ import ( const TypeMsgSubmitDepositTransaction = "submit_deposit_transaction" -func NewMsgSubmitTransaction( +func NewMsgSubmitDepositTransaction( sender string, blockhash string, - transaction string, + prevTx string, + tx string, proof []string, ) *MsgSubmitDepositTransaction { return &MsgSubmitDepositTransaction{ - Sender: sender, - Blockhash: blockhash, - TxBytes: transaction, - Proof: proof, + Sender: sender, + Blockhash: blockhash, + PrevTxBytes: prevTx, + TxBytes: tx, + Proof: proof, } } @@ -53,7 +55,7 @@ func (msg *MsgSubmitDepositTransaction) ValidateBasic() error { } if len(msg.PrevTxBytes) == 0 { - return sdkerrors.Wrap(ErrInvalidBtcTransaction, "transaction cannot be empty") + return sdkerrors.Wrap(ErrInvalidBtcTransaction, "previous transaction cannot be empty") } if len(msg.TxBytes) == 0 { diff --git a/x/btcbridge/types/params.go b/x/btcbridge/types/params.go index 52779b04..0dbd6598 100644 --- a/x/btcbridge/types/params.go +++ b/x/btcbridge/types/params.go @@ -10,6 +10,7 @@ import ( "github.com/btcsuite/btcd/txscript" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) var ( @@ -26,17 +27,19 @@ var ( // NewParams creates a new Params instance func NewParams() Params { return Params{ - Confirmations: 2, + Confirmations: 1, MaxAcceptableBlockDepth: 100, BtcVoucherDenom: "sat", Vaults: []*Vault{{ Address: "", PubKey: "", AssetType: AssetType_ASSET_TYPE_BTC, + Version: 0, }, { Address: "", PubKey: "", AssetType: AssetType_ASSET_TYPE_RUNE, + Version: 0, }}, ProtocolLimits: &ProtocolLimits{ BtcMinDeposit: 50000, // 0.0005 BTC @@ -46,7 +49,7 @@ func NewParams() Params { ProtocolFees: &ProtocolFees{ DepositFee: 8000, // 0.00008 BTC WithdrawFee: 12000, // 0.00012 BTC - Collector: "", + Collector: authtypes.NewModuleAddress(ModuleName).String(), }, NetworkFee: 8000, // 0.00008 BTC RewardEpoch: &DefaultRewardEpoch, @@ -68,38 +71,8 @@ func (p Params) Validate() error { return err } - vaults := make(map[string]bool) - - for _, vault := range p.Vaults { - if len(vault.Address) != 0 { - _, err := sdk.AccAddressFromBech32(vault.Address) - if err != nil { - return err - } - - _, ok := vaults[vault.Address] - if ok { - return ErrInvalidParams - } - - vaults[vault.Address] = true - } - - if len(vault.PubKey) != 0 { - pkBytes, err := hex.DecodeString(vault.PubKey) - if err != nil { - return err - } - - _, err = secp256k1.ParsePubKey(pkBytes) - if err != nil { - return err - } - } - - if vault.AssetType == AssetType_ASSET_TYPE_UNSPECIFIED { - return ErrInvalidParams - } + if err := validateVaults(p.Vaults); err != nil { + return err } if p.ProtocolLimits != nil { @@ -120,9 +93,8 @@ func (p Params) Validate() error { return nil } -// SelectVaultByBitcoinAddress returns the vault if the address is found -// returns the vault if the address is found -func SelectVaultByBitcoinAddress(vaults []*Vault, address string) *Vault { +// SelectVaultByAddress returns the vault by the address +func SelectVaultByAddress(vaults []*Vault, address string) *Vault { for _, v := range vaults { if v.Address == address { return v @@ -131,8 +103,7 @@ func SelectVaultByBitcoinAddress(vaults []*Vault, address string) *Vault { return nil } -// SelectVaultByPubKey returns the vault if the public key is found -// returns the vault if the public key is found +// SelectVaultByPubKey returns the vault by the public key func SelectVaultByPubKey(vaults []*Vault, pubKey string) *Vault { for _, v := range vaults { if v.PubKey == pubKey { @@ -176,3 +147,41 @@ func SelectVaultByPkScript(vaults []*Vault, pkScript []byte) *Vault { return nil } + +// validateVaults validates the given vaults +func validateVaults(vaults []*Vault) error { + vaultMap := make(map[string]bool) + + for _, v := range vaults { + if len(v.Address) != 0 { + _, err := sdk.AccAddressFromBech32(v.Address) + if err != nil { + return err + } + + if vaultMap[v.Address] { + return ErrInvalidParams + } + + vaultMap[v.Address] = true + } + + if len(v.PubKey) != 0 { + pkBytes, err := hex.DecodeString(v.PubKey) + if err != nil { + return err + } + + _, err = secp256k1.ParsePubKey(pkBytes) + if err != nil { + return err + } + } + + if v.AssetType == AssetType_ASSET_TYPE_UNSPECIFIED { + return ErrInvalidParams + } + } + + return nil +} diff --git a/x/btcbridge/types/policy.go b/x/btcbridge/types/policy.go index 25ebbefd..748ef670 100644 --- a/x/btcbridge/types/policy.go +++ b/x/btcbridge/types/policy.go @@ -54,7 +54,7 @@ func ExtractCommonRecipientAddr(tx *wire.MsgTx, prevTx *wire.MsgTx, vaults []*Va return nil, err } - vault := SelectVaultByBitcoinAddress(vaults, addr.EncodeAddress()) + vault := SelectVaultByAddress(vaults, addr.EncodeAddress()) if vault == nil { recipient = addr nonVaultOutCount++ @@ -104,7 +104,7 @@ func ExtractRunesRecipientAddr(tx *wire.MsgTx, prevTx *wire.MsgTx, vaults []*Vau return nil, err } - vault := SelectVaultByBitcoinAddress(vaults, addr.EncodeAddress()) + vault := SelectVaultByAddress(vaults, addr.EncodeAddress()) if vault == nil { recipient = addr nonVaultOutCount++ diff --git a/x/btcbridge/types/tx.pb.go b/x/btcbridge/types/tx.pb.go index 8eee66ed..e5c3aeb0 100644 --- a/x/btcbridge/types/tx.pb.go +++ b/x/btcbridge/types/tx.pb.go @@ -241,11 +241,9 @@ type MsgSubmitWithdrawTransaction struct { // this is relayer address who submit the bitcoin transaction to the side chain Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Blockhash string `protobuf:"bytes,2,opt,name=blockhash,proto3" json:"blockhash,omitempty"` - // the previous tx bytes in base64 format - PrevTxBytes string `protobuf:"bytes,3,opt,name=prev_tx_bytes,json=prevTxBytes,proto3" json:"prev_tx_bytes,omitempty"` // the tx bytes in base64 format - TxBytes string `protobuf:"bytes,4,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"` - Proof []string `protobuf:"bytes,5,rep,name=proof,proto3" json:"proof,omitempty"` + TxBytes string `protobuf:"bytes,3,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"` + Proof []string `protobuf:"bytes,4,rep,name=proof,proto3" json:"proof,omitempty"` } func (m *MsgSubmitWithdrawTransaction) Reset() { *m = MsgSubmitWithdrawTransaction{} } @@ -295,13 +293,6 @@ func (m *MsgSubmitWithdrawTransaction) GetBlockhash() string { return "" } -func (m *MsgSubmitWithdrawTransaction) GetPrevTxBytes() string { - if m != nil { - return m.PrevTxBytes - } - return "" -} - func (m *MsgSubmitWithdrawTransaction) GetTxBytes() string { if m != nil { return m.TxBytes @@ -891,56 +882,57 @@ func init() { func init() { proto.RegisterFile("side/btcbridge/tx.proto", fileDescriptor_785ca8e1e4227068) } var fileDescriptor_785ca8e1e4227068 = []byte{ - // 782 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x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0a, 0xe7, - 0x5e, 0x60, 0xb9, 0xbc, 0x5b, 0x19, 0xad, 0x67, 0xa8, 0x52, 0x2f, 0xde, 0x7c, 0x5f, 0xcd, 0x19, - 0x11, 0x57, 0x5f, 0x82, 0xc5, 0x91, 0x34, 0x7d, 0x07, 0xbb, 0x3f, 0x4a, 0x50, 0x68, 0x30, 0x5b, - 0x7e, 0x0b, 0x72, 0xca, 0x7c, 0xdc, 0x18, 0x95, 0x4f, 0x9d, 0x69, 0xea, 0xff, 0x8f, 0xa2, 0xf5, - 0x73, 0xca, 0x1f, 0x41, 0xc9, 0x1c, 0x7b, 0xdb, 0x99, 0x52, 0xe3, 0x64, 0x75, 0xef, 0x09, 0xe4, - 0x38, 0xfb, 0x27, 0x58, 0xca, 0x1e, 0x51, 0x3b, 0x99, 0x8a, 0x29, 0x6c, 0x75, 0xff, 0x29, 0xec, - 0xd8, 0x80, 0x0d, 0x7f, 0x8d, 0x0f, 0x94, 0xf5, 0x14, 0xa9, 0x31, 0x96, 0xba, 0xf3, 0x18, 0xd6, - 0x78, 0x9d, 0x53, 0xc6, 0xc6, 0xf6, 0x83, 0xd6, 0x07, 0xe4, 0x09, 0x75, 0xce, 0x9e, 0x18, 0xf2, - 0x39, 0x94, 0x93, 0xd3, 0x42, 0x4b, 0xd1, 0x48, 0xe0, 0xea, 0xe6, 0x64, 0x3c, 0x29, 0x9b, 0x7c, - 0xd7, 0x69, 0xb2, 0x09, 0x3c, 0x55, 0x36, 0xe5, 0x25, 0xca, 0xaf, 0x60, 0x76, 0xe8, 0x19, 0xae, - 0xa6, 0x9c, 0x4b, 0x12, 0xd4, 0xff, 0x1e, 0x20, 0xf4, 0x95, 0xeb, 0x47, 0x37, 0x77, 0x9a, 0x74, - 0x7b, 0xa7, 0x49, 0x3f, 0xef, 0x34, 0xe9, 0xfa, 0x5e, 0xcb, 0xdd, 0xde, 0x6b, 0xb9, 0x6f, 0xf7, - 0x5a, 0xee, 0x75, 0xd5, 0x26, 0xdc, 0xe9, 0x9a, 0xd5, 0x16, 0xed, 0xd4, 0x84, 0x58, 0xf0, 0xb3, - 0xd2, 0xa2, 0xed, 0x60, 0x53, 0xeb, 0x25, 0x7f, 0x95, 0xae, 0x3c, 0xcc, 0xcc, 0x52, 0x40, 0xd8, - 0xfb, 0x15, 0x00, 0x00, 0xff, 0xff, 0x05, 0xf8, 0x3f, 0x1a, 0x49, 0x09, 0x00, 0x00, + // 788 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xc1, 0x4e, 0xdb, 0x4a, + 0x14, 0x86, 0xe3, 0x24, 0xe4, 0x5e, 0x4e, 0x80, 0xab, 0x6b, 0x71, 0x83, 0x31, 0x5c, 0x83, 0x5c, + 0xa0, 0x48, 0xd0, 0x44, 0x02, 0x1e, 0xa0, 0x4a, 0x91, 0xa0, 0x42, 0x91, 0x90, 0x01, 0xb5, 0xaa, + 0x54, 0x45, 0xe3, 0x78, 0xb0, 0xa7, 0x4d, 0x3c, 0xae, 0x67, 0x42, 0x83, 0x54, 0xa9, 0xab, 0xee, + 0xba, 0xe0, 0x31, 0xfa, 0x28, 0x2c, 0x59, 0x76, 0xd5, 0x56, 0xf0, 0x22, 0xd5, 0xd8, 0x8e, 0xe3, + 0x24, 0x76, 0x00, 0x75, 0xe7, 0x39, 0xff, 0x3f, 0xe7, 0x7c, 0x3e, 0x9e, 0x39, 0x32, 0x2c, 0x30, + 0x62, 0xe1, 0x9a, 0xc9, 0x5b, 0xa6, 0x4f, 0x2c, 0x1b, 0xd7, 0x78, 0xaf, 0xea, 0xf9, 0x94, 0x53, + 0x79, 0x4e, 0x08, 0xd5, 0x58, 0x50, 0xe7, 0x6d, 0x6a, 0xd3, 0x40, 0xaa, 0x89, 0xa7, 0xd0, 0xa5, + 0x2e, 0x8d, 0x6c, 0xf7, 0x90, 0x8f, 0x3a, 0x2c, 0x12, 0x97, 0x47, 0x44, 0x93, 0xf0, 0x16, 0x25, + 0x6e, 0xa8, 0xea, 0x1f, 0xe0, 0xbf, 0x06, 0xb3, 0x4f, 0xba, 0x66, 0x87, 0xf0, 0x7a, 0x9b, 0xb6, + 0xde, 0x1f, 0x62, 0x64, 0x61, 0x9f, 0xc9, 0x15, 0x28, 0x31, 0xec, 0x5a, 0xd8, 0x57, 0xa4, 0x55, + 0x69, 0x73, 0xda, 0x88, 0x56, 0xf2, 0x73, 0x98, 0x35, 0x85, 0xaf, 0xe9, 0x84, 0x46, 0x25, 0xbf, + 0x5a, 0xd8, 0x2c, 0xef, 0x2c, 0x55, 0x87, 0x49, 0xab, 0x89, 0x64, 0xc6, 0x8c, 0x99, 0xc8, 0xac, + 0xaf, 0xc0, 0xff, 0xa9, 0x25, 0x0d, 0xcc, 0x3c, 0xea, 0x32, 0xac, 0x7f, 0x93, 0x60, 0x29, 0x76, + 0xec, 0x63, 0x8f, 0x32, 0xc2, 0x4f, 0x7d, 0xe4, 0x32, 0xd4, 0xe2, 0x84, 0xba, 0x99, 0x68, 0xcb, + 0x30, 0x1d, 0x14, 0x72, 0x10, 0x73, 0x94, 0x7c, 0x20, 0x0d, 0x02, 0xb2, 0x0e, 0xb3, 0x9e, 0x8f, + 0x2f, 0x9a, 0xbc, 0xd7, 0x34, 0x2f, 0x39, 0x66, 0x4a, 0x21, 0x70, 0x94, 0x45, 0xf0, 0xb4, 0x57, + 0x17, 0x21, 0x79, 0x11, 0xfe, 0x8e, 0xe5, 0x62, 0x20, 0xff, 0xc5, 0x23, 0x69, 0x1e, 0xa6, 0x3c, + 0x9f, 0xd2, 0x73, 0x65, 0x6a, 0xb5, 0xb0, 0x39, 0x6d, 0x84, 0x0b, 0x7d, 0x1d, 0x9e, 0x4c, 0x20, + 0x8d, 0xdf, 0xe8, 0x8b, 0x04, 0xcb, 0xb1, 0xef, 0x15, 0xe1, 0x8e, 0xe5, 0xa3, 0x8f, 0x7f, 0xfe, + 0x4a, 0x49, 0xdc, 0x42, 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 0xf5, 0x64, 0xda, 0xe4, 0xbd, 0x4e, 0x4b, 0x9b, 0xd0, 0x53, 0xd3, 0xa6, 0xdc, 0x44, 0xf9, + 0x35, 0xcc, 0x0c, 0x5d, 0xc3, 0x95, 0x94, 0x7d, 0x49, 0x83, 0xfa, 0xf4, 0x1e, 0x43, 0x3f, 0x73, + 0xfd, 0xf0, 0xfa, 0x56, 0x93, 0x6e, 0x6e, 0x35, 0xe9, 0xd7, 0xad, 0x26, 0x5d, 0xdd, 0x69, 0xb9, + 0x9b, 0x3b, 0x2d, 0xf7, 0xfd, 0x4e, 0xcb, 0xbd, 0xa9, 0xda, 0x84, 0x3b, 0x5d, 0xb3, 0xda, 0xa2, + 0x9d, 0x9a, 0x48, 0x16, 0xfc, 0x88, 0xb4, 0x68, 0x3b, 0x58, 0xd4, 0x7a, 0xc9, 0xdf, 0xa0, 0x4b, + 0x0f, 0x33, 0xb3, 0x14, 0x18, 0x76, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x02, 0x59, 0x27, + 0x25, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1473,7 +1465,7 @@ func (m *MsgSubmitWithdrawTransaction) MarshalToSizedBuffer(dAtA []byte) (int, e copy(dAtA[i:], m.Proof[iNdEx]) i = encodeVarintTx(dAtA, i, uint64(len(m.Proof[iNdEx]))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } } if len(m.TxBytes) > 0 { @@ -1481,13 +1473,6 @@ func (m *MsgSubmitWithdrawTransaction) MarshalToSizedBuffer(dAtA []byte) (int, e copy(dAtA[i:], m.TxBytes) i = encodeVarintTx(dAtA, i, uint64(len(m.TxBytes))) i-- - dAtA[i] = 0x22 - } - if len(m.PrevTxBytes) > 0 { - i -= len(m.PrevTxBytes) - copy(dAtA[i:], m.PrevTxBytes) - i = encodeVarintTx(dAtA, i, uint64(len(m.PrevTxBytes))) - i-- dAtA[i] = 0x1a } if len(m.Blockhash) > 0 { @@ -1973,10 +1958,6 @@ func (m *MsgSubmitWithdrawTransaction) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.PrevTxBytes) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } l = len(m.TxBytes) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2679,38 +2660,6 @@ func (m *MsgSubmitWithdrawTransaction) Unmarshal(dAtA []byte) error { m.Blockhash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevTxBytes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrevTxBytes = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TxBytes", wireType) } @@ -2742,7 +2691,7 @@ func (m *MsgSubmitWithdrawTransaction) Unmarshal(dAtA []byte) error { } m.TxBytes = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) }