AleoNet / snarkOS

A Decentralized Operating System for ZK Applications
http://snarkos.org
Apache License 2.0
4.24k stars 2.59k forks source link

Add get_delegators_for_validator #3219

Closed vicsn closed 2 months ago

vicsn commented 3 months ago

Motivation

Adds an endpoint to get all delegators for a particular validator.

Test Plan

See the sister PR: https://github.com/AleoHQ/snarkVM/pull/2434

iamalwaysuncomfortable commented 3 months ago

This is awaiting a benchmark. We will perform this soon.

howardwu commented 2 months ago

What's the status on this PR? I see failing CIs across the board and no benchmarks.

vicsn commented 2 months ago

Thx for pushing on this. Looks like a valid DoS vector if someone exposes their endpoints.

I think its likely other REST endpoints (e.g. GET /<network>/block/{height}/transactions and GET /<network>/blocks?) would cause similar performance issues. If you agree, it might be good to tackle defenses which apply across multiple REST endpoints in a separate PR so its easier to review.

Or perhaps our recommendation should be for clients with a public endpoint to have a very low general rate limit. Infura doesn't let you query geth directly either.