diff --git a/integration_tests/validator_out.go b/integration_tests/validator_out.go index d3146ad63..ff2ebab41 100644 --- a/integration_tests/validator_out.go +++ b/integration_tests/validator_out.go @@ -106,35 +106,6 @@ func (s *IntegrationTestSuite) TestValidatorOut() { return true }, 5*time.Minute, 10*time.Second, "unable to send to ethereum") - // Create Transaction batch - s.Require().Eventuallyf(func() bool { - batchTx := types.NewMsgRequestBatchTx(gravityDenom, s.chain.validators[2].keyInfo.GetAddress()) - - keyRing, err := s.chain.validators[2].keyring() - s.Require().NoError(err) - - clientCtx, err := s.chain.clientContext("tcp://localhost:26657", &keyRing, "val", s.chain.validators[2].keyInfo.GetAddress()) - s.Require().NoError(err) - - response, err := s.chain.sendMsgs(*clientCtx, batchTx) - s.T().Logf("batch response: %s", response) - if err != nil { - s.T().Logf("error: %s", err) - return false - } - - if response.Code != 0 { - if response.Code != 32 { - s.T().Log(response) - } - return false - } - - s.Require().NoError(err, "error querying delegator bonded validators") - - return true - }, 5*time.Minute, 1*time.Second, "can't create TX batch successfully") - // Confirm batchtx signatures s.Require().Eventuallyf(func() bool { keyRing, err := s.chain.validators[3].keyring() diff --git a/module/proto/gravity/v1/msgs.proto b/module/proto/gravity/v1/msgs.proto index 50626c04b..dbab24be9 100644 --- a/module/proto/gravity/v1/msgs.proto +++ b/module/proto/gravity/v1/msgs.proto @@ -19,9 +19,6 @@ service Msg { returns (MsgCancelSendToEthereumResponse) { // option (google.api.http).post = "/gravity/v1/send_to_ethereum/cancel"; } - rpc RequestBatchTx(MsgRequestBatchTx) returns (MsgRequestBatchTxResponse) { - // option (google.api.http).post = "/gravity/v1/batchtx/request"; - } rpc SubmitEthereumTxConfirmation(MsgSubmitEthereumTxConfirmation) returns (MsgSubmitEthereumTxConfirmationResponse) { // option (google.api.http).post = "/gravity/v1/ethereum_signature"; @@ -53,7 +50,7 @@ message MsgSendToEthereum { // will be included in the batch tx. message MsgSendToEthereumResponse { uint64 id = 1; } -// MsgCancelSendToEthereum allows the sender to cancel its own outgoing +// MsgCancelSendToEthereum allows the sender to cancel its own unbatched // SendToEthereum tx and recieve a refund of the tokens and bridge fees. This tx // will only succeed if the SendToEthereum tx hasn't been batched to be // processed and relayed to Ethereum. @@ -64,15 +61,6 @@ message MsgCancelSendToEthereum { message MsgCancelSendToEthereumResponse {} -// MsgRequestBatchTx requests a batch of transactions with a given coin -// denomination to send across the bridge to Ethereum. -message MsgRequestBatchTx { - string denom = 1; - string signer = 2; -} - -message MsgRequestBatchTxResponse {} - // MsgSubmitEthereumTxConfirmation submits an ethereum signature for a given // validator message MsgSubmitEthereumTxConfirmation { diff --git a/module/x/gravity/abci.go b/module/x/gravity/abci.go index 4bb1e04b5..9183273cd 100644 --- a/module/x/gravity/abci.go +++ b/module/x/gravity/abci.go @@ -48,7 +48,7 @@ func createBatchTxs(ctx sdk.Context, k keeper.Keeper) { for _, c := range contracts { // NOTE: this doesn't emit events which would be helpful for client processes - k.BuildBatchTx(ctx, common.HexToAddress(c), 100) + k.CreateBatchTx(ctx, common.HexToAddress(c), 100) } } } @@ -155,11 +155,11 @@ func eventVoteRecordTally(ctx sdk.Context, k keeper.Keeper) { // order to keep this information current regardless of the level of bridge activity. // // We determine if we should update the latest heights based on the following criteria: -// 1. A consensus of validators agrees that the proposed height is equal to or less than their -// last observed height, in order to reconcile the many different heights that will be submitted. -// The highest height that meets this criteria will be the proposed height. -// 2. The proposed consensus heights from this process are greater than the values stored from the last time -// we observed an Ethereum event from the bridge +// 1. A consensus of validators agrees that the proposed height is equal to or less than their +// last observed height, in order to reconcile the many different heights that will be submitted. +// The highest height that meets this criteria will be the proposed height. +// 2. The proposed consensus heights from this process are greater than the values stored from the last time +// we observed an Ethereum event from the bridge func updateObservedEthereumHeight(ctx sdk.Context, k keeper.Keeper) { // wait some minutes before checking the height votes if ctx.BlockHeight()%50 != 0 { @@ -228,12 +228,14 @@ func updateObservedEthereumHeight(ctx sdk.Context, k keeper.Keeper) { // cleanupTimedOutBatchTxs deletes batches that have passed their expiration on Ethereum // keep in mind several things when modifying this function // A) unlike nonces timeouts are not monotonically increasing, meaning batch 5 can have a later timeout than batch 6 -// this means that we MUST only cleanup a single batch at a time +// this means that we MUST only cleanup a single batch at a time +// // B) it is possible for ethereumHeight to be zero if no events have ever occurred, make sure your code accounts for this // C) When we compute the timeout we do our best to estimate the Ethereum block height at that very second. But what we work with -// here is the Ethereum block height at the time of the last Deposit or Withdraw to be observed. It's very important we do not -// project, if we do a slowdown on ethereum could cause a double spend. Instead timeouts will *only* occur after the timeout period -// AND any deposit or withdraw has occurred to update the Ethereum block height. +// +// here is the Ethereum block height at the time of the last Deposit or Withdraw to be observed. It's very important we do not +// project, if we do a slowdown on ethereum could cause a double spend. Instead timeouts will *only* occur after the timeout period +// AND any deposit or withdraw has occurred to update the Ethereum block height. func cleanupTimedOutBatchTxs(ctx sdk.Context, k keeper.Keeper) { ethereumHeight := k.GetLastObservedEthereumBlockHeight(ctx).EthereumHeight k.IterateOutgoingTxsByType(ctx, types.BatchTxPrefixByte, func(key []byte, otx types.OutgoingTx) bool { @@ -250,12 +252,15 @@ func cleanupTimedOutBatchTxs(ctx sdk.Context, k keeper.Keeper) { // cleanupTimedOutContractCallTxs deletes logic calls that have passed their expiration on Ethereum // keep in mind several things when modifying this function // A) unlike nonces timeouts are not monotonically increasing, meaning call 5 can have a later timeout than batch 6 -// this means that we MUST only cleanup a single call at a time +// +// this means that we MUST only cleanup a single call at a time +// // B) it is possible for ethereumHeight to be zero if no events have ever occurred, make sure your code accounts for this // C) When we compute the timeout we do our best to estimate the Ethereum block height at that very second. But what we work with -// here is the Ethereum block height at the time of the last Deposit or Withdraw to be observed. It's very important we do not -// project, if we do a slowdown on ethereum could cause a double spend. Instead timeouts will *only* occur after the timeout period -// AND any deposit or withdraw has occurred to update the Ethereum block height. +// +// here is the Ethereum block height at the time of the last Deposit or Withdraw to be observed. It's very important we do not +// project, if we do a slowdown on ethereum could cause a double spend. Instead timeouts will *only* occur after the timeout period +// AND any deposit or withdraw has occurred to update the Ethereum block height. func cleanupTimedOutContractCallTxs(ctx sdk.Context, k keeper.Keeper) { ethereumHeight := k.GetLastObservedEthereumBlockHeight(ctx).EthereumHeight k.IterateOutgoingTxsByType(ctx, types.ContractCallTxPrefixByte, func(_ []byte, otx types.OutgoingTx) bool { diff --git a/module/x/gravity/abci_test.go b/module/x/gravity/abci_test.go index 8dc7fec86..51a35122a 100644 --- a/module/x/gravity/abci_test.go +++ b/module/x/gravity/abci_test.go @@ -234,7 +234,7 @@ func TestSignerSetTxSetting(t *testing.T) { require.EqualValues(t, 1, len(gk.GetSignerSetTxs(ctx))) } -/// Test batch timeout +// Test batch timeout func TestBatchTxTimeout(t *testing.T) { input, ctx := keeper.SetupFiveValChain(t) gravityKeeper := input.GravityKeeper @@ -263,12 +263,12 @@ func TestBatchTxTimeout(t *testing.T) { ctx = ctx.WithBlockTime(now).WithBlockHeight(250) // check that we can make a batch without first setting an ethereum block height - b1 := gravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + b1 := gravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) require.Equal(t, b1.Timeout, uint64(0)) gravityKeeper.SetLastObservedEthereumBlockHeight(ctx, 500) - b2 := gravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + b2 := gravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) // this is exactly block 500 plus twelve hours require.Equal(t, b2.Timeout, uint64(504)) @@ -281,7 +281,7 @@ func TestBatchTxTimeout(t *testing.T) { // when, way into the future ctx = ctx.WithBlockTime(now).WithBlockHeight(9) - b3 := gravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + b3 := gravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) gravity.BeginBlocker(ctx, gravityKeeper) diff --git a/module/x/gravity/client/cli/tx.go b/module/x/gravity/client/cli/tx.go index 798147739..5d5c5f452 100644 --- a/module/x/gravity/client/cli/tx.go +++ b/module/x/gravity/client/cli/tx.go @@ -30,7 +30,6 @@ func GetTxCmd(storeKey string) *cobra.Command { gravityTxCmd.AddCommand( CmdSendToEthereum(), CmdCancelSendToEthereum(), - CmdRequestBatchTx(), CmdSetDelegateKeys(), ) @@ -116,35 +115,6 @@ func CmdCancelSendToEthereum() *cobra.Command { return cmd } -func CmdRequestBatchTx() *cobra.Command { - cmd := &cobra.Command{ - Use: "request-batch-tx [denom] [signer]", - Args: cobra.ExactArgs(2), - Short: "Request batch transaction for denom by signer", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - denom := args[0] - signer, err := sdk.AccAddressFromHex(args[1]) - if err != nil { - return err - } - - msg := types.NewMsgRequestBatchTx(denom, signer) - if err = msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd -} - func CmdSetDelegateKeys() *cobra.Command { cmd := &cobra.Command{ Use: "set-delegate-keys [validator-address] [orchestrator-address] [ethereum-address] [ethereum-signature]", diff --git a/module/x/gravity/handler.go b/module/x/gravity/handler.go index fc1420bf1..ad6b65af3 100644 --- a/module/x/gravity/handler.go +++ b/module/x/gravity/handler.go @@ -25,10 +25,6 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := msgServer.CancelSendToEthereum(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgRequestBatchTx: - res, err := msgServer.RequestBatchTx(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgSubmitEthereumTxConfirmation: res, err := msgServer.SubmitEthereumTxConfirmation(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) diff --git a/module/x/gravity/keeper/batch.go b/module/x/gravity/keeper/batch.go index 3b6a5db75..f31ab0e22 100644 --- a/module/x/gravity/keeper/batch.go +++ b/module/x/gravity/keeper/batch.go @@ -14,14 +14,14 @@ import ( // TODO: should we make this a parameter or a a call arg? const BatchTxSize = 100 -// BuildBatchTx starts the following process chain: -// - find bridged denominator for given voucher type -// - determine if a an unexecuted batch is already waiting for this token type, if so confirm the new batch would -// have a higher total fees. If not exit withtout creating a batch -// - select available transactions from the outgoing transaction pool sorted by fee desc -// - persist an outgoing batch object with an incrementing ID = nonce -// - emit an event -func (k Keeper) BuildBatchTx(ctx sdk.Context, contractAddress common.Address, maxElements int) *types.BatchTx { +// CreateBatchTx starts the following process chain: +// - find bridged denominator for given voucher type +// - determine if a an unexecuted batch is already waiting for this token type, if so confirm the new batch would +// have a higher total fees. If not exit withtout creating a batch +// - select available transactions from the unbatched SendToEthereums sorted by fee desc +// - persist an OutgoingTx (BatchTx) object with an incrementing ID = nonce +// - emit an event +func (k Keeper) CreateBatchTx(ctx sdk.Context, contractAddress common.Address, maxElements int) *types.BatchTx { // if there is a more profitable batch for this token type do not create a new batch if lastBatch := k.getLastOutgoingBatchByTokenType(ctx, contractAddress); lastBatch != nil { if lastBatch.GetFees().GTE(k.getBatchFeesByTokenType(ctx, contractAddress, maxElements)) { diff --git a/module/x/gravity/keeper/batch_test.go b/module/x/gravity/keeper/batch_test.go index 7767c6a92..c5d6e512d 100644 --- a/module/x/gravity/keeper/batch_test.go +++ b/module/x/gravity/keeper/batch_test.go @@ -41,7 +41,7 @@ func TestBatches(t *testing.T) { ctx = ctx.WithBlockTime(now) // tx batch size is 2, so that some of them stay behind - firstBatch := input.GravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + firstBatch := input.GravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) // then batch is persisted gotFirstBatch := input.GravityKeeper.GetOutgoingTx(ctx, firstBatch.GetStoreIndex()) @@ -81,7 +81,7 @@ func TestBatches(t *testing.T) { // create the more profitable batch ctx = ctx.WithBlockTime(now) // tx batch size is 2, so that some of them stay behind - secondBatch := input.GravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + secondBatch := input.GravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) // check that the more profitable batch has the right txs in it expSecondBatch := &types.BatchTx{ @@ -160,7 +160,7 @@ func TestBatchesFullCoins(t *testing.T) { ctx = ctx.WithBlockTime(now) // tx batch size is 2, so that some of them stay behind - firstBatch := input.GravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + firstBatch := input.GravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) // then batch is persisted gotFirstBatch := input.GravityKeeper.GetOutgoingTx(ctx, firstBatch.GetStoreIndex()) @@ -228,7 +228,7 @@ func TestBatchesFullCoins(t *testing.T) { // create the more profitable batch ctx = ctx.WithBlockTime(now) // tx batch size is 2, so that some of them stay behind - secondBatch := input.GravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + secondBatch := input.GravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) // check that the more profitable batch has the right txs in it expSecondBatch := &types.BatchTx{ @@ -340,7 +340,7 @@ func TestPoolTxRefund(t *testing.T) { ctx = ctx.WithBlockTime(now) // tx batch size is 2, so that some of them stay behind - input.GravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + input.GravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) // try to refund a tx that's in a batch err := input.GravityKeeper.cancelSendToEthereum(ctx, 2, mySender.String()) @@ -376,7 +376,7 @@ func TestEmptyBatch(t *testing.T) { // no transactions should be included in this batch ctx = ctx.WithBlockTime(now) - batchTx := input.GravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + batchTx := input.GravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) require.Nil(t, batchTx) } diff --git a/module/x/gravity/keeper/keeper_test.go b/module/x/gravity/keeper/keeper_test.go index 77fceebb3..b0453b29e 100644 --- a/module/x/gravity/keeper/keeper_test.go +++ b/module/x/gravity/keeper/keeper_test.go @@ -583,7 +583,7 @@ func TestKeeper_Migration(t *testing.T) { ctx = ctx.WithBlockTime(now) // tx batch size is 2, so that some of them stay behind - firstBatch := input.GravityKeeper.BuildBatchTx(ctx, myTokenContractAddr, 2) + firstBatch := input.GravityKeeper.CreateBatchTx(ctx, myTokenContractAddr, 2) // then batch is persisted gotFirstBatch := input.GravityKeeper.GetOutgoingTx(ctx, firstBatch.GetStoreIndex()) diff --git a/module/x/gravity/keeper/msg_server.go b/module/x/gravity/keeper/msg_server.go index 4bb44267e..6caaa649b 100644 --- a/module/x/gravity/keeper/msg_server.go +++ b/module/x/gravity/keeper/msg_server.go @@ -239,35 +239,6 @@ func (k msgServer) SendToEthereum(c context.Context, msg *types.MsgSendToEthereu return &types.MsgSendToEthereumResponse{Id: txID}, nil } -// RequestBatchTx handles MsgRequestBatchTx -func (k msgServer) RequestBatchTx(c context.Context, msg *types.MsgRequestBatchTx) (*types.MsgRequestBatchTxResponse, error) { - // TODO: limit this to only orchestrators and validators? - ctx := sdk.UnwrapSDKContext(c) - - // Check if the denom is a gravity coin, if not, check if there is a deployed ERC20 representing it. - // If not, error out. Normalizes the format of the input denom if it's a gravity denom. - _, tokenContract, err := k.DenomToERC20Lookup(ctx, types.NormalizeDenom(msg.Denom)) - if err != nil { - return nil, err - } - - batchID := k.BuildBatchTx(ctx, tokenContract, BatchTxSize) - if batchID == nil { - return nil, fmt.Errorf("no suitable batch to create") - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, msg.Type()), - sdk.NewAttribute(types.AttributeKeyContract, tokenContract.Hex()), - sdk.NewAttribute(types.AttributeKeyBatchNonce, fmt.Sprint(batchID.BatchNonce)), - ), - ) - - return &types.MsgRequestBatchTxResponse{}, nil -} - func (k msgServer) CancelSendToEthereum(c context.Context, msg *types.MsgCancelSendToEthereum) (*types.MsgCancelSendToEthereumResponse, error) { ctx := sdk.UnwrapSDKContext(c) diff --git a/module/x/gravity/keeper/msg_server_test.go b/module/x/gravity/keeper/msg_server_test.go index aca1f88d2..8844e523e 100644 --- a/module/x/gravity/keeper/msg_server_test.go +++ b/module/x/gravity/keeper/msg_server_test.go @@ -213,118 +213,6 @@ func TestMsgServer_CancelSendToEthereum(t *testing.T) { require.NoError(t, err) } -func TestMsgServer_RequestBatchTx(t *testing.T) { - ethPrivKey, err := ethCrypto.GenerateKey() - require.NoError(t, err) - - var ( - env = CreateTestEnv(t) - ctx = env.Context - gk = env.GravityKeeper - - orcAddr1, _ = sdk.AccAddressFromBech32("cosmos1dg55rtevlfxh46w88yjpdd08sqhh5cc3xhkcej") - valAddr1 = sdk.ValAddress(orcAddr1) - ethAddr1 = crypto.PubkeyToAddress(ethPrivKey.PublicKey) - - orcAddr2, _ = sdk.AccAddressFromBech32("cosmos164knshrzuuurf05qxf3q5ewpfnwzl4gj4m4dfy") - valAddr2 = sdk.ValAddress(orcAddr2) - - orcAddr3, _ = sdk.AccAddressFromBech32("cosmos193fw83ynn76328pty4yl7473vg9x86alq2cft7") - valAddr3 = sdk.ValAddress(orcAddr3) - - testDenom = "stake" - testContract = common.HexToAddress("0x429881672B9AE42b8EbA0E26cD9C73711b891Ca5") - - balance = sdk.Coin{ - Denom: testDenom, - Amount: sdk.NewInt(10000), - } - amount = sdk.Coin{ - Denom: testDenom, - Amount: sdk.NewInt(1000), - } - fee = sdk.Coin{ - Denom: testDenom, - Amount: sdk.NewInt(10), - } - ) - - { // setup for getSignerValidator - gk.StakingKeeper = NewStakingKeeperMock(valAddr1, valAddr2, valAddr3) - gk.SetOrchestratorValidatorAddress(ctx, valAddr1, orcAddr1) - } - - { // add balance to bank - err = env.AddBalanceToBank(ctx, orcAddr1, sdk.Coins{balance}) - require.NoError(t, err) - } - - // create denom in keeper - gk.setCosmosOriginatedDenomToERC20(ctx, testDenom, testContract) - - // setup for GetValidatorEthereumAddress - gk.setValidatorEthereumAddress(ctx, valAddr1, ethAddr1) - - msgServer := NewMsgServerImpl(gk) - - msg := &types.MsgSendToEthereum{ - Sender: orcAddr1.String(), - EthereumRecipient: ethAddr1.String(), - Amount: amount, - BridgeFee: fee, - } - - _, err = msgServer.SendToEthereum(sdk.WrapSDKContext(ctx), msg) - require.NoError(t, err) - - requestMsg := &types.MsgRequestBatchTx{ - Signer: orcAddr1.String(), - Denom: testDenom, - } - - _, err = msgServer.RequestBatchTx(sdk.WrapSDKContext(ctx), requestMsg) - require.NoError(t, err) -} - -func TestMsgServer_RequestEmptyBatchTx(t *testing.T) { - var ( - env = CreateTestEnv(t) - ctx = env.Context - gk = env.GravityKeeper - - orcAddr1, _ = sdk.AccAddressFromBech32("cosmos1dg55rtevlfxh46w88yjpdd08sqhh5cc3xhkcej") - valAddr1 = sdk.ValAddress(orcAddr1) - - orcAddr2, _ = sdk.AccAddressFromBech32("cosmos164knshrzuuurf05qxf3q5ewpfnwzl4gj4m4dfy") - valAddr2 = sdk.ValAddress(orcAddr2) - - orcAddr3, _ = sdk.AccAddressFromBech32("cosmos193fw83ynn76328pty4yl7473vg9x86alq2cft7") - valAddr3 = sdk.ValAddress(orcAddr3) - - testDenom = "stake" - testContract = common.HexToAddress("0x429881672B9AE42b8EbA0E26cD9C73711b891Ca5") - ) - - { // setup for getSignerValidator - gk.StakingKeeper = NewStakingKeeperMock(valAddr1, valAddr2, valAddr3) - gk.SetOrchestratorValidatorAddress(ctx, valAddr1, orcAddr1) - } - - // create denom in keeper - gk.setCosmosOriginatedDenomToERC20(ctx, testDenom, testContract) - - msgServer := NewMsgServerImpl(gk) - - msg := &types.MsgRequestBatchTx{ - Signer: orcAddr1.String(), - Denom: testDenom, - } - - _, err := msgServer.RequestBatchTx(sdk.WrapSDKContext(ctx), msg) - - require.Error(t, err) -} - func TestMsgServer_SubmitEthereumEvent(t *testing.T) { ethPrivKey, err := ethCrypto.GenerateKey() require.NoError(t, err) diff --git a/module/x/gravity/keeper/pool.go b/module/x/gravity/keeper/pool.go index 22b2082d5..efc9c9710 100644 --- a/module/x/gravity/keeper/pool.go +++ b/module/x/gravity/keeper/pool.go @@ -50,11 +50,11 @@ func (k Keeper) createSendToEthereum(ctx sdk.Context, sender sdk.AccAddress, cou // get next tx id from keeper nextID := k.incrementLastSendToEthereumIDKey(ctx) - // construct outgoing tx, as part of this process we represent + // construct the unbatched tx, as part of this process we represent // the token as an ERC20 token since it is preparing to go to ETH // rather than the denom that is the input to this function. - // set the outgoing tx in the pool index + // set the unbatched transaction in the pool index k.setUnbatchedSendToEthereum(ctx, &types.SendToEthereum{ Id: nextID, Sender: sender.String(), diff --git a/module/x/gravity/types/codec.go b/module/x/gravity/types/codec.go index 3f7e3d32f..52c96cee0 100644 --- a/module/x/gravity/types/codec.go +++ b/module/x/gravity/types/codec.go @@ -43,7 +43,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSendToEthereum{}, &MsgCancelSendToEthereum{}, - &MsgRequestBatchTx{}, &MsgSubmitEthereumEvent{}, &MsgSubmitEthereumTxConfirmation{}, &MsgDelegateKeys{}, diff --git a/module/x/gravity/types/msgs.go b/module/x/gravity/types/msgs.go index 15b1b8b6c..60e7657ac 100644 --- a/module/x/gravity/types/msgs.go +++ b/module/x/gravity/types/msgs.go @@ -13,7 +13,6 @@ var ( _ sdk.Msg = &MsgDelegateKeys{} _ sdk.Msg = &MsgSendToEthereum{} _ sdk.Msg = &MsgCancelSendToEthereum{} - _ sdk.Msg = &MsgRequestBatchTx{} _ sdk.Msg = &MsgSubmitEthereumEvent{} _ sdk.Msg = &MsgSubmitEthereumTxConfirmation{} _ sdk.Msg = &MsgEthereumHeightVote{} @@ -209,46 +208,6 @@ func (msg MsgSendToEthereum) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{acc} } -// NewMsgRequestBatchTx returns a new msgRequestBatch -func NewMsgRequestBatchTx(denom string, signer sdk.AccAddress) *MsgRequestBatchTx { - return &MsgRequestBatchTx{ - Denom: denom, - Signer: signer.String(), - } -} - -// Route should return the name of the module -func (msg MsgRequestBatchTx) Route() string { return RouterKey } - -// Type should return the action -func (msg MsgRequestBatchTx) Type() string { return "request_batch" } - -// ValidateBasic performs stateless checks -func (msg MsgRequestBatchTx) ValidateBasic() error { - if err := sdk.ValidateDenom(msg.Denom); err != nil { - return sdkerrors.Wrap(err, "denom is invalid") - } - if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer) - } - return nil -} - -// GetSignBytes encodes the message for signing -func (msg MsgRequestBatchTx) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) -} - -// GetSigners defines whose signature is required -func (msg MsgRequestBatchTx) GetSigners() []sdk.AccAddress { - acc, err := sdk.AccAddressFromBech32(msg.Signer) - if err != nil { - panic(err) - } - - return []sdk.AccAddress{acc} -} - // NewMsgCancelSendToEthereum returns a new MsgCancelSendToEthereum func NewMsgCancelSendToEthereum(id uint64, orchestrator sdk.AccAddress) *MsgCancelSendToEthereum { return &MsgCancelSendToEthereum{ diff --git a/module/x/gravity/types/msgs.pb.go b/module/x/gravity/types/msgs.pb.go index 19481f4c4..429204215 100644 --- a/module/x/gravity/types/msgs.pb.go +++ b/module/x/gravity/types/msgs.pb.go @@ -151,7 +151,7 @@ func (m *MsgSendToEthereumResponse) GetId() uint64 { return 0 } -// MsgCancelSendToEthereum allows the sender to cancel its own outgoing +// MsgCancelSendToEthereum allows the sender to cancel its own unbatched // SendToEthereum tx and recieve a refund of the tokens and bridge fees. This tx // will only succeed if the SendToEthereum tx hasn't been batched to be // processed and relayed to Ethereum. @@ -243,96 +243,6 @@ func (m *MsgCancelSendToEthereumResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCancelSendToEthereumResponse proto.InternalMessageInfo -// MsgRequestBatchTx requests a batch of transactions with a given coin -// denomination to send across the bridge to Ethereum. -type MsgRequestBatchTx struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgRequestBatchTx) Reset() { *m = MsgRequestBatchTx{} } -func (m *MsgRequestBatchTx) String() string { return proto.CompactTextString(m) } -func (*MsgRequestBatchTx) ProtoMessage() {} -func (*MsgRequestBatchTx) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{4} -} -func (m *MsgRequestBatchTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRequestBatchTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRequestBatchTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgRequestBatchTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRequestBatchTx.Merge(m, src) -} -func (m *MsgRequestBatchTx) XXX_Size() int { - return m.Size() -} -func (m *MsgRequestBatchTx) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRequestBatchTx.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRequestBatchTx proto.InternalMessageInfo - -func (m *MsgRequestBatchTx) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *MsgRequestBatchTx) GetSigner() string { - if m != nil { - return m.Signer - } - return "" -} - -type MsgRequestBatchTxResponse struct { -} - -func (m *MsgRequestBatchTxResponse) Reset() { *m = MsgRequestBatchTxResponse{} } -func (m *MsgRequestBatchTxResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRequestBatchTxResponse) ProtoMessage() {} -func (*MsgRequestBatchTxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{5} -} -func (m *MsgRequestBatchTxResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRequestBatchTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRequestBatchTxResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgRequestBatchTxResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRequestBatchTxResponse.Merge(m, src) -} -func (m *MsgRequestBatchTxResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRequestBatchTxResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRequestBatchTxResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRequestBatchTxResponse proto.InternalMessageInfo - // MsgSubmitEthereumTxConfirmation submits an ethereum signature for a given // validator type MsgSubmitEthereumTxConfirmation struct { @@ -345,7 +255,7 @@ func (m *MsgSubmitEthereumTxConfirmation) Reset() { *m = MsgSubmitEthere func (m *MsgSubmitEthereumTxConfirmation) String() string { return proto.CompactTextString(m) } func (*MsgSubmitEthereumTxConfirmation) ProtoMessage() {} func (*MsgSubmitEthereumTxConfirmation) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{6} + return fileDescriptor_2f8523f2f6feb451, []int{4} } func (m *MsgSubmitEthereumTxConfirmation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -387,7 +297,7 @@ func (m *ContractCallTxConfirmation) Reset() { *m = ContractCallTxConfir func (m *ContractCallTxConfirmation) String() string { return proto.CompactTextString(m) } func (*ContractCallTxConfirmation) ProtoMessage() {} func (*ContractCallTxConfirmation) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{7} + return fileDescriptor_2f8523f2f6feb451, []int{5} } func (m *ContractCallTxConfirmation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -456,7 +366,7 @@ func (m *BatchTxConfirmation) Reset() { *m = BatchTxConfirmation{} } func (m *BatchTxConfirmation) String() string { return proto.CompactTextString(m) } func (*BatchTxConfirmation) ProtoMessage() {} func (*BatchTxConfirmation) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{8} + return fileDescriptor_2f8523f2f6feb451, []int{6} } func (m *BatchTxConfirmation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -525,7 +435,7 @@ func (m *SignerSetTxConfirmation) Reset() { *m = SignerSetTxConfirmation func (m *SignerSetTxConfirmation) String() string { return proto.CompactTextString(m) } func (*SignerSetTxConfirmation) ProtoMessage() {} func (*SignerSetTxConfirmation) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{9} + return fileDescriptor_2f8523f2f6feb451, []int{7} } func (m *SignerSetTxConfirmation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -584,7 +494,7 @@ func (m *MsgSubmitEthereumTxConfirmationResponse) Reset() { func (m *MsgSubmitEthereumTxConfirmationResponse) String() string { return proto.CompactTextString(m) } func (*MsgSubmitEthereumTxConfirmationResponse) ProtoMessage() {} func (*MsgSubmitEthereumTxConfirmationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{10} + return fileDescriptor_2f8523f2f6feb451, []int{8} } func (m *MsgSubmitEthereumTxConfirmationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -623,7 +533,7 @@ func (m *MsgSubmitEthereumEvent) Reset() { *m = MsgSubmitEthereumEvent{} func (m *MsgSubmitEthereumEvent) String() string { return proto.CompactTextString(m) } func (*MsgSubmitEthereumEvent) ProtoMessage() {} func (*MsgSubmitEthereumEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{11} + return fileDescriptor_2f8523f2f6feb451, []int{9} } func (m *MsgSubmitEthereumEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -659,7 +569,7 @@ func (m *MsgSubmitEthereumEventResponse) Reset() { *m = MsgSubmitEthereu func (m *MsgSubmitEthereumEventResponse) String() string { return proto.CompactTextString(m) } func (*MsgSubmitEthereumEventResponse) ProtoMessage() {} func (*MsgSubmitEthereumEventResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{12} + return fileDescriptor_2f8523f2f6feb451, []int{10} } func (m *MsgSubmitEthereumEventResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -702,7 +612,7 @@ func (m *MsgDelegateKeys) Reset() { *m = MsgDelegateKeys{} } func (m *MsgDelegateKeys) String() string { return proto.CompactTextString(m) } func (*MsgDelegateKeys) ProtoMessage() {} func (*MsgDelegateKeys) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{13} + return fileDescriptor_2f8523f2f6feb451, []int{11} } func (m *MsgDelegateKeys) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -766,7 +676,7 @@ func (m *MsgDelegateKeysResponse) Reset() { *m = MsgDelegateKeysResponse func (m *MsgDelegateKeysResponse) String() string { return proto.CompactTextString(m) } func (*MsgDelegateKeysResponse) ProtoMessage() {} func (*MsgDelegateKeysResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{14} + return fileDescriptor_2f8523f2f6feb451, []int{12} } func (m *MsgDelegateKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -807,7 +717,7 @@ func (m *DelegateKeysSignMsg) Reset() { *m = DelegateKeysSignMsg{} } func (m *DelegateKeysSignMsg) String() string { return proto.CompactTextString(m) } func (*DelegateKeysSignMsg) ProtoMessage() {} func (*DelegateKeysSignMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{15} + return fileDescriptor_2f8523f2f6feb451, []int{13} } func (m *DelegateKeysSignMsg) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -861,7 +771,7 @@ func (m *MsgEthereumHeightVote) Reset() { *m = MsgEthereumHeightVote{} } func (m *MsgEthereumHeightVote) String() string { return proto.CompactTextString(m) } func (*MsgEthereumHeightVote) ProtoMessage() {} func (*MsgEthereumHeightVote) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{16} + return fileDescriptor_2f8523f2f6feb451, []int{14} } func (m *MsgEthereumHeightVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -911,7 +821,7 @@ func (m *MsgEthereumHeightVoteResponse) Reset() { *m = MsgEthereumHeight func (m *MsgEthereumHeightVoteResponse) String() string { return proto.CompactTextString(m) } func (*MsgEthereumHeightVoteResponse) ProtoMessage() {} func (*MsgEthereumHeightVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{17} + return fileDescriptor_2f8523f2f6feb451, []int{15} } func (m *MsgEthereumHeightVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -956,7 +866,7 @@ func (m *SendToCosmosEvent) Reset() { *m = SendToCosmosEvent{} } func (m *SendToCosmosEvent) String() string { return proto.CompactTextString(m) } func (*SendToCosmosEvent) ProtoMessage() {} func (*SendToCosmosEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{18} + return fileDescriptor_2f8523f2f6feb451, []int{16} } func (m *SendToCosmosEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1033,7 +943,7 @@ func (m *BatchExecutedEvent) Reset() { *m = BatchExecutedEvent{} } func (m *BatchExecutedEvent) String() string { return proto.CompactTextString(m) } func (*BatchExecutedEvent) ProtoMessage() {} func (*BatchExecutedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{19} + return fileDescriptor_2f8523f2f6feb451, []int{17} } func (m *BatchExecutedEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1103,7 +1013,7 @@ func (m *ContractCallExecutedEvent) Reset() { *m = ContractCallExecutedE func (m *ContractCallExecutedEvent) String() string { return proto.CompactTextString(m) } func (*ContractCallExecutedEvent) ProtoMessage() {} func (*ContractCallExecutedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{20} + return fileDescriptor_2f8523f2f6feb451, []int{18} } func (m *ContractCallExecutedEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1176,7 +1086,7 @@ func (m *ERC20DeployedEvent) Reset() { *m = ERC20DeployedEvent{} } func (m *ERC20DeployedEvent) String() string { return proto.CompactTextString(m) } func (*ERC20DeployedEvent) ProtoMessage() {} func (*ERC20DeployedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{21} + return fileDescriptor_2f8523f2f6feb451, []int{19} } func (m *ERC20DeployedEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1267,7 +1177,7 @@ func (m *SignerSetTxExecutedEvent) Reset() { *m = SignerSetTxExecutedEve func (m *SignerSetTxExecutedEvent) String() string { return proto.CompactTextString(m) } func (*SignerSetTxExecutedEvent) ProtoMessage() {} func (*SignerSetTxExecutedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_2f8523f2f6feb451, []int{22} + return fileDescriptor_2f8523f2f6feb451, []int{20} } func (m *SignerSetTxExecutedEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1329,8 +1239,6 @@ func init() { proto.RegisterType((*MsgSendToEthereumResponse)(nil), "gravity.v1.MsgSendToEthereumResponse") proto.RegisterType((*MsgCancelSendToEthereum)(nil), "gravity.v1.MsgCancelSendToEthereum") proto.RegisterType((*MsgCancelSendToEthereumResponse)(nil), "gravity.v1.MsgCancelSendToEthereumResponse") - proto.RegisterType((*MsgRequestBatchTx)(nil), "gravity.v1.MsgRequestBatchTx") - proto.RegisterType((*MsgRequestBatchTxResponse)(nil), "gravity.v1.MsgRequestBatchTxResponse") proto.RegisterType((*MsgSubmitEthereumTxConfirmation)(nil), "gravity.v1.MsgSubmitEthereumTxConfirmation") proto.RegisterType((*ContractCallTxConfirmation)(nil), "gravity.v1.ContractCallTxConfirmation") proto.RegisterType((*BatchTxConfirmation)(nil), "gravity.v1.BatchTxConfirmation") @@ -1353,91 +1261,88 @@ func init() { func init() { proto.RegisterFile("gravity/v1/msgs.proto", fileDescriptor_2f8523f2f6feb451) } var fileDescriptor_2f8523f2f6feb451 = []byte{ - // 1333 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x16, 0x25, 0xd9, 0x81, 0x47, 0xfe, 0xa5, 0x9d, 0x44, 0x56, 0x12, 0xc9, 0x51, 0x90, 0xc6, - 0x69, 0x20, 0x32, 0x76, 0x02, 0xb4, 0x48, 0xd1, 0x02, 0x96, 0xec, 0x20, 0x45, 0xe1, 0x1c, 0x24, - 0xa7, 0x30, 0x7a, 0x11, 0x28, 0x72, 0x42, 0x31, 0x11, 0xb9, 0x2a, 0x77, 0x25, 0x58, 0xd7, 0x9e, - 0x8a, 0x9e, 0xda, 0x43, 0xef, 0x39, 0x04, 0x7d, 0x82, 0xbc, 0x40, 0x6e, 0x69, 0x4e, 0x01, 0x0a, - 0x14, 0x45, 0x0f, 0x41, 0x11, 0x5f, 0xfa, 0x0c, 0x05, 0x0a, 0x14, 0xdc, 0x5d, 0xca, 0x24, 0x45, - 0xff, 0x01, 0x3d, 0x89, 0x3b, 0xf3, 0xed, 0xfc, 0xed, 0xb7, 0x3b, 0x23, 0xb8, 0x68, 0xfb, 0xc6, - 0xd0, 0x61, 0x23, 0x7d, 0xb8, 0xa1, 0xbb, 0xd4, 0xa6, 0x5a, 0xdf, 0x27, 0x8c, 0xa8, 0x20, 0xc5, - 0xda, 0x70, 0xa3, 0x54, 0x36, 0x09, 0x75, 0x09, 0xd5, 0x3b, 0x06, 0x45, 0x7d, 0xb8, 0xd1, 0x41, - 0x66, 0x6c, 0xe8, 0x26, 0x71, 0x3c, 0x81, 0x2d, 0xad, 0x0a, 0x7d, 0x9b, 0xaf, 0x74, 0xb1, 0x90, - 0xaa, 0x62, 0xc4, 0x7a, 0x68, 0x51, 0x68, 0x56, 0x6c, 0x62, 0x13, 0xb1, 0x23, 0xf8, 0x92, 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a1, 0xac, 0xfc, 0xf5, 0xa1, 0xac, 0xfc, 0x78, 0x58, 0xce, 0xbc, 0x3b, 0x2c, 0x67, 0xfe, - 0x38, 0x2c, 0x67, 0xbe, 0xf9, 0x2c, 0xf2, 0xe6, 0xf6, 0xd1, 0xb6, 0x47, 0xcf, 0x86, 0xe1, 0x9f, - 0xdc, 0x9a, 0xf8, 0x0f, 0xa7, 0xbb, 0xc4, 0x1a, 0xf4, 0x50, 0x1f, 0xde, 0xd3, 0x0f, 0x42, 0x95, - 0xe8, 0xa2, 0x9d, 0x69, 0x3e, 0xfb, 0xdd, 0xfb, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x17, 0x13, 0x74, - 0x8d, 0x80, 0x0f, 0x00, 0x00, + // 1283 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x8f, 0xd3, 0x46, + 0x14, 0x5f, 0x27, 0x61, 0xd1, 0xbe, 0xec, 0xa7, 0x77, 0x81, 0x6c, 0x0a, 0xc9, 0x62, 0x44, 0x59, + 0x8a, 0x62, 0xb3, 0x0b, 0x52, 0x2b, 0xaa, 0x56, 0x22, 0xd9, 0x45, 0x54, 0xd5, 0x72, 0x48, 0xa0, + 0x42, 0xbd, 0x44, 0xfe, 0x78, 0x38, 0x86, 0xd8, 0x13, 0x79, 0x26, 0xd1, 0xe6, 0xda, 0x53, 0xd5, + 0x53, 0x7b, 0xe8, 0x9d, 0x03, 0xea, 0x5f, 0xc0, 0x3f, 0xc0, 0x8d, 0x72, 0x42, 0xea, 0xa5, 0xea, + 0x01, 0x55, 0x70, 0xe9, 0xdf, 0x50, 0xb5, 0x52, 0xe5, 0x99, 0x71, 0xd6, 0x76, 0xbc, 0x5f, 0x52, + 0x4f, 0xf1, 0xbc, 0xf7, 0x9b, 0x37, 0xef, 0xe3, 0x37, 0xef, 0x4d, 0xe0, 0x9c, 0x1b, 0x9a, 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 0xaf, 0xc1, 0xd2, 0x84, 0x4f, + 0xd2, 0xc7, 0x22, 0xf7, 0x71, 0x31, 0x16, 0x77, 0xb8, 0x54, 0xbd, 0x08, 0x73, 0x91, 0xde, 0x64, + 0xc3, 0x50, 0xf0, 0x61, 0xbe, 0x7d, 0x20, 0xd0, 0x5e, 0x28, 0xb0, 0xda, 0x34, 0x99, 0xdd, 0xcb, + 0x38, 0x7f, 0x15, 0x16, 0x19, 0x79, 0x86, 0x41, 0xd7, 0x96, 0x01, 0x4a, 0x3a, 0x2f, 0x70, 0x69, + 0x1c, 0xb5, 0x5a, 0x87, 0xb2, 0x15, 0xed, 0x4e, 0x79, 0x0b, 0x5c, 0xf4, 0xbf, 0xba, 0xf9, 0x83, + 0x02, 0x17, 0x04, 0xb0, 0x83, 0x2c, 0xe3, 0xea, 0x26, 0x2c, 0x0b, 0xcb, 0x5d, 0x8a, 0x4c, 0x3a, + 0x22, 0x78, 0xb7, 0x48, 0xe3, 0x2d, 0x87, 0x3a, 0x53, 0x38, 0xde, 0x99, 0x62, 0xd6, 0x99, 0xeb, + 0x70, 0xed, 0x18, 0x3a, 0x4e, 0xa8, 0x3b, 0x84, 0xf3, 0x53, 0xd0, 0xdd, 0x51, 0x74, 0xc1, 0xbf, + 0x80, 0x33, 0x18, 0x7d, 0x1c, 0xc9, 0xd4, 0x95, 0x37, 0x2f, 0x1b, 0x0b, 0xa9, 0x7d, 0x6d, 0xb1, + 0xeb, 0x18, 0x66, 0x6e, 0x40, 0x2d, 0xff, 0xd8, 0x89, 0x63, 0xaf, 0x14, 0x58, 0xda, 0xa3, 0xee, + 0x0e, 0xf6, 0xd1, 0x35, 0x19, 0x7e, 0x8d, 0x63, 0xaa, 0xde, 0x80, 0x15, 0xc9, 0x32, 0x12, 0x76, + 0x4d, 0xc7, 0x09, 0x91, 0x52, 0x59, 0xf6, 0xe5, 0x89, 0xe2, 0xae, 0x90, 0xab, 0x5b, 0xb0, 0x46, + 0x42, 0xbb, 0x87, 0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 0xe8, 0xf5, 0xfb, 0x9a, 0xf2, 0xf6, 0x7d, 0x4d, + 0xf9, 0xf3, 0x7d, 0x4d, 0xf9, 0xf1, 0x43, 0x6d, 0xe6, 0xed, 0x87, 0xda, 0xcc, 0xef, 0x1f, 0x6a, + 0x33, 0xdf, 0x7e, 0x9e, 0xe8, 0x8c, 0x03, 0x74, 0xdd, 0xf1, 0xd3, 0x51, 0xfc, 0x57, 0xb1, 0x21, + 0xfe, 0x09, 0x19, 0x3e, 0x71, 0x86, 0x7d, 0x34, 0x46, 0xb7, 0x8c, 0xfd, 0x58, 0x25, 0x66, 0x9d, + 0x35, 0xcb, 0x5f, 0x68, 0xb7, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x42, 0xc5, 0xab, 0xc6, + 0x0e, 0x00, 0x00, } func (this *SendToCosmosEvent) Equal(that interface{}) bool { @@ -1494,7 +1399,6 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { SendToEthereum(ctx context.Context, in *MsgSendToEthereum, opts ...grpc.CallOption) (*MsgSendToEthereumResponse, error) CancelSendToEthereum(ctx context.Context, in *MsgCancelSendToEthereum, opts ...grpc.CallOption) (*MsgCancelSendToEthereumResponse, error) - RequestBatchTx(ctx context.Context, in *MsgRequestBatchTx, opts ...grpc.CallOption) (*MsgRequestBatchTxResponse, error) SubmitEthereumTxConfirmation(ctx context.Context, in *MsgSubmitEthereumTxConfirmation, opts ...grpc.CallOption) (*MsgSubmitEthereumTxConfirmationResponse, error) SubmitEthereumEvent(ctx context.Context, in *MsgSubmitEthereumEvent, opts ...grpc.CallOption) (*MsgSubmitEthereumEventResponse, error) SetDelegateKeys(ctx context.Context, in *MsgDelegateKeys, opts ...grpc.CallOption) (*MsgDelegateKeysResponse, error) @@ -1527,15 +1431,6 @@ func (c *msgClient) CancelSendToEthereum(ctx context.Context, in *MsgCancelSendT return out, nil } -func (c *msgClient) RequestBatchTx(ctx context.Context, in *MsgRequestBatchTx, opts ...grpc.CallOption) (*MsgRequestBatchTxResponse, error) { - out := new(MsgRequestBatchTxResponse) - err := c.cc.Invoke(ctx, "/gravity.v1.Msg/RequestBatchTx", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) SubmitEthereumTxConfirmation(ctx context.Context, in *MsgSubmitEthereumTxConfirmation, opts ...grpc.CallOption) (*MsgSubmitEthereumTxConfirmationResponse, error) { out := new(MsgSubmitEthereumTxConfirmationResponse) err := c.cc.Invoke(ctx, "/gravity.v1.Msg/SubmitEthereumTxConfirmation", in, out, opts...) @@ -1576,7 +1471,6 @@ func (c *msgClient) SubmitEthereumHeightVote(ctx context.Context, in *MsgEthereu type MsgServer interface { SendToEthereum(context.Context, *MsgSendToEthereum) (*MsgSendToEthereumResponse, error) CancelSendToEthereum(context.Context, *MsgCancelSendToEthereum) (*MsgCancelSendToEthereumResponse, error) - RequestBatchTx(context.Context, *MsgRequestBatchTx) (*MsgRequestBatchTxResponse, error) SubmitEthereumTxConfirmation(context.Context, *MsgSubmitEthereumTxConfirmation) (*MsgSubmitEthereumTxConfirmationResponse, error) SubmitEthereumEvent(context.Context, *MsgSubmitEthereumEvent) (*MsgSubmitEthereumEventResponse, error) SetDelegateKeys(context.Context, *MsgDelegateKeys) (*MsgDelegateKeysResponse, error) @@ -1593,9 +1487,6 @@ func (*UnimplementedMsgServer) SendToEthereum(ctx context.Context, req *MsgSendT func (*UnimplementedMsgServer) CancelSendToEthereum(ctx context.Context, req *MsgCancelSendToEthereum) (*MsgCancelSendToEthereumResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelSendToEthereum not implemented") } -func (*UnimplementedMsgServer) RequestBatchTx(ctx context.Context, req *MsgRequestBatchTx) (*MsgRequestBatchTxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RequestBatchTx not implemented") -} func (*UnimplementedMsgServer) SubmitEthereumTxConfirmation(ctx context.Context, req *MsgSubmitEthereumTxConfirmation) (*MsgSubmitEthereumTxConfirmationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitEthereumTxConfirmation not implemented") } @@ -1649,24 +1540,6 @@ func _Msg_CancelSendToEthereum_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Msg_RequestBatchTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRequestBatchTx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RequestBatchTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gravity.v1.Msg/RequestBatchTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RequestBatchTx(ctx, req.(*MsgRequestBatchTx)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_SubmitEthereumTxConfirmation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgSubmitEthereumTxConfirmation) if err := dec(in); err != nil { @@ -1751,10 +1624,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CancelSendToEthereum", Handler: _Msg_CancelSendToEthereum_Handler, }, - { - MethodName: "RequestBatchTx", - Handler: _Msg_RequestBatchTx_Handler, - }, { MethodName: "SubmitEthereumTxConfirmation", Handler: _Msg_SubmitEthereumTxConfirmation_Handler, @@ -1919,66 +1788,6 @@ func (m *MsgCancelSendToEthereumResponse) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } -func (m *MsgRequestBatchTx) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgRequestBatchTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRequestBatchTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintMsgs(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x12 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintMsgs(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRequestBatchTxResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgRequestBatchTxResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRequestBatchTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func (m *MsgSubmitEthereumTxConfirmation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2757,32 +2566,6 @@ func (m *MsgCancelSendToEthereumResponse) Size() (n int) { return n } -func (m *MsgRequestBatchTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovMsgs(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovMsgs(uint64(l)) - } - return n -} - -func (m *MsgRequestBatchTxResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *MsgSubmitEthereumTxConfirmation) Size() (n int) { if m == nil { return 0 @@ -3515,170 +3298,6 @@ func (m *MsgCancelSendToEthereumResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRequestBatchTx) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsgs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRequestBatchTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRequestBatchTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsgs - } - 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 ErrInvalidLengthMsgs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMsgs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsgs - } - 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 ErrInvalidLengthMsgs - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMsgs - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMsgs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMsgs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRequestBatchTxResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMsgs - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRequestBatchTxResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRequestBatchTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipMsgs(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMsgs - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgSubmitEthereumTxConfirmation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/module/x/gravity/types/query.pb.go b/module/x/gravity/types/query.pb.go index 5a5ed6251..ece134a0b 100644 --- a/module/x/gravity/types/query.pb.go +++ b/module/x/gravity/types/query.pb.go @@ -32,7 +32,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// rpc Params +// rpc Params type ParamsRequest struct { } @@ -113,7 +113,7 @@ func (m *ParamsResponse) GetParams() Params { return Params{} } -// rpc SignerSetTx +// rpc SignerSetTx type SignerSetTxRequest struct { SignerSetNonce uint64 `protobuf:"varint,1,opt,name=signer_set_nonce,json=signerSetNonce,proto3" json:"signer_set_nonce,omitempty"` } @@ -238,7 +238,7 @@ func (m *SignerSetTxResponse) GetSignerSet() *SignerSetTx { return nil } -// rpc BatchTx +// rpc BatchTx type BatchTxRequest struct { TokenContract string `protobuf:"bytes,1,opt,name=token_contract,json=tokenContract,proto3" json:"token_contract,omitempty"` BatchNonce uint64 `protobuf:"varint,2,opt,name=batch_nonce,json=batchNonce,proto3" json:"batch_nonce,omitempty"` @@ -335,7 +335,7 @@ func (m *BatchTxResponse) GetBatch() *BatchTx { return nil } -// rpc ContractCallTx +// rpc ContractCallTx type ContractCallTxRequest struct { InvalidationScope []byte `protobuf:"bytes,1,opt,name=invalidation_scope,json=invalidationScope,proto3" json:"invalidation_scope,omitempty"` InvalidationNonce uint64 `protobuf:"varint,2,opt,name=invalidation_nonce,json=invalidationNonce,proto3" json:"invalidation_nonce,omitempty"` @@ -521,7 +521,7 @@ func (m *SignerSetTxConfirmationsResponse) GetSignatures() []*SignerSetTxConfirm return nil } -// rpc SignerSetTxs +// rpc SignerSetTxs type SignerSetTxsRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -618,7 +618,7 @@ func (m *SignerSetTxsResponse) GetPagination() *query.PageResponse { return nil } -// rpc BatchTxs +// rpc BatchTxs type BatchTxsRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -715,7 +715,7 @@ func (m *BatchTxsResponse) GetPagination() *query.PageResponse { return nil } -// rpc ContractCallTxs +// rpc ContractCallTxs type ContractCallTxsRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -994,7 +994,7 @@ func (m *UnsignedBatchTxsResponse) GetBatches() []*BatchTx { return nil } -// rpc UnsignedContractCallTxs +// rpc UnsignedContractCallTxs type UnsignedContractCallTxsRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } diff --git a/orchestrator/cosmos_gravity/src/send.rs b/orchestrator/cosmos_gravity/src/send.rs index f9271b8fe..054958523 100644 --- a/orchestrator/cosmos_gravity/src/send.rs +++ b/orchestrator/cosmos_gravity/src/send.rs @@ -102,22 +102,6 @@ pub async fn send_to_eth( send_messages(contact, cosmos_key, gas_price, vec![msg], gas_adjustment).await } -pub async fn send_request_batch_tx( - cosmos_key: CosmosPrivateKey, - denom: String, - gas_price: (f64, String), - contact: &Contact, - gas_adjustment: f64, -) -> Result<TxResponse, GravityError> { - let cosmos_address = cosmos_key.to_address(&contact.get_prefix()).unwrap(); - let msg_request_batch = proto::MsgRequestBatchTx { - signer: cosmos_address.to_string(), - denom, - }; - let msg = Msg::new("/gravity.v1.MsgRequestBatchTx", msg_request_batch); - send_messages(contact, cosmos_key, gas_price, vec![msg], gas_adjustment).await -} - pub async fn send_messages( contact: &Contact, cosmos_key: CosmosPrivateKey, diff --git a/orchestrator/gorc/src/commands/cosmos_to_eth.rs b/orchestrator/gorc/src/commands/cosmos_to_eth.rs index a67c6ac99..2dae2a2c3 100644 --- a/orchestrator/gorc/src/commands/cosmos_to_eth.rs +++ b/orchestrator/gorc/src/commands/cosmos_to_eth.rs @@ -1,7 +1,7 @@ use crate::application::APP; use abscissa_core::{clap::Parser, status_err, Application, Command, Runnable}; use clarity::Uint256; -use cosmos_gravity::send::{send_request_batch_tx, send_to_eth}; +use cosmos_gravity::send::send_to_eth; use deep_space::coin::Coin; use ethers::types::Address as EthAddress; use gravity_proto::gravity::DenomToErc20Request; @@ -14,9 +14,6 @@ const TIMEOUT: Duration = Duration::from_secs(60); #[derive(Command, Debug, Default, Parser)] pub struct CosmosToEthCmd { pub args: Vec<String>, - - #[clap(short, long)] - pub flag_no_batch: bool, } pub fn one_eth() -> f64 { @@ -60,85 +57,74 @@ impl Runnable for CosmosToEthCmd { let cosmos_grpc = config.cosmos.grpc.trim(); println!("Sending from Cosmos address {}", cosmos_address); abscissa_tokio::run_with_actix(&APP, async { - let connections = create_rpc_connections( - cosmos_prefix.to_string(), - Some(cosmos_grpc.to_string()), - None, - TIMEOUT, - ) - .await; - let contact = connections.contact.unwrap(); - let mut grpc = connections.grpc.unwrap(); - let res = grpc - .denom_to_erc20(DenomToErc20Request { - denom: gravity_denom.clone(), - }) + let connections = create_rpc_connections( + cosmos_prefix.to_string(), + Some(cosmos_grpc.to_string()), + None, + TIMEOUT, + ) .await; - match res { - Ok(val) => println!( - "Asset {} has ERC20 representation {}", - gravity_denom, - val.into_inner().erc20 - ), - Err(_e) => { - println!( - "Asset {} has no ERC20 representation, you may need to deploy an ERC20 for it!", - gravity_denom - ); - exit(1); - } - } - - let amount = Coin { - amount: amount.clone(), - denom: gravity_denom.clone(), - }; - let bridge_fee = Coin { - amount: 1u64.into(), - denom: gravity_denom.clone(), - }; - - let eth_dest = self.args.get(3).expect("ethereum destination is required"); - let eth_dest: EthAddress = eth_dest.parse().expect("cannot parse ethereum address"); - check_for_fee_denom(&gravity_denom, cosmos_address, &contact).await; - - let balances = contact - .get_balances(cosmos_address) - .await - .expect("Failed to get balances!"); - let mut found = None; - for coin in balances.iter() { - if coin.denom == gravity_denom { - found = Some(coin); + let contact = connections.contact.unwrap(); + let mut grpc = connections.grpc.unwrap(); + let res = grpc + .denom_to_erc20(DenomToErc20Request { + denom: gravity_denom.clone(), + }) + .await; + match res { + Ok(val) => println!( + "Asset {} has ERC20 representation {}", + gravity_denom, + val.into_inner().erc20 + ), + Err(_e) => { + println!( + "Asset {} has no ERC20 representation, you may need to deploy an ERC20 for it!", + gravity_denom + ); + exit(1); + } } - } - - println!("Cosmos balances {:?}", balances); - let times = self.args.get(4).expect("times is required"); - let times = times.parse::<usize>().expect("cannot parse times"); + let amount = Coin { + amount: amount.clone(), + denom: gravity_denom.clone(), + }; + let bridge_fee = Coin { + amount: 1u64.into(), + denom: gravity_denom.clone(), + }; + + let eth_dest = self.args.get(3).expect("ethereum destination is required"); + let eth_dest: EthAddress = eth_dest.parse().expect("cannot parse ethereum address"); + check_for_fee_denom(&gravity_denom, cosmos_address, &contact).await; + + let balances = contact + .get_balances(cosmos_address) + .await + .expect("Failed to get balances!"); + let mut found = None; + for coin in balances.iter() { + if coin.denom == gravity_denom { + found = Some(coin); + } + } - match found { - None => panic!("You don't have any {} tokens!", gravity_denom), - Some(found) => { - if amount.amount.clone() * times.into() >= found.amount && times == 1 { - if is_cosmos_originated { - panic!("Your transfer of {} {} tokens is greater than your balance of {} tokens. Remember you need some to pay for fees!", print_atom(amount.amount), gravity_denom, print_atom(found.amount.clone())); - } else { - panic!("Your transfer of {} {} tokens is greater than your balance of {} tokens. Remember you need some to pay for fees!", print_eth(amount.amount), gravity_denom, print_eth(found.amount.clone())); - } - } else if amount.amount.clone() * times.into() >= found.amount { - if is_cosmos_originated { - panic!("Your transfer of {} * {} {} tokens is greater than your balance of {} tokens. Try to reduce the amount or the --times parameter", print_atom(amount.amount), times, gravity_denom, print_atom(found.amount.clone())); - } else { - panic!("Your transfer of {} * {} {} tokens is greater than your balance of {} tokens. Try to reduce the amount or the --times parameter", print_eth(amount.amount), times, gravity_denom, print_eth(found.amount.clone())); + println!("Cosmos balances {:?}", balances); + + match found { + None => panic!("You don't have any {} tokens!", gravity_denom), + Some(found) => { + if amount.amount.clone() >= found.amount { + if is_cosmos_originated { + panic!("Your transfer of {} {} tokens is greater than your balance of {} tokens. Remember you need some to pay for fees!", print_atom(amount.amount), gravity_denom, print_atom(found.amount.clone())); + } else { + panic!("Your transfer of {} {} tokens is greater than your balance of {} tokens. Remember you need some to pay for fees!", print_eth(amount.amount), gravity_denom, print_eth(found.amount.clone())); + } } } } - } - let mut successful_sends = 0; - for _ in 0..times { println!( "Locking {} / {} into the batch pool", amount.clone(), @@ -156,25 +142,10 @@ impl Runnable for CosmosToEthCmd { .await; match res { Ok(tx_id) => { - successful_sends += 1; println!("Send to Eth txid {}", tx_id.txhash); } Err(e) => println!("Failed to send tokens! {:?}", e), } - } - - if successful_sends > 0 { - if !self.flag_no_batch { - println!("Requesting a batch to push transaction along immediately"); - send_request_batch_tx(cosmos_key, gravity_denom,config.cosmos.gas_price.as_tuple(), &contact,config.cosmos.gas_adjustment) - .await - .expect("Failed to request batch"); - } else { - println!("--no-batch specified, your transfer will wait until someone requests a batch for this token type") - } - } else { - println!("No successful sends, no batch will be sent") - } }) .unwrap_or_else(|e| { status_err!("executor exited with error: {}", e); diff --git a/orchestrator/gorc/src/commands/eth_to_cosmos.rs b/orchestrator/gorc/src/commands/eth_to_cosmos.rs index 81b482c1a..fe15fd231 100644 --- a/orchestrator/gorc/src/commands/eth_to_cosmos.rs +++ b/orchestrator/gorc/src/commands/eth_to_cosmos.rs @@ -69,45 +69,35 @@ impl Runnable for EthToCosmosCmd { .await .expect("Failed to get balance, check ERC20 contract address"); - let times = self.args.get(5).expect("times is required"); - let times_usize = times.parse::<usize>().expect("cannot parse times as usize"); - let times_u256 = U256::from_dec_str(times).expect("cannot parse times as U256"); - if erc20_balance == 0u8.into() { panic!( "You have zero {} tokens, please double check your sender and erc20 addresses!", contract_address ); - } else if amount * times_u256 > erc20_balance { - panic!( - "Insufficient balance {} > {}", - amount * times_u256, - erc20_balance - ); + } else if amount > erc20_balance { + panic!("Insufficient balance {} > {}", amount, erc20_balance); } - for _ in 0..times_usize { - println!( - "Sending {} / {} to Cosmos from {} to {}", - init_amount.parse::<f64>().unwrap(), - erc20_address, - ethereum_address, - cosmos_dest - ); - // we send some erc20 tokens to the gravity contract to register a deposit - let res = send_to_cosmos( - erc20_address, - contract_address, - amount, - cosmos_dest, - Some(TIMEOUT), - eth_client.clone(), - ) - .await; - match res { - Ok(tx_id) => println!("Send to Cosmos txid: {}", tx_id), - Err(e) => println!("Failed to send tokens! {:?}", e), - } + println!( + "Sending {} / {} to Cosmos from {} to {}", + init_amount.parse::<f64>().unwrap(), + erc20_address, + ethereum_address, + cosmos_dest + ); + // we send some erc20 tokens to the gravity contract to register a deposit + let res = send_to_cosmos( + erc20_address, + contract_address, + amount, + cosmos_dest, + Some(TIMEOUT), + eth_client.clone(), + ) + .await; + match res { + Ok(tx_id) => println!("Send to Cosmos txid: {}", tx_id), + Err(e) => println!("Failed to send tokens! {:?}", e), } }) .unwrap_or_else(|e| { diff --git a/orchestrator/test_runner/src/happy_path.rs b/orchestrator/test_runner/src/happy_path.rs index 4cacc97f4..21c1e257d 100644 --- a/orchestrator/test_runner/src/happy_path.rs +++ b/orchestrator/test_runner/src/happy_path.rs @@ -8,7 +8,7 @@ use crate::OPERATION_TIMEOUT; use crate::TOTAL_TIMEOUT; use clarity::Uint256; use cosmos_gravity::crypto::PrivateKey as CosmosPrivateKey; -use cosmos_gravity::send::{send_request_batch_tx, send_to_eth}; +use cosmos_gravity::send::send_to_eth; use cosmos_gravity::{build, query::get_oldest_unsigned_transaction_batch, send}; use deep_space::address::Address as CosmosAddress; use deep_space::coin::Coin; @@ -346,17 +346,6 @@ async fn test_batch( .unwrap(); info!("Sent tokens to Ethereum with {:?}", res); - info!("Requesting transaction batch"); - send_request_batch_tx( - requester_cosmos_private_key, - token_name.clone(), - (10f64, "footoken".to_string()), - contact, - 1.0, - ) - .await - .unwrap(); - contact.wait_for_next_block(TOTAL_TIMEOUT).await.unwrap(); let requester_address = requester_cosmos_private_key .to_address(&contact.get_prefix()) diff --git a/orchestrator/test_runner/src/happy_path_v2.rs b/orchestrator/test_runner/src/happy_path_v2.rs index 53e717134..8421da3ac 100644 --- a/orchestrator/test_runner/src/happy_path_v2.rs +++ b/orchestrator/test_runner/src/happy_path_v2.rs @@ -5,7 +5,7 @@ use crate::MINER_CLIENT; use crate::TOTAL_TIMEOUT; use crate::{get_fee, utils::ValidatorKeys}; use clarity::Uint256; -use cosmos_gravity::send::{send_request_batch_tx, send_to_eth}; +use cosmos_gravity::send::send_to_eth; use deep_space::coin::Coin; use deep_space::Contact; use ethereum_gravity::erc20_utils::get_erc20_balance; @@ -166,18 +166,6 @@ pub async fn happy_path_test_v2( amount_to_bridge, token_to_send_to_eth ); - let res = send_request_batch_tx( - keys[0].validator_key, - token_to_send_to_eth.clone(), - (10f64, "footoken".to_string()), - contact, - 1.0, - ) - .await - .unwrap(); - info!("Batch request res {:?}", res); - info!("Sent batch request to move things along"); - info!("Waiting for batch to be signed and relayed to Ethereum"); match tokio::time::timeout(TOTAL_TIMEOUT, async { loop { diff --git a/orchestrator/test_runner/src/transaction_stress_test.rs b/orchestrator/test_runner/src/transaction_stress_test.rs index 4d92699b6..c7252787a 100644 --- a/orchestrator/test_runner/src/transaction_stress_test.rs +++ b/orchestrator/test_runner/src/transaction_stress_test.rs @@ -2,7 +2,7 @@ use crate::{ one_eth, one_hundred_eth, one_hundred_eth_uint256, utils::*, MINER_CLIENT, TOTAL_TIMEOUT, }; use clarity::Uint256; -use cosmos_gravity::send::{send_request_batch_tx, send_to_eth}; +use cosmos_gravity::send::send_to_eth; use deep_space::coin::Coin; use deep_space::Contact; use ethereum_gravity::{ @@ -189,20 +189,6 @@ pub async fn transaction_stress_test( ); } - for denom in denoms { - info!("Requesting batch for {}", denom); - let res = send_request_batch_tx( - keys[0].validator_key, - denom, - (0f64, "".to_string()), - contact, - 1.0, - ) - .await - .unwrap(); - info!("batch request response is {:?}", res); - } - match tokio::time::timeout(TOTAL_TIMEOUT, async { loop { good = true;