Predict gas price for ETH transaction #478

Closed
opened 2022-11-09 04:25:54 +00:00 by vampik · 26 comments
vampik commented 2022-11-09 04:25:54 +00:00 (Migrated from gitlab.com)

We should predict gas price for ETH transaction for 2 cases:

  1. Don't execute withdrawal transaction if its amount is smaller than gas price (+ compensation to SON)
  2. Feature to predict transaction gas price for user (so user can check the cost of withdrawal before executing). Through cli_wallet?
We should predict gas price for ETH transaction for 2 cases: 1) Don't execute withdrawal transaction if its amount is smaller than gas price (+ compensation to SON) 2) Feature to predict transaction gas price for user (so user can check the cost of withdrawal before executing). Through `cli_wallet`?
vampik commented 2022-11-09 04:25:54 +00:00 (Migrated from gitlab.com)

assigned to @vampik

assigned to @vampik
vampik commented 2022-11-15 05:38:07 +00:00 (Migrated from gitlab.com)

mentioned in commit 1389a5f6f810d5038e0daa83627fe4a7650127c5

mentioned in commit 1389a5f6f810d5038e0daa83627fe4a7650127c5
vampik commented 2022-11-16 05:23:16 +00:00 (Migrated from gitlab.com)

mentioned in commit 48101f79a03e4cba5733808c6889fe588c482094

mentioned in commit 48101f79a03e4cba5733808c6889fe588c482094
vampik commented 2022-11-22 05:40:02 +00:00 (Migrated from gitlab.com)

mentioned in merge request !179

mentioned in merge request !179
vampik commented 2022-11-22 05:40:29 +00:00 (Migrated from gitlab.com)

assigned to @serkixenos

assigned to @serkixenos
vampik commented 2022-11-22 20:44:07 +00:00 (Migrated from gitlab.com)

mentioned in commit 022fdeb40a

mentioned in commit 022fdeb40a3344c0e5e5d47d74369e1b7bb21f94
serkixenos commented 2022-11-22 20:44:08 +00:00 (Migrated from gitlab.com)

mentioned in commit 1b340345f3

mentioned in commit 1b340345f3bbdb001fc307ccd6e3262477e1b12e
serkixenos commented 2022-11-22 20:44:21 +00:00 (Migrated from gitlab.com)

assigned to @wsalloum

assigned to @wsalloum
vampik commented 2022-11-23 04:01:12 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
vampik commented 2022-11-23 04:04:25 +00:00 (Migrated from gitlab.com)

How to test:

  1. There is new command in cli_wallet - eth_estimate_withdrawal_transaction_fee (it returns the fee we need to pay for ETH withdrawal transaction)

  2. Try to withdraw an amount smaller than the one returned in eth_estimate_withdrawal_transaction_fee. Should be the warning that amount is smaller than fee.

How to test: 1) There is new command in `cli_wallet` - `eth_estimate_withdrawal_transaction_fee` (it returns the fee we need to pay for ETH withdrawal transaction) 2) Try to withdraw an amount smaller than the one returned in `eth_estimate_withdrawal_transaction_fee`. Should be the warning that amount is smaller than fee.
wsalloum commented 2022-11-23 18:20:40 +00:00 (Migrated from gitlab.com)

@vampik is it on the peerplays ? I am not able to find it

unlocked >>> eth_estimate_withdrawal_transaction_fee              
eth_estimate_withdrawal_transaction_fee
10 assert_exception: Assert Exception
itr != _by_name.end(): no method with name 'eth_estimate_withdrawal_transaction_fee'

@vampik is it on the peerplays ? I am not able to find it ``` unlocked >>> eth_estimate_withdrawal_transaction_fee eth_estimate_withdrawal_transaction_fee 10 assert_exception: Assert Exception itr != _by_name.end(): no method with name 'eth_estimate_withdrawal_transaction_fee' ```
vampik commented 2022-11-23 19:26:35 +00:00 (Migrated from gitlab.com)

@wsalloum Yes in peerplays. It seems you don't have these changes in your branch...

@wsalloum Yes in peerplays. It seems you don't have these changes in your branch...
wsalloum commented 2022-11-24 09:25:59 +00:00 (Migrated from gitlab.com)

@vampik Which branch I need to use? It is not mentioned there! so I supposed it should be the master for QA

@vampik Which branch I need to use? It is not mentioned there! so I supposed it should be the master for QA
vampik commented 2022-11-24 10:35:36 +00:00 (Migrated from gitlab.com)

Yes, you can use master for QA.
But you should rebuild peerplays repo with the latest changes.
It check that it contain commit:
1b340345f3

Yes, you can use master for QA. But you should rebuild peerplays repo with the latest changes. It check that it contain commit: https://gitlab.com/PBSA/peerplays/-/commit/1b340345f3bbdb001fc307ccd6e3262477e1b12e
wsalloum commented 2022-11-24 16:53:18 +00:00 (Migrated from gitlab.com)

It seems it is updated after I pulled the latest updates, anyway, I can see it now :)

It seems it is updated after I pulled the latest updates, anyway, I can see it now :)
wsalloum commented 2022-11-24 16:53:39 +00:00 (Migrated from gitlab.com)

I am able to transfer amount less than the fees

unlocked >>> eth_estimate_withdrawal_transaction_fee              
eth_estimate_withdrawal_transaction_fee 
"0.00013800 ETH"

unlocked >>> list_account_balances account01
list_account_balances account01
49999950 TEST
2 ETH
1000000 PBTC
1000000 PEOS
999998.99989 PETH

unlocked >>> transfer account01 sonaccount01 0.00011 ETH "" true  
transfer account01 sonaccount01 0.00011 ETH "" true
{
  "ref_block_num": 6076,
  "ref_block_prefix": 4092240143,
  "expiration": "2022-11-24T16:47:33",
  "operations": [[
      0,{
        "fee": {
          "amount": 0,
          "asset_id": "1.3.0"
        },
        "from": "1.2.52",
        "to": "1.2.36",
        "amount": {
          "amount": 11000,
          "asset_id": "1.3.2"
        },
        "extensions": []
      }
    ]
  ],
  "extensions": [],
  "signatures": [
    "1f2bf8651205600fe032e055accb3aea7edf719f7ecfb459ce21e6a7192ca23f0624089c787f5133d92e4c965e8223aadc283afd999b5d9681fb2f7bcfbe6e75e1"
  ]
}
unlocked >>> list_account_balances account01                     
list_account_balances account01
49999950 TEST
1.99989000 ETH
1000000 PBTC
1000000 PEOS
999998.99989 PETH

I am able to transfer amount less than the fees ``` unlocked >>> eth_estimate_withdrawal_transaction_fee eth_estimate_withdrawal_transaction_fee "0.00013800 ETH" unlocked >>> list_account_balances account01 list_account_balances account01 49999950 TEST 2 ETH 1000000 PBTC 1000000 PEOS 999998.99989 PETH unlocked >>> transfer account01 sonaccount01 0.00011 ETH "" true transfer account01 sonaccount01 0.00011 ETH "" true { "ref_block_num": 6076, "ref_block_prefix": 4092240143, "expiration": "2022-11-24T16:47:33", "operations": [[ 0,{ "fee": { "amount": 0, "asset_id": "1.3.0" }, "from": "1.2.52", "to": "1.2.36", "amount": { "amount": 11000, "asset_id": "1.3.2" }, "extensions": [] } ] ], "extensions": [], "signatures": [ "1f2bf8651205600fe032e055accb3aea7edf719f7ecfb459ce21e6a7192ca23f0624089c787f5133d92e4c965e8223aadc283afd999b5d9681fb2f7bcfbe6e75e1" ] } unlocked >>> list_account_balances account01 list_account_balances account01 49999950 TEST 1.99989000 ETH 1000000 PBTC 1000000 PEOS 999998.99989 PETH ```
prandnum commented 2022-11-24 19:34:38 +00:00 (Migrated from gitlab.com)

@wsalloum

transfer account01 sonaccount01 0.00011 ETH "" true
This is within peerplays network, you need to transfer to son-account

unlocked >>>  transfer account01 son-account 0.00011 ETH "" true  
 transfer account01 son-account 0.00011 ETH "" true
0 exception: unspecified
Transaction fee: 0.00013800 ETH, would be grater than transfer amount 0.00011000 ETH
    {"sidechain_fee":"0.00013800 ETH","amount":"0.00011000 ETH"}
    th_a  wallet.cpp:3352 transfer

    {"from":"account01","to":"son-account","amount":"0.00011","asset_symbol":"ETH","memo":"","broadcast":true}
    th_a  wallet.cpp:3359 transfer
unlocked >>> 
@wsalloum ``transfer account01 sonaccount01 0.00011 ETH "" true`` This is within peerplays network, you need to transfer to son-account ``` unlocked >>> transfer account01 son-account 0.00011 ETH "" true transfer account01 son-account 0.00011 ETH "" true 0 exception: unspecified Transaction fee: 0.00013800 ETH, would be grater than transfer amount 0.00011000 ETH {"sidechain_fee":"0.00013800 ETH","amount":"0.00011000 ETH"} th_a wallet.cpp:3352 transfer {"from":"account01","to":"son-account","amount":"0.00011","asset_symbol":"ETH","memo":"","broadcast":true} th_a wallet.cpp:3359 transfer unlocked >>> ```
prandnum commented 2022-11-24 19:36:32 +00:00 (Migrated from gitlab.com)

@vampik the message needs to reformatted

Transaction fee: 0.00013800 ETH, would be grater than transfer amount 0.00011000 ETH

Transaction fee: 0.00013800 ETH, is greater than transferred amount 0.00011000 ETH

@vampik the message needs to reformatted `Transaction fee: 0.00013800 ETH, would be grater than transfer amount 0.00011000 ETH` `Transaction fee: 0.00013800 ETH, is greater than transferred amount 0.00011000 ETH`
vampik commented 2022-11-25 05:47:54 +00:00 (Migrated from gitlab.com)

mentioned in commit e9cb289e4dd43128b3d561a740d5e1d4a43f4fce

mentioned in commit e9cb289e4dd43128b3d561a740d5e1d4a43f4fce
vampik commented 2022-11-25 05:47:54 +00:00 (Migrated from gitlab.com)

mentioned in commit aea808040f31b371c77248b1be63dcacb85bdac8

mentioned in commit aea808040f31b371c77248b1be63dcacb85bdac8
vampik commented 2022-11-28 07:35:12 +00:00 (Migrated from gitlab.com)

mentioned in commit b7113c4ff3

mentioned in commit b7113c4ff3495c6bb310ed60505dcbb3654c6316
vampik commented 2022-11-28 07:36:26 +00:00 (Migrated from gitlab.com)

mentioned in merge request !184

mentioned in merge request !184
serkixenos commented 2022-12-01 01:53:01 +00:00 (Migrated from gitlab.com)

mentioned in commit 12c0c66f4b

mentioned in commit 12c0c66f4b5bec8a3ccabd917b05f6173a5bebb5
vampik commented 2022-12-01 07:15:11 +00:00 (Migrated from gitlab.com)

@prandnum @wsalloum

Now you can verify that message has been reformatted

@prandnum @wsalloum Now you can verify that message has been reformatted
prandnum commented 2022-12-08 02:19:17 +00:00 (Migrated from gitlab.com)
verification blocked by https://gitlab.com/PBSA/peerplays/-/issues/488
prandnum commented 2022-12-09 16:52:07 +00:00 (Migrated from gitlab.com)

one scenario needs to be decided(#489) closing this issue.

one scenario needs to be decided(#489) closing this issue.
prandnum (Migrated from gitlab.com) closed this issue 2022-12-09 16:52:09 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#478
No description provided.