Skip to content

Staking Rewards Viewer milestone 1#232

Merged
mmagician merged 5 commits intow3f:masterfrom
jackson-harris-iii:master
Aug 13, 2021
Merged

Staking Rewards Viewer milestone 1#232
mmagician merged 5 commits intow3f:masterfrom
jackson-harris-iii:master

Conversation

@jackson-harris-iii
Copy link
Copy Markdown
Contributor

@jackson-harris-iii jackson-harris-iii commented Jul 19, 2021

Milestone Delivery Checklist

Link to the application PR: w3f/Grants-Program#429

Copy link
Copy Markdown
Contributor

@mmagician mmagician left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackson-harris-iii Thanks for the delivery. May I kindly ask you to follow the instructions outlined in the template:

Ideally all links inside the below table should include a commit hash, which will be used for testing.

Right now there's not a single link to your code and no way for us to test your deliverables.

@mmagician mmagician self-assigned this Jul 20, 2021
@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

@jackson-harris-iii Thanks for the delivery. May I kindly ask you to follow the instructions outlined in the template:

Ideally all links inside the below table should include a commit hash, which will be used for testing.

Right now there's not a single link to your code and no way for us to test your deliverables.

@mmagician I have added commit hashes to line up with the completion of each deliverable as best I could. I did read into the link/commit hashes and it mentioned you would use the main branch if none were provided. I believed that because there is a test suite, a live version of the application, and a dockerfile that those would be used to run the application and then test for the functionality. (Attempting to run the application from prior commits will result in undesired behavior across the application. So it would be best to verify all completed work from the final/most recent commit)

@mmagician
Copy link
Copy Markdown
Contributor

@jackson-harris-iii Thanks for that. I asked for detailed information as the original PR contained no link to your repo at all, so using master branch of unknown repo doesn't help much :) But detailed links speed up our testing greatly. We will check your delivery as soon as possible!

@mmagician mmagician removed the on hold label Jul 20, 2021
@mmagician mmagician removed their assignment Jul 20, 2021
@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

@jackson-harris-iii Thanks for that. I asked for detailed information as the original PR contained no link to your repo at all, so using master branch of unknown repo doesn't help much :) But detailed links speed up our testing greatly. We will check your delivery as soon as possible!

@mmagician 😅 That makes sense. I didn't realize there was nothing connecting back to the original repo at all...Thanks for the reply back. Do you have an idea of when you might get to check the submission or how often on average this portion of the process takes? ( No worries if not)

@mmagician
Copy link
Copy Markdown
Contributor

We've got quite a number of deliveries in the pipeline (see # of PRs here), so it might take a bit longer than usual - hard to say exactly.

@alxs alxs changed the title complete milestone delivery doc Staking Rewards Viewer milestone 1 Jul 20, 2021
@mmagician
Copy link
Copy Markdown
Contributor

mmagician commented Jul 21, 2021

@jackson-harris-iii I had a quick look at your delivery table and realised that the links you included point to (somewhat random?) commits themselves (e.g. the commit that you reference for license has nothing to do with the license itself). Rather, what we are after is the link to the file(s)/module(s)/component(s) where the functionality is implemented. As mentioned earlier, we don't need the commit hashes if the repo's latest state should be used for testing (e.g. rather than pointing to specific commit hash of the license you can just use master branch. While it is obvious where the license is located, it is less so for other, functional parts of your logic.

Also please include the link to your original application document as specified in the template (you might have skipped the template code there). I know these might seem like trivial technicalities, but the milestone deliveries are not always evaluated by the grants team who are familiar with the process, but rather are sometimes be done by other community members.

@alxs
Copy link
Copy Markdown
Contributor

alxs commented Jul 21, 2021

@jackson-harris-iii I just added the link to the application document myself. Please fix the deliverable links (feel free to have a look at other deliveries to see what we mean) and we'll get back to you with more feedback.

@mmagician mmagician requested a review from jonasW3F July 22, 2021 09:30
@jonasW3F
Copy link
Copy Markdown

jonasW3F commented Jul 22, 2021

I was trying the front end with some random Polkadot addresses and there seem to be some issues here:

Screenshot from 2021-07-22 11-21-11

It would also be cool to add some tooltips to the user inputs. Especially the "start balance" requires some explanation. It is also important to tell the user that this is an optional input. We should make it possible to leave the field open and then indicate in the output that the APY could not be calculated.

Copy link
Copy Markdown

@jonasW3F jonasW3F left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @jackson-harris-iii
Thank you very much for your implementation of the UI. Generally, it looks quite good but there are a few things that I noticed during testing (Brave Browser):

  • The information button next to "Get Staking Data" is misaligned and still has a placeholder text.
  • It is possible to enter an EndDate that is before the StartDate and the output simply says “No results found” but it should give the hint that the StartDate must be before the EndDate.
  • Please add tooltips on the StartDate, EndDate and especially on the startBalance. Let me add another comment that I already posted in the PR: It is also important to tell the user that this is an optional input. We should make it possible to leave the field open and then indicate in the output that the APY could not be calculated.
  • The output text is missing the token ticker “DOT” and “KSM” after the balances. Also, please add the note that the fiat value is weighted by daily prices.
  • The “EndBalance” in the output is empty.
  • The output table for the individual payouts does not work properly. For example, the first page for “rows per page =5” is empty, when you click on the right arrow it shows you 3 rows.
  • The export for the .csv file produces a weird file name without the .csv extension.

Let me know if you have any questions.

Cheers
Jonas

@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

Hey @jonasW3F thank you for the detailed feedback. Many of the items I can begin work on and will submit an update on those as they are completed, but there are a few requests that I have questions about.

  1. The information button next to "Get Staking Data" is misaligned and still has a placeholder text.
  • Could you please provide what placeholder text you would like here, as well as text for any other placeholders.
  1. Please add tooltips on the StartDate, EndDate and especially on the startBalance. Let me add another comment that I already posted in the PR: It is also important to tell the user that this is an optional input. We should make it possible to leave the field open and then indicate in the output that the APY could not be calculated.
  • I'll add optional as placeholder text in the optional fields.
  1. The output text is missing the token ticker “DOT” and “KSM” after the balances. Also, please add the note that the fiat value is weighted by daily prices.
  • how might this best be accomplished, a tooltip? If so could you provide some copy or words to use here that would best give the user clarity on its purpose
  1. The output table for the individual payouts does not work properly. For example, the first page for “rows per page =5” is empty, when you click on the right arrow it shows you 3 rows.
  • would it be possible for you to provide the details that caused this bug? I have an idea, but tracking the issue down would be best if I were able to recreate it.

@jonasW3F
Copy link
Copy Markdown

  1. The information button next to "Get Staking Data" is misaligned and still has a placeholder text.
  • Could you please provide what placeholder text you would like here, as well as text for any other placeholders.
  • Please make suggestions for the placeholders and we'll check them then.
  1. Please add tooltips on the StartDate, EndDate and especially on the startBalance. Let me add another comment that I already posted in the PR: It is also important to tell the user that this is an optional input. We should make it possible to leave the field open and then indicate in the output that the APY could not be calculated.
  • I'll add optional as placeholder text in the optional fields.
  • Yes, as stated before, please make suggestions for the placeholder texts. Generally, it should give the user an explanation of what they are seeing or what a variable does.
  1. The output text is missing the token ticker “DOT” and “KSM” after the balances. Also, please add the note that the fiat value is weighted by daily prices.
  • how might this best be accomplished, a tooltip? If so could you provide some copy or words to use here that would best give the user clarity on its purpose
  • You don't need a tooltip for this. For example, the current output reads The sum of staking rewards are 79120.94426088687 and 0, which sums up to a total of $1171590.78 USD which should be The sum of staking rewards are 79120.94426088687 DOT and 0 KSM, which sums up to a total of $1171590.78 USD (weighted by daily prices)
  1. The output table for the individual payouts does not work properly. For example, the first page for “rows per page =5” is empty, when you click on the right arrow it shows you 3 rows.
  • would it be possible for you to provide the details that caused this bug? I have an idea, but tracking the issue down would be best if I were able to recreate it.

The following screenshots show you the issue.
At first, it looks like this:
Screenshot from 2021-07-23 09-51-28
and after clicking on the right arrow once it looks like this:
Screenshot from 2021-07-23 09-51-49

I guess the second picture should have 5 rows and should be displayed from the beginning, before clicking on the right arrow.

  • Please also change 'polkadot' to 'Polkadot' in the outputs.

@mmagician
Copy link
Copy Markdown
Contributor

@jackson-harris-iii Any updates yet?

@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

@jonasW3F I've gone ahead and addressed the following requests (should be all of the ones you've previously mentioned) These changes are merged to main and awaiting review.

  • added note that fiat value is weighted by daily prices
  • include token ticker after balances
  • "Could not calculate message" added to APY section
  • Fixed missing end balance
  • added "optional" as place holder text for start balance
  • replaced default download filename and added extension
  • capitalized network names
  • does not allow start date that is before an end date
  • modified tooltip alignment and removed placeholder text
  • created additional tooltips
  • start balance tooltip
  • start date tooltip
  • end date tooltip

@jonasW3F
Copy link
Copy Markdown

jonasW3F commented Aug 4, 2021

Hi @jackson-harris-iii

Thank you very much for the adjustments. I did a quick test and found the following issues (for some random addresses, CaRYnYy5JVW248MhNXxLb9NDaX7BWNE32vJfJKtQYY2bnqc and G7PXpsAvSjaYFMjQ3oPTyKUV4kh7eD3oTnNd9eDSMBscSZH):

  • If loading the page for the first time, the currency in the graph "DOT Price" is missing. Once you change currency (and change it back to USD) it shows the currency.
  • EndBalances were still missing for all outputs.
  • In the case balances were found but no startBalance was provided it still shows NaN% for the APY.
  • For three addresses the output boxes are not properly displayed (see picture).
    Screenshot from 2021-08-04 14-04-41

And why are input addresses restricted to three (btw. the tooltip says "two")? If you change the way the output boxes for the individual outputs are ordered, you might fix the display issue and also be able to increase the number of input addresses. I think a reasonable number would be 10-15 or so.

Cheers
Jonas

@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

Hey @jonasW3F,

I have changed the total number of addresses to 5, it was set at 2 for both UI purposes as well as ensuring a quicker response time, I was unsure if having many addresses (especially over a long duration of time) would be a lot of load on a 100% client side application. I attempted with 4 addresses and had similar load times to one address so up to 5 shouldn't be a problem and the UI has been adjusted slightly as well to accommodate the additional input fields.

(Beyond 5 addresses there are some performance issues that have to do with node code being ran in the browser. Not a problem, but in order to go beyond 5 would require an overhaul using web assembly and another language.)

  • The Dot price now shows on page load.
  • The end balance issue has been resolved as well as the NaN (both were related to no start balance).
  • The UI has also been adjusted to better accommodate multiple address result cards.

@jonasW3F
Copy link
Copy Markdown

jonasW3F commented Aug 6, 2021

Hey @jonasW3F,

I have changed the total number of addresses to 5, it was set at 2 for both UI purposes as well as ensuring a quicker response time, I was unsure if having many addresses (especially over a long duration of time) would be a lot of load on a 100% client side application. I attempted with 4 addresses and had similar load times to one address so up to 5 shouldn't be a problem and the UI has been adjusted slightly as well to accommodate the additional input fields.

(Beyond 5 addresses there are some performance issues that have to do with node code being ran in the browser. Not a problem, but in order to go beyond 5 would require an overhaul using web assembly and another language.)

  • The Dot price now shows on page load.
  • The end balance issue has been resolved as well as the NaN (both were related to no start balance).
  • The UI has also been adjusted to better accommodate multiple address result cards.

Hi @jackson-harris-iii

Thank you very much for your delivery. The ordering of the output addresses now looks good. I only have 2 minor details:

  • Change "could not calculate" to "could not be calculated" for the APY
  • Round the fiat value in the summary.

Aside from that, I think things are fine. Thanks again.
Cheers
Jonas

@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

Hey @jonasW3F,
I have changed the total number of addresses to 5, it was set at 2 for both UI purposes as well as ensuring a quicker response time, I was unsure if having many addresses (especially over a long duration of time) would be a lot of load on a 100% client side application. I attempted with 4 addresses and had similar load times to one address so up to 5 shouldn't be a problem and the UI has been adjusted slightly as well to accommodate the additional input fields.
(Beyond 5 addresses there are some performance issues that have to do with node code being ran in the browser. Not a problem, but in order to go beyond 5 would require an overhaul using web assembly and another language.)

  • The Dot price now shows on page load.
  • The end balance issue has been resolved as well as the NaN (both were related to no start balance).
  • The UI has also been adjusted to better accommodate multiple address result cards.

Hi @jackson-harris-iii

Thank you very much for your delivery. The ordering of the output addresses now looks good. I only have 2 minor details:

  • Change "could not calculate" to "could not be calculated" for the APY
  • Round the fiat value in the summary.

Aside from that, I think things are fine. Thanks again.
Cheers
Jonas

Hey @jonasW3F,

I went ahead and modified the APY message as well as added rounding to the Fiat Values in the summary. If that is everything what are the next steps in the process?

Thanks,
Jackson

@mmagician
Copy link
Copy Markdown
Contributor

@jonasW3F - thanks for your time to help out with the milestone review.
@jackson-harris-iii Thanks for following his guidance. As the next step, I'm going to double check whether all deliverables are met as per the original application and if so, submit my evaluation and merge this PR. I'll try to get back to you ASAP.

@mmagician
Copy link
Copy Markdown
Contributor

As a final note before accepting your milestone: please review the points outlined in the issue I opened in your repo.

Many thanks!

@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

jackson-harris-iii commented Aug 12, 2021

As a final note before accepting your milestone: please review the points outlined in the issue I opened in your repo.

Many thanks!

@mmagician The links have been removed and the issue has been closed. Should be good to go!

@mmagician
Copy link
Copy Markdown
Contributor

@jackson-harris-iii Congratulations, I've accepted your delivery. See my full evaluation here. Feel free to keep improving the tool further.

@mmagician mmagician merged commit b86c5a3 into w3f:master Aug 13, 2021
@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

@jackson-harris-iii Congratulations, I've accepted your delivery. See my full evaluation here. Feel free to keep improving the tool further.

@mmagician thank you for accepting the milestone and leaving such actionable feedback.

  • Adjustments to ensure the font is the same across all devices will be implemented. The site uses the Work Sans Font consistent with the Polkadot website, but seems to be reverting to the browser default in some instances.

  • As for the 1 month time frame that was an oversight and will be fixed shortly.

  • Lastly you are correct about the performance aspects with respect to the address limit. I have plans to rewrite all of the original staking collector code in Rust to compile to web assembly to increase performance.

This will increase performance without sacrificing the ability for this application to work purely in the client side which was necessary to makes it 100% deployable and operational to ipfs without the need for a server.

Jackson

@mmagician
Copy link
Copy Markdown
Contributor

Hmm, as far as I'm aware it's not the staking collector code that's slow, but rather the fact that the response from the node is slow...I don't think you would solve the problem by re-writing the logic in Rust. If you want to optimise performance, it would rather be running another RPC archive node and querying that one instead. If you want to be fancy, you could even include some basic auth that only enables your application to access the node's ports, i.e. there's no extra load on the node, but that's probably an overkill.
(even so, a private archive node will likely not speed it up by 10x :) - since the fetching of the data from blocks itself is a slow operation - and without an external DB can't really be overcome, AFAIK)

@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

@jonasW3F Hey, I wanted to reach out to you and see if you're open to finding some time to chat about the future of this tool.

  • Getting it to those who would need it most
  • Coming up with improvements, additions, etc.

If so what's the best way to chat and connect?

@mmagician
Copy link
Copy Markdown
Contributor

@jackson-harris-iii Thanks for connecting again. As far as I'm aware, he's off on holidays right now. I'll ping him once he's back!

@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

@jackson-harris-iii Thanks for connecting again. As far as I'm aware, he's off on holidays right now. I'll ping him once he's back!

@mmagician awesome! Thanks for getting back to me, how long might he be gone for, just so I have an idea of when to be in the look out for something. Also, Quick question, what is the typical turn around time for the grant disbursement?

@mmagician
Copy link
Copy Markdown
Contributor

@jackson-harris-iii I'm not sure about his time off, will let you know once he's back.
Your invoice has been submitted after the milestone approval, but it might sometimes take a week or two before payment. I'll double check it for you.

@jonasW3F
Copy link
Copy Markdown

Hi @jackson-harris-iii
Feel free to write me on element matrix: @jonas:web3.foundation

@jonasW3F
Copy link
Copy Markdown

jonasW3F commented Sep 1, 2021

Btw, it seems the service has some issues, it does not find any rewards for addresses that I find rewards for with my script. Could you check, @jackson-harris-iii ?

@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

Btw, it seems the service has some issues, it does not find any rewards for addresses that I find rewards for with my script. Could you check, @jackson-harris-iii ?

Interesting, can you provide the parameters that you're providing to the tool and I can take a look.

@jackson-harris-iii
Copy link
Copy Markdown
Contributor Author

@jackson-harris-iii I'm not sure about his time off, will let you know once he's back.

Your invoice has been submitted after the milestone approval, but it might sometimes take a week or two before payment. I'll double check it for you.

Checking in on an update for this.

@jonasW3F
Copy link
Copy Markdown

There was an issue with Subscan's Kusama API which has been resolved now. Still, it seems the front end does not show any rewards for either Polkadot or Kusama addresses.

@RouvenP
Copy link
Copy Markdown

RouvenP commented Sep 23, 2021

hi @jackson-harris-iii: we transferred the payment today. Apologies for the delay!

@w3f w3f deleted a comment from RouvenP Sep 23, 2021
failfmi pushed a commit to LimeChain/Grant-Milestone-Delivery that referenced this pull request Sep 26, 2022
* Create pallet_maci.md

* Update pallet_maci.md

* Update pallet_maci.md

* Update pallet_maci.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants