skalenetwork / skale-manager

Ethereum Mainnet smart contracts that manage SKALE Network. Coordinates validator-node registration, SKALE Chain creation, bounties, delegation, distributed key generation and service level agreements
GNU Affero General Public License v3.0
56 stars 30 forks source link

Refill validator wallet less than gasused for tx broadcas/allright(Berlin fork) #559

Closed sync-by-unito[bot] closed 3 years ago

sync-by-unito[bot] commented 3 years ago

Preconditions Skale manager: 1.8.0-beta.1

Step to reproduce Create schain Observe tx on etherscan

Actual result For now we have gap in broadcast 26-29% and ~50% during allright transactions. Tx example: Broadcast: https://rinkeby.etherscan.io/tx/0x1dd0a2c9473c0100f46a92498653d70d724e20dea98001ecad15855e6e935777

Alright: https://rinkeby.etherscan.io/tx/0x65e935932b7a664af0e544890b43da3714fde24b54128bd66221ca36439cc0f2

┆Issue is synchronized with this Jira Bug

sync-by-unito[bot] commented 3 years ago

➤ Yulia Timchenko commented:

Evgeniy Zherdzitskiy - does it require some logs?

sync-by-unito[bot] commented 3 years ago

➤ Automation for Jira commented:

Corresponding Pull Request https://github.com/skalenetwork/skale-manager/pull/565

sync-by-unito[bot] commented 3 years ago

➤ Ganna Kulikova commented:

Not critical for the schains launch

sync-by-unito[bot] commented 3 years ago

➤ Vadim Yavorsky commented:

We discussed with the guys that we can slightly change the logic of the refund. Now the ether will return not in the transaction itself, but in the next one that someone on the network calls. To do this, we will store the structure: node address, balance before the transaction, who should pay for the transaction. Thus, we will be able to return exactly as much as was spent. But for this to work as it should, we need to prevent nodes from withdrawing funds from the wallet. To do this, we need to prohibit withdrawals from the wallet at the SGX level. If the validator wants to withdraw his funds from the node's wallet, he will need to transfer them to the contract and then withdraw them.

sync-by-unito[bot] commented 3 years ago

➤ Chadwick Strange commented:

interesting - Vadim Yavorsky when you say “store” where will this happen and how expensive will it be?

sync-by-unito[bot] commented 3 years ago

➤ Chadwick Strange commented:

and for clarification: do you mean if a node requests getBounty in Month 1 - then the replenishment transaction is not executed until the subsequent getBounty transaction is executed in Month 2?

sync-by-unito[bot] commented 3 years ago

➤ Chadwick Strange commented:

Example Doc changes:

IntroThe self-recharging wallet system reimburses transactions during the subsequent transaction. For example, a node that executes getBounty in July, will be reimbursed for the getBounty transaction when getBounty is executed in August. This delay is done to ensure accurate accounting of transaction costs.

Using node walletsValidators cannot directly withdraw funds from their node wallets. To withdraw funds from node wallets, first transfer them to the self-recharging validator wallet using the node-cli skale wallet send [YOUR-SELF-RECHARGING-VALIDATOR-WALLET] [AMOUNT]

Ebru Engwall Dmitry Tkachuk please comment?

sync-by-unito[bot] commented 3 years ago

➤ Vadim Yavorsky commented:

Chadwick Strange No, getBounty transaction will be reimbursed after any transaction on mainnet that requires gas replenishment. For example: Tx1 - > getBounty(1); node 1 is caller After execution Tx1 we store

  1. balance of node 1 before execution tx1
  2. address of node 1
  3. validator should reimburse

Tx2 -> broadcast(data); node 2 is caller In tx2 we reimburse previous transaction tx1, because we know all the necessary data for this. Also as in tx2 we store data

  1. balance of node 2 before execution tx2
  2. address of node 2
  3. schain should reimburse

And so on, in TXn we reimburse TXn-1

sync-by-unito[bot] commented 3 years ago

➤ Alex Danko commented:

works for manager: 1.8.1-develop.4

broadcast: https://rinkeby.etherscan.io/tx/0x733b83d4f3509a884c6b59484779596e1669ee4cfbb9cfa89ef0978d48c02d31 ( https://rinkeby.etherscan.io/tx/0x733b83d4f3509a884c6b59484779596e1669ee4cfbb9cfa89ef0978d48c02d31 ) alright: https://rinkeby.etherscan.io/tx/0xa6bf1a5aeb2abaa893a8d375dd5d2b74fde7324b1ae33dcfb7e757296e8b23e0 ( https://rinkeby.etherscan.io/tx/0xa6bf1a5aeb2abaa893a8d375dd5d2b74fde7324b1ae33dcfb7e757296e8b23e0 )