EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.27k stars 3.6k forks source link

Add setalimits onto system contract #5174

Closed jchung00 closed 6 years ago

jchung00 commented 6 years ago

Currently, there doesn't seem to be a way to grant new accounts in the network unlimited resources (once the system contract has been deployed to eosio). Therefore, new eosio.* accounts such as eosio.sudo and eosio.wps will need tokens to be staked and RAM bought separately.

We've tested that the setpriv action doesn't actually grant an account unlimited resources. Even though the account will show up as privileged, it will still run into problems when not enough tokens are staked and/or insufficient RAM has been bought for the account. (Check screenshot)

screen shot 2018-08-09 at 5 05 30 pm

Accounts such as eosio.token and eosio.names are not privileged. However, they were created by the eosio account during launch, when the eosio was set to the eosio.bios contract. The resource limits for these accounts were set to -1, which gives them unlimited network resources.

In order to allow new community owned eosio.* accounts to receive unlimited network resources, there has to be some action in the system contract that calls the set_resource_limits function. It seems like setalimits actually exists in the abi of the system contract (https://github.com/EOSIO/eos/blob/369c7e31e17630e1327a48869b832635352a27f4/contracts/eosio.system/eosio.system.abi#L506).

However, the action isn't implemented in the system contract-- it is only defined in the eosio.bios contract here: https://github.com/EOSIO/eos/blob/7271924b476fb58c82e2481bb2d06c558bb74215/contracts/eosio.bios/eosio.bios.hpp#L16

Would it make sense to define the setalimits action in the system contract as well (with require_auth(_self);), in order to make it possible for newly created eosio.* accounts to receive unlimited network resources by using eosio permissions?

wanderingbort commented 6 years ago

These contracts are now tracked in the eosio.contracts repo. I have cloned this issue there and will close this as a result. See EOSIO/eosio.contracts#45

Thank you for your submission!