nanocurrency / nano-node

Nano is digital currency. Its ticker is: XNO and its currency symbol is: Ӿ
https://nano.org
BSD 3-Clause "New" or "Revised" License
3.48k stars 787 forks source link

Support Ledger Pruning #1094

Closed rkeene closed 1 year ago

rkeene commented 6 years ago

As a part of node stratification (#1092) not all nodes will need the full ledger, and a mechanism will need to be created to determine which parts of the ledger can be safely discarded on each node. This mechanism will be called pruning.

More details will be added as time goes on.

ghost commented 6 years ago

Are you also thinking of a mechanism to make pending deposits compatible with pruning?

rkeene commented 6 years ago

All mechanisms that involve pruning must not break the ledger. This includes not pruning the sending block for blocks that have no corresponding receiving block but which could in the future (i.e., we are free to locally prune sends to address 0, since there can be no receive block generated from that address).

ghost commented 6 years ago

Has the core team ever discussed the possibility of making such that the receive block is automatically generated after its send block, by making changes in the protocol?

cryptocode commented 6 years ago

@Omarino99 account holder must sign the receive block, but may not be online/cold wallet/etc

ghost commented 6 years ago

@cryptocode what I'm suggesting would be changing the protocol such that receive blocks don't require the signature of the account. I guess this has already been discussed? I know it would bring up different problems though.

ghost commented 6 years ago

@rkeene on the roadmap I find this:

Ledger Pruning allows for a much smaller database size. This is done through pruning off blocks other than the frontier (head block) +1 or 2 previous for each account. This feature is dependent on Universal Blocks as they create a snapshot of an account on a per block basis requiring fewer blocks to verify an account.

Isn't this just plain wrong? It would work only on certain accounts. Everyone who doesn't know the protocol believes that it would be possible to prune all accounts, while instead it's not possible. Link: https://developers.nano.org/roadmap/ledger-pruning/

rkeene commented 6 years ago

It can be either considered incorrect or incomplete.

Considering it incomplete is the most charitable interpretation, so we shall proceed under that interpretation. The most likely reason it is incomplete is because the author elided the detail that pending information would also be included in the ledger for simplicity or simply failed to consider this additional detail or simply thought it was implied that referable blocks could not be elided.

Ultimately the number of pending blocks are they can go down over time, so they are a very minor factor regarding ledger pruning.

I think the best thing we can do regarding this information is update the roadmap documentation to be more specific.

anarkrypto commented 6 years ago

If a spammer wants to increase the ledger, to circumvent the pruning he just needs to transact for millions of different accounts, correct?

funkspock commented 5 years ago

@kaiquenunes23 account creation and transaction creation is controlled/limited by PoW.

@rkeene Ledger pruning will prune off blocks other than the frontier (head block) +1 or 2 previous for each account. Which to my understanding [Limits history of transactions]

  1. In addition to this, will pruning take place (periodically?) for accounts below a certain threshold (dust accounts)? or like other coins require that "dust accounts" be topped first before they can be used in transactions (for example XRP requires a base reserve of 20). [Limits number of accounts]

  2. Regarding "dust transactions", will these be rate-limited or blocked below a certain threshold (can this threshold be dynamic based on network conditions)? [Limits number of transactions]

lucaslopes commented 5 years ago
  1. Why limit history of transactions is something bad? The relevance of the ledger is its current state, if someone cares about history of one or several wallets, it should be up to them decide to store it, but doesn't having it should not compromise the functionality of the protocol.

  2. Regarding pending blocks: I agree with @Omarino99 in doesn't requiring signatures in receive blocks, this could bring other implications but maybe bring better positive gains to the network. Dividing the account's chain in two (one for sends and other to receives) could solve this problem?

arranHarty123 commented 4 years ago

Should this be configurable in the node config so instead of just frontier and previous you can choose frontier + x previous blocks (x min 1).

Might give a middle ground between full history and minimal.

shamoons commented 2 years ago

Is this still something we're shooting for?

qwahzi commented 1 year ago

Closing this issue since experimental ledger pruning has been around since V22, and we have a few newer pruning related issues:

https://github.com/nanocurrency/nano-node/issues/3804

https://github.com/nanocurrency/nano-node/issues/3207

https://github.com/nanocurrency/nano-node/issues/1645