Earnings calculator (Update 2024-04-14: v13.4.0 - Additional info on uncollected garbage and unpaid data - Detailed earnings info and health status of your node, including vetting progress)

will probably be the new north-east-1? just a guess.

https://forum.storj.io/t/new-tardigrade-satellite

Edit: Mean europe-north-1 sorry

europe-north-1 it looks like. Iā€™ll add the name in the next release. Unfortunately I still have to add them manually.

Grep or query names from www dashboard

Yeah, Iā€™m definitely not going to do that. That would mean users would also have to deal with telling the calculator the ip/domain and port for the web dashboard. Sats are added rarely enough, that itā€™s a super easy manual fix. Preferably Iā€™d pull the name from one of the databases, but as of now none seem to store the satellite name. Anyway, here you go. New version is up on github linked in the top post.

Changelog

v8.2.1 - Added europe-north-1 satellite

  • Added europe-north-1 satellite
6 Likes

Development update

Usually when a new node version drops, I take a look at the new goodies, implement new features and the first thing you hear from me is an update with a changelog. This time, Iā€™m a little bit at a loss as to what direction to take.

New data available

The 1.3.3 update adds an important table with new information, called paystubs. This table is filled by the satellite at the moment that payouts go out. It contains information regarding the payout calculation like at rest storage, ingress, egress, held back amounts, payouts of that held back amount, surge percentage and other stuff. This data is used by the web dashboard to show payout information for previous months.

So that sounds great, right?

Itā€™s very good to have this new information available. There is some stuff in there that is currently missing from the earnings calculator, like surge percentage, held back amount totals and payout of that held back amount. Additionally the number of paystubs shows exactly how many months your node has existed, so there is no longer a requirement for the less accurate first contact variable. Based on that output can be cleaned up to only show the correct held back percentage instead of all of them, held back amount can be added to the list at the top and included in totals calculation.

So whatā€™s the problem?

The problem is that this table is missing data until the payouts for the previous month are done. This is why youā€™re seeing no data for April on the web dashboard right now. Itā€™s also why my dashboard claims Iā€™m in month 14 for stefan-bentenā€™s satellite, while Iā€™m actually in month 15. So all this great new information is basically incorrect/incomplete for half of the month.

Dilemma

Iā€™m a bit at a loss on what to do. The earnings calculator has always based previous months information based on actual usage tracked by the node itself. This new table has a lot of that same information, but based on the paystub calculated by the satellite. I personally like the idea of keeping the earnings calculator based on the nodes local data, so it can function as a sort of check on the satellites calculations. But I would like to hear your input on this.
Additionally I was planning on redesigning the output of the payout and held back break down per satellite, based on the exact number of months that had passed.
Something like this:

SATELLITE       HELD TOTAL  MONTH   HELD%   EARNED       HELD         PAID        SURGE%
us-central-1    14.20 USD   8       25%     0.0164 USD   0.0041 USD   0.0123 USD  100%    
Status:OK (Audit score:1000)

But since that month number seems to be unreliable as well, Iā€™m back in the same boat not being sure what month your node is actually in on each satellite, which makes the rest of the calculation impossible. Additionally surge % only becomes known when the paystub data is filled as well. (It doesnā€™t help that the table has 250 when the surge payout was 250%, but 0 when there is no surge, which means just a normal 100% payout, but I can work around that part.)

Feedback

Iā€™d love to hear specifically your feedback on the following questions:

  • Do you think the earnings calculator should display previous months earnings based on paystub data like the web dashboard does or actual node accounting to function as a sort of check on the satellite calculation?
  • Would you rather I implement the new interface as suggested, knowing that for half of the month it may display the held back percentage for the wrong month or stick with the current setup?

Iā€™m gonna sleep on it for a while. This update will take a little longer than youā€™re used to as a result of this dilemma. Luckily the current version still works just fine after the update. Youā€™ll just have to wait a bit for the new goodies.

2 Likes

I think it is a valuable tool to get an earnings estimation from the data that the storagenode itself gathered and not use the paystub data.

Of course you could make it a comparison tool that also reads the paystub and then compares if the results are equal :smiley: If you have too much timeā€¦ (or fun).

If there was no payout in paystub for the last month but first contact was not within the last month, then you can assume that the node is one month older than first contact. If there was a payout, then the age is from first contact to the month queried.
Did that explanation make any sense to you?

What a difference a good night sleep makes. I found a solution to the node age problem and was able to implement everything I wanted to. The solution is similar to what @kevink suggested, so thanks for thinking with me there! There is lots of new stuff and Iā€™ve changed quite a bit of code. Please let me know if you run into any issues.

image

image

image

Changelog

v9.0.0 - Surge, held amount, redesign sat breakdown

  • Requires storagenode version 1.3.3 (Data will be incorrect on older versions)
  • Requires heldamount.db, if you copy dbā€™s prior to running the script, this one needs to be included now
  • Added surge payout information
  • Added held amount totals so far
  • Accurate display of month number for your node on each sat
  • Redesigned breakdown per satellite
  • Display only relevant held back % and amount and paid amount
  • Added totals for satellite breakdown
6 Likes

:+1: :+1: :+1: :+1: :+1:
thank you for your job well done

1 Like

When you change a lot of codeā€¦ sometimes you break things. Quick bugfix release.

Changelog

v9.0.1 - Fix disk current

  • Previous version introduced a miscalculation of current disk usage. This version fixes it.
5 Likes

9.0.1 looks great! Thanks for the update!

1 Like

Looks great! I agree with @kevink btw. This is a valuable tool if you use the data that the storagenode gathered for the estimation. In this way we can verify storj if the payments are correct. (do not trust, verify :wink: )

Anyway, I see the info if the satellite is OK or is being vetted / DQ is gone?

1 Like

Itā€™s not. There is no historic information for that, so it has always only been displayed when youā€™re looking at the current month like in the first screenshot. Since the surge information is by definition only available after payout, so never for the current month, I used that second line to display surge information for historic months if applicable.

1 Like

Minor bugfix. The surge payout line was not displayed in the top overview for months prior to 2019-09.

Changelog

v9.0.2 - Fix surge payout prior 2019-09

  • Bugfix: Surge payout was not displayed for months with missing disk usage stats (prior to 2019-09)
2 Likes

@BrightSilence - I have 9.0.2 and v1.3.3 running

I see the following

Specifically the 13 month and 12 month on a couple of the satellites ā€¦ the oldest one I have is from Aug 19 so could not possibly be 12/13 months - Iā€™d love it if it was but something seems wrong to me
Hereā€™s a grab of the same node on the 30th April

Am I missing something here?

Thanks for the feedback, Iā€™d love to look into whatā€™s going on there. But I canā€™t really without being able to look at your heldamount.db. The numbers for my node seem to be correct, but I have only one node to test on. Would you mind sending me your heldamount.db file? (In a private message)

I donā€™t want you to share anything youā€™re not comfortable with though, so for your information, this db contains one empty table and a paystubs table with the following information on all previous payouts.

CREATE TABLE IF NOT EXISTS ā€œpaystubsā€ (
ā€œperiodā€ text NOT NULL,
ā€œsatellite_idā€ bytea NOT NULL,
ā€œcreated_atā€ timestamp NOT NULL,
ā€œcodesā€ text NOT NULL,
ā€œusage_at_restā€ double precision NOT NULL,
ā€œusage_getā€ bigint NOT NULL,
ā€œusage_putā€ bigint NOT NULL,
ā€œusage_get_repairā€ bigint NOT NULL,
ā€œusage_put_repairā€ bigint NOT NULL,
ā€œusage_get_auditā€ bigint NOT NULL,
ā€œcomp_at_restā€ bigint NOT NULL,
ā€œcomp_getā€ bigint NOT NULL,
ā€œcomp_putā€ bigint NOT NULL,
ā€œcomp_get_repairā€ bigint NOT NULL,
ā€œcomp_put_repairā€ bigint NOT NULL,
ā€œcomp_get_auditā€ bigint NOT NULL,
ā€œsurge_percentā€ bigint NOT NULL,
ā€œheldā€ bigint NOT NULL,
ā€œowedā€ bigint NOT NULL,
ā€œdisposedā€ bigint NOT NULL,
ā€œpaidā€ bigint NOT NULL,
PRIMARY KEY(ā€œperiodā€,ā€œsatellite_idā€)
);

As you can see there is no personal identifiable information in there, but if you consider bandwidth usage numbers, disk usage numbers and corresponding payouts and held amount private. Please donā€™t share this with me. Unfortunately without the db it will be hard for me to debug.

This appeared just once :

TOTAL 7.24 USD 0.3912 USD 0.1956 USD 0.1955 USD
SURGE (100%) 0.3912 USD 0.1956 USD 0.1955 USD

I guess someone applied surge to May instead of April (lol)

Thanks for the feedback. I saw that once too. I think itā€™s a rounding error in calculation. For the totals I compare total incl surge to total without surge to determine whether surge is applied. This is mostly to account for the possibility of some satellites having surge, but others not. Iā€™ll add in a small margin to prevent these rounding errors from happening in the next version.

Edit: Actually, going to use a better method that doesnā€™t need a margin.

Nope, as you can see the numbers are actually the same and it says 100%(meaning no more than normal). So the calculation ends up with the exact same amounts as pre-surge. Thatā€™s because the rounding error is way more decimal points beyond what is actually displayed.

And thanks for the new version too.

I have a new version waiting with more new features and this fix. Still working out the last details and testing. But hereā€™s a sneak preview.


This version will now calculate the correct held back amount, also taking into account amounts that have been paid back in the past. It will also show additional lines for held amount paid back due to either graceful exit or the month 15 return of half the held back amount. Thanks @kevink for sharing his db with graceful exit data, so I could incorporate these options! My node never received any returned amount so far, so I needed a bit of outside help.

I still want to look into @punyelrooā€™s issue though. I just received the db but with incomplete info. My bad, I should have specified to stop the node prior to copying the db. Just waiting on that and hoping to release this new version today or tomorrow.

2 Likes

I get the following error when running the script (Linux with storj in docker):

python earnings.py /share/external/DEV0201_1/data/storage
Traceback (most recent call last):
File ā€œearnings.pyā€, line 225, in
con.execute(ā€˜ATTACH DATABASE ? AS su;ā€™,tSU)
sqlite3.OperationalError: file is encrypted or is not a database

Do I need python 3 or something? I tried python 2.7.5 so far