You are viewing a single comment's thread from:

RE: @tipU Investors Update 11.02.2019: STEEM POWER Inflation, Curation Rewards Distribution

in #steem5 years ago

From now on @tipU will take this small growth into account and update your delegation every 30 seconds in the database.

Why doesn't @tipu just use vests to calculate stake instead of SP? Then, you can go off the ubiquitous value instead of passing around and persisting the converted value.

Sort:  

Because most users don't know what vests are - they delegate Steem Power so they would like to see that.

That doesn't change things. Use time as an example. Most people only know their timezones. Some places have DST. Some do not. We can't store D/T in all formats, so what we do is store/persist the ubiquitous value (UTC), and handle conversion on-on-the-fly through a formatter (date-time-formatters are pretty prevalent). Seems like the best thing to do in this situation would be to just use VESTS universally and use a formatter to show people the value they care about.

Well, converting to SP is really not a problem.

Exactly. It's an easy thing to do. Why schedule it every 30 seconds? Why not just convert at the time you use it? At the time you need to determine someone's delegation. Fetch the vests. Then, convert to the amount of SP it represents. Also, at the time you need to report SP information back to users, the same occurs. There's no real reason not to. However, scheduling a task to handle the conversion and persist it every 30 seconds does the following

  1. Creates a latency on the accuracy of the conversion
  2. Makes data brittle because it has a half life
  3. Doesn't store the original data making it less credible

Seems that you are unaware that vests -> SP conversion rate is changing every block (3 seconds). Basically vests translates to more SP over time.

But since I'm already updating some values in the database automatically every 30 seconds, I've figured out it would be nice to also distribute curation reward every 30 seconds. In other words every investor's profit balance will slightly increase every 30 seconds, even if no new vote requests payments are coming.

That's not where 30 seconds comes from. You don't seem to be following me at all. This is just good programming practice. It has nothing to do with steem. It could be any software that @tipu is operating against. @tipu is what we're discussing.

You're right though. I should take into account the block update. Taking into account block update (every 3 seconds), this means that that conversion values persisted will only actually be good for 3 seconds. Which also means that only conversion values read within 3 seconds of the conversion being persisted will actually be accurate. That's the best case scenario (values are persisted nearly on or right after a block update). It's possible conversion values persisted just before (maybe 1 second) a block update. This would cause persisted conversion values to only be good for one second which would be your worst case scenario. IMHO, those are ideal conditions for on-the-fly conversion. Instead of persisting it.

But since I'm already updating some values in the database automatically every 30 seconds

Now that I reread this, it seems other values are affecting things as well. Updating values every 30 seconds turns records/documents/whatever into index entries because they can only live for 30 seconds. I think it's a good idea not to do this. Instead of updating the values every 30 seconds, store original values.

Thank you for your feedback but there are other reasons to update those values. For example I will be able to present them to the users and everyone likes to watch his investment grow in (almost) real time :)

Just trying to be helpful here. I assure you, you can get actual real-time, protect data from half-life, and reduce the number of extra tasks your app is doing by converting on-the-fly. It can be as easy as adding a decorator to your models that include VESTS which includes a formatter/converter. This way, you can get both values and be real-time accurate.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 61674.06
ETH 3067.94
USDT 1.00
SBD 3.81