solana-labs / solana

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://solanalabs.com
Apache License 2.0
13.02k stars 4.19k forks source link

[storage mining] storage contract needs to give out tokens #2203

Closed sakridge closed 5 years ago

sakridge commented 5 years ago

Problem

Validators/replicators involved in storage mining need to get paid

Proposed Solution

Storage program will accept a new ClaimStorageReward transaction which will do some checks and then give the storage reward at the change of the new storage epoch to any submitted claims.

sakridge commented 5 years ago

With https://github.com/solana-labs/solana/pull/2154 the validator gets some tokens, but not the replicator.

https://github.com/solana-labs/solana/blob/2c9607d5da8f01e18a1574a4be4209906b5ee9f2/programs/native/storage/src/lib.rs#L164

It tries to count up the valid proofs from a given epoch and give the reward, but may not be 100% correct.

ericlwilliams commented 5 years ago

@sakridge in the current design we've discussed validators rewarded with the pooled PoRep transaction fees in proportion to the # of successful PoReps less the number of invalidated PoReps (or some function). Does the proposed solution allow this type of distribution? BTW - on the replicator end, we're thinking a per successful PoRep reward, delivered via mining pool, that is a function of total network ledger redundancy

sakridge commented 5 years ago

@ericlwilliams yea we can do that. My plan was just to do something like a fixed payout per storage epoch with generated tokens initially. Then we can accumulate the transaction fees for payout later in a second change if that's the required design.