Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pagination to the Gitcoin Grants API #8868

Closed
2 tasks done
frankchen07 opened this issue May 7, 2021 · 3 comments · Fixed by #8883
Closed
2 tasks done

add pagination to the Gitcoin Grants API #8868

frankchen07 opened this issue May 7, 2021 · 3 comments · Fixed by #8883

Comments

@frankchen07
Copy link
Contributor

frankchen07 commented May 7, 2021

Circumstance

So we wanted to finally start properly using the api you implemented here: #6493
It's for our gitcoin grant support in rotki: rotki/rotki#692

Unfortunately the grant query seem to raise a 504 after some time: https://gitcoin.co/api/v0.1/grants/report_real/?eth_address=0x9531C059098e3d194fF87FebB587aB07B30B1306

What is the actual API endpoint? It's probably we are missing the api endpoint that would return all contribution details for an address and the one for all the contributions a grant has received.

===

Was checking, seems with less data works https://gitcoin.co/api/v0.1/grants/report_real/?eth_address=0xeDa95eD3e3436C689376889F9eD0a8f4bA23E866&format=json but the endpoint is missing some pagination logic and for some reason is not very performant, we will need to invest some time on this and do it better. As your address probably has a lot of data the request is failing.

===

What we need is to have an endpoint to query grant history as per the linked issue. The user case is: A user is a grant owner and wants to get all of the data of each donation in each round made to them by both on-chain transactions and zksync. Net donations (without the gitcoin %).

Description

  • add appropriate API endpoints / restructure API as needed
  • add pagination so we don't query a shit-ton of data at once and have a timing out issue
@yabirgb
Copy link

yabirgb commented May 15, 2021

If it helps I believe one big bottleneck could be how Django and Django REST makes and process the queries. It has been a lot of time since I last used django but using something like select_related could improve a lot the queries.

For more info: https://levelup.gitconnected.com/dealing-with-the-n-1-problem-optimising-django-part-4-f02010c7931d

@LefterisJP
Copy link

Both yabir and I work in rotki so we would love to see this solved. Let us know if there is any way we can help push this forward.

@frankchen07 frankchen07 changed the title Add pagination to the Gitcoin Grants API add pagination to the Gitcoin Grants API May 19, 2021
@frankchen07 frankchen07 removed this from the GPG [2021.04.28 - 2021.05.12] milestone May 19, 2021
@frankchen07 frankchen07 moved this from To do to In progress in Gitcoin Product Group (GPG) May 27, 2021
@thelostone-mc thelostone-mc moved this from In progress to Verifiable in Gitcoin Product Group (GPG) May 31, 2021
@thelostone-mc thelostone-mc moved this from Verifiable to Done in Gitcoin Product Group (GPG) May 31, 2021
@gdixon gdixon added this to Done in Grants Round 10 Jun 2, 2021
@yabirgb
Copy link

yabirgb commented Jun 6, 2021

Hello @thelostone-mc Is this deployed? By querying the API it doesn't seem so. Could you give me an expected date for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants