Add new HTTP endpoint to get supply for a given state root#7102
Add new HTTP endpoint to get supply for a given state root#7102alecalve wants to merge 23 commits intosigp:unstablefrom
Conversation
a0bcc5f to
2ceb554
Compare
|
Looks like this needs a sneaky |
macladson
left a comment
There was a problem hiding this comment.
Thanks for the PR! This will be a neat endpoint to have. Just a couple of minor things
|
For Markdown linting, I took the liberty of moving the check earlier in the test process as it's fast to run. In this MR, the suite failed nearly 15mins into testing when it could have failed much earlier. |
Nice, that's a good change! |
|
@macladson I have no idea why the windows release tests failed, are they known to be flaky or could my changes somehow be the cause? |
Not sure what happened but I retriggered the tests and it has passed now, must've just been flaky |
|
Hi @alecalve thanks for all your work so far! I was wondering if you'd be up for writing a test case for this endpoint? If not, I can go ahead and push up a test case myself. Thanks! |
I'll give it a try! |
|
@alecalve this looks great! There are two small lint issues that are blocking CI. If you run |
|
I wasn't aware of this final step of linting, I only ran |
|
Some required checks have failed. Could you please take a look @alecalve? 🙏 |
|
Some required checks have failed. Could you please take a look @alecalve? 🙏 |
|
Hi @alecalve, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time. |
|
Some required checks have failed. Could you please take a look @alecalve? 🙏 |
|
After reviewing the PR we would rather not have to mantain another endpoint if downstream consumers can compute it locally from JSON with a line of |
Issue Addressed
Computing how much ETH is on the Consensus layer requires currently querying
/eth/v1/beacon/states/{state_id}/validator_balancesand summing up all balances of all validators.That data is 68MB of JSON which has to be downloaded and processed.
Proposed Changes
This PR instead adds a simple enpoint where the computation is done at the node level, the returned data is therefore minimal.