Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incentives for the user / developer to release storage #278

Closed
igormcoelho opened this issue Jun 22, 2018 · 28 comments
Closed

Incentives for the user / developer to release storage #278

igormcoelho opened this issue Jun 22, 2018 · 28 comments
Labels
Design Issue state - Feature accepted but the solution requires a design before being implemented Feature Type: Large changes or new features Ledger Module - The ledger is our 'database', this is used to tag changes about how we store information

Comments

@igormcoelho
Copy link
Contributor

igormcoelho commented Jun 22, 2018

In System Fees (http://docs.neo.org/en-us/sc/systemfees.html), Storage.Delete operation has 0.1 GAS cost. That does not incentive Storage reduction. It should be free (or user must even profit with it!).
Is there any negative aspect on executing Storage.Delete that must be avoided?

The same should be applied to Storage.Put when used space is reduced (It should cost only over the increased space in KB). Is there ANY negative impact associated to it?

@vncoelho
Copy link
Member

People could just delete the storage of others SC free... 🗡️ Sounds bad...
Ehauehauea
Just kidding. You have been always talking about that.
Since it is hard to reward that cases, I think that, at least, it should be free.

@erikzhang erikzhang added the Enhancement Type - Changes that may affect performance, usability or add new features to existing modules. label Jun 23, 2018
@erikzhang
Copy link
Member

The pricing structure will be adjusted in NEO 3.0, please wait for the new white paper.

@shargon
Copy link
Member

shargon commented Jun 23, 2018

I like this idea, a lot of projects don't remove unuseful data

@mwherman2000
Copy link

mwherman2000 commented Jun 23, 2018

@everyone You need to realize that physical blockchain storage (blocks and Txs) for "deleted" NEO storage is never freed up, correct?

The transactions that stored the original values and subsequent updates into NEO storage cannot be deleted ... it's a blockchain.

In fact, deleting storage takes up more physical space not less and, in effect, can create another free/cheaper way to store "dumb data" on the NEO blockchain.

Similarly, writing less data for a specific key uses more storage - not less.

I recommend that this issue should be closed.

@igormcoelho
Copy link
Contributor Author

igormcoelho commented Jun 23, 2018

@mwherman2000 there two ways of storing information: in the blockchain hash data or in Storage space. While blockchain data won't need to be carried out forever, the Storage needs to... so in my opinion (and Ethereum design agrees with that), Storage cleaning must be VERY incentived.

By the way, the blockchain space won't even increase in this case, because if a given function call is performed, it won't be bigger just because it has a Storage.Delete inside (that have been registered already in AVM opcode). So, in my opinion, that should be seriously considered, as soon as possible, and I hope to see that in Neo 3.0 :)

@mwherman2000
Copy link

mwherman2000 commented Jun 23, 2018 via email

@mwherman2000
Copy link

mwherman2000 commented Jun 23, 2018 via email

@erikzhang erikzhang added this to the NEO 3.0 milestone Jun 25, 2018
@erikzhang
Copy link
Member

See #286

@lllwvlvwlll
Copy link
Member

Delete should really only be incentivized where it is performant. Conventionally, It is more efficient to clean storage only when it is needed due to the compute requirements and quality impacts associated with making changes.

Introducing free codes also has the risk of opening us to compute exploitation.

@vncoelho
Copy link
Member

vncoelho commented Jun 25, 2018

@lllwvlvwlll, Tyler the great, nice very gud.
Nice insights.

We like to clean everything! aheuahueahueaea
Exploitation of it would be hard because the transaction would fail (Fault,Break), yes (accessing something that does not exist anymore for example)?

Transactions with only deletes would probably enter in the limited quota of free transactions, perhaps, some greedy heuristic could postpone these free/delete-only transactions if the free block part is already full.

@igormcoelho
Copy link
Contributor Author

@lllwvlvwlll Tyler, perhaps it's better to discuss in the other thread... this idea conflicts/adds up with all the others related to the new pricing model.

@igormcoelho igormcoelho reopened this Jun 12, 2019
@igormcoelho igormcoelho changed the title Storage.Delete must be free Storage.Delete must be free (Neo 3) Jun 12, 2019
@igormcoelho
Copy link
Contributor Author

Now we are back to Neo 3 roadmap, this is an important change.
Another option is to get money back from delete too... an even bigger incentive!

Useful for: #824

@shargon
Copy link
Member

shargon commented Jun 13, 2019

Nothing should be free, but i agree that could be cheaper

@igormcoelho
Copy link
Contributor Author

It should be more than free... negative is better 😂 its a favor done to the network.

@ioannistsil
Copy link

It should be more than free... negative is better its a favor done to the network.

awesome idea :)

@lock9
Copy link
Contributor

lock9 commented Jul 8, 2019

@shargon how can we incentivize the user to release space?
We either incentive the user to release space (good way) or "punish" them for using it 'irresponsible'?
I don't think the second option is doable

@lock9
Copy link
Contributor

lock9 commented Jul 17, 2019

@neo-project/core we need to decide about this.

  • How to incentivize the user to release space? Nobody is going to pay extra for that.

I think that it can be free if we release more than 'x' bytes. or pay back the user, to create an incentive. Maybe return part of the gas to cover the costs of the current running transaction (not sure if neo-vm is compatible with this).

If we "payback" the user, if we insert "2 keys with both using 1024 bytes", the first TX would cost 2 gas, but the "update" would cost 1 gas only (if we have 50% payback).

We really want to incentive users to release space, we need to think about a good solution here, it has huge long term impacts.

@lock9 lock9 changed the title Storage.Delete must be free (Neo 3) Incentives for the user / developer to release storage Jul 18, 2019
@igormcoelho
Copy link
Contributor Author

igormcoelho commented Jul 19, 2019

Payback is nice and compatible, we just need to put a negative price per released byte. Ideally for me, sending assets to someone that already has assets, or sending all assets to anotger account, should be free, or nearly free (from sysfee perspective, but still paid from netfee perspective). Only slight byte differences in bigint representation would matter, but if reducing is much cheaper than adding, we can achieve this behavior (perhaps Delete = -2 * Put)... but these negative impacts should only affect other Storage paid stuff, not other operations, as these things may become dangerous too, and could create eternal loops xD
Put Delete 1000 loops Put Delete 1000 loops...

@lock9
Copy link
Contributor

lock9 commented Jul 23, 2019

@igormcoelho agreed. So you think paypack is feasible? In the same transaction only?

@lock9 lock9 added Design Issue state - Feature accepted but the solution requires a design before being implemented Ledger Module - The ledger is our 'database', this is used to tag changes about how we store information and removed Enhancement Type - Changes that may affect performance, usability or add new features to existing modules. labels Aug 11, 2019
@lock9 lock9 added the Feature Type: Large changes or new features label Aug 11, 2019
@shargon
Copy link
Member

shargon commented Sep 12, 2019

My proposed design:

  • Read the content.
  • Sum the bytes of the key and the value
  • Reduce this size from the cost of the current Execution.
  • Maybe this transaction will be free, but the user never will receive this GAS.

@lock9
Copy link
Contributor

lock9 commented Sep 12, 2019

@shargon should we allow a negative number in the gas consumption? I think it is the only way to make this "correctly". What do you think?

@shargon
Copy link
Member

shargon commented Sep 12, 2019

Negative means 0, no reward. You will pay less if you remove some entries.

@lock9
Copy link
Contributor

lock9 commented Sep 12, 2019

@shargon I mean during execution, the final result I understand cannot be negative

@lock9
Copy link
Contributor

lock9 commented Sep 26, 2019

Hi @neo-project/core, may I assign this issue to me?

@shargon
Copy link
Member

shargon commented Sep 26, 2019

If you want, is good for me

@lock9 lock9 self-assigned this Sep 26, 2019
@lock9
Copy link
Contributor

lock9 commented Sep 26, 2019

Thanks. I spoke with @igormcoelho he let me do it too. Thanks

@igormcoelho
Copy link
Contributor Author

No need for my approval man.. go for it! 💪

@lock9 lock9 removed their assignment Oct 28, 2020
@erikzhang erikzhang removed this from the NEO 3.0 milestone Jan 10, 2021
@mwherman2000
Copy link

mwherman2000 commented Jan 26, 2021

Purely for the historical record, here's a link to the article I wrote about storing #DumbData for free on the NEO Blockchain in June, 2018. I have no idea if this still works on the current version of NEO:
Blockchain #DumbData: Best way to safely store secure, immutable, auditable, historized, permanent data on a blockchain

Here's a link to a NEO Blockchain DumbData example (from the end of the above article).

Best regards,
Michael Herman
Self-Sovereign Blockchain Architect
Trusted Digital Web
Hyperonomy Digital Identity Lab
Parallelspace Corporation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Issue state - Feature accepted but the solution requires a design before being implemented Feature Type: Large changes or new features Ledger Module - The ledger is our 'database', this is used to tag changes about how we store information
Projects
None yet
Development

No branches or pull requests

8 participants