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

Allowlist with specified rate limits #156

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

ian-shim
Copy link
Contributor

@ian-shim ian-shim commented Jan 5, 2024

Why are these changes needed?

Removes allowlist added in #122 in favor of one that specifies rate limits for each allowlisted IP.

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(


// Get the encoded blob size from the blob header. Calculation is done in a way that nodes can replicate
blobSize := len(blob.Data)
length := core.GetBlobLength(uint(blobSize))
encodedLength := core.GetEncodedBlobLength(length, uint8(blob.RequestHeader.SecurityParams[param.QuorumID].QuorumThreshold), uint8(blob.RequestHeader.SecurityParams[param.QuorumID].AdversaryThreshold))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there's no guarantee that the security params are ordered by the quorum ID

@ian-shim ian-shim requested a review from mooselumph January 5, 2024 16:20
@ian-shim ian-shim marked this pull request as ready for review January 5, 2024 16:20
Copy link
Collaborator

@mooselumph mooselumph left a comment

Choose a reason for hiding this comment

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

Looks good!

Thanks for adding the tests to the server. I'll probably move some of the manual ratelimit tests that I put in the inabox folder to run in the server so that they can be part of the unit test coverage.

disperser/apiserver/server_test.go Show resolved Hide resolved
disperser/apiserver/server_test.go Show resolved Hide resolved
@ian-shim ian-shim force-pushed the allowlist-specify-throughput branch from 1dcbfeb to b50a7d3 Compare January 8, 2024 16:13
@ian-shim ian-shim merged commit e5165a3 into Layr-Labs:master Jan 8, 2024
4 checks passed
@ian-shim ian-shim changed the title Allowlist with specified rate limits [EGDA-1] Allowlist with specified rate limits Jan 12, 2024
@ian-shim ian-shim changed the title [EGDA-1] Allowlist with specified rate limits Allowlist with specified rate limits Jan 12, 2024
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.

2 participants