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

fix(disperser-client): RetrieveBlob grpc max size regression bug #849

Merged

Conversation

samlaf
Copy link
Contributor

@samlaf samlaf commented Oct 30, 2024

A previous commit 6894828 (#826) caused regression by forgetting to set grpc max msg size in retrieveBlob call

Caught by integration test from eigenda-proxy: https://github.com/Layr-Labs/eigenda-proxy/actions/runs/11584563970/job/32251942842?pr=196

Added unit-test here to catch any future regression on this feature. Also made that connection size a parameter of the disperser-client (keeps the default 100MiB that was previously set).

Why are these changes needed?

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.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@samlaf samlaf changed the title fix(disperser-client): RetrieveBlob max size regression bug fix(disperser-client): RetrieveBlob grpc max size regression bug Oct 30, 2024
api/clients/disperser_client.go Show resolved Hide resolved
@@ -38,7 +46,7 @@ func NewConfig(hostname, port string, timeout time.Duration, useSecureGrpcFlag b
}
}

type DisperserClient interface {
type IDisperserClient interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we use this convention, this looks solidity

what do you think @ian-shim

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know, I don't like it either, but we already use this for eigenda_client, so I just followed the convention there.
Was forced to make the disperserClient struct public for the tests, so had to find another name for the interface. More golangy might be DisperserClienter. Honestly I think defining the interface here is code smell and should eventually all be refactored. Interfaces should be defined case-by-case at the call sites.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, saw it. we used IEigenDAClient.

Looks fine to me

Copy link
Contributor

Choose a reason for hiding this comment

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

Was forced to make the disperserClient struct public for the tests

Don't see any place that uses it. We couldn't use the constructor in the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, you're right. Originally was trying to put the tests in the same package so I can build the struct manually injecting the connection to test something. But then realized I can just add the config parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So hmmm... could revert to the old names. But somehow I feel like our clients should follow the same convention.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted: dc98581
Also added TODO to change eigenda-client to use same naming convention as disperser-client: 57d716f

api/clients/disperser_client.go Outdated Show resolved Hide resolved
BlobIndex: blobIndex,
})
if c.config.MaxRetrieveBlobSizeBytes == 0 {
// max blob size on mainnet is currently 16MiB but we set this to 100MiB for backward compatibility
Copy link
Contributor

Choose a reason for hiding this comment

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

@samlaf are you planning to update this comment every time the disperser's MAX_BLOB_SIZE config is changed? I would rephrase this to set to 100MiB for forward compatibility. check official documentation for current max blob size on mainnet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call: a07336c

// but all other methods use the default 4MiB max message size, whereas RetrieveBlob
// potentially needs a larger size.
//
// If not set, the default value is 100MiB, to be backward compatible.
Copy link
Contributor

Choose a reason for hiding this comment

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

forward compatible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's actually backward compatible. The code before my previous PR (that caused the regression) had a default 100MiB.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah just saw your previous comment, I see what you mean now! Good point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A previous commit 6894828 (#826) caused regression by forgetting to set grpc max msg size in retrieveBlob call

Caught by integration test from eigenda-proxy

Added unit-test here to catch any future regression on this feature
@samlaf samlaf force-pushed the samlaf/fix--disperser-client-retrieve-blob-max-size-regression branch from a07336c to 76bed5f Compare October 30, 2024 23:54
@samlaf samlaf requested a review from pschork October 31, 2024 00:03
@bxue-l2
Copy link
Contributor

bxue-l2 commented Oct 31, 2024

lgtm, but address Ian's comment

Copy link
Contributor

@ian-shim ian-shim left a comment

Choose a reason for hiding this comment

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

lgtm, left one more comment!

@@ -91,6 +103,14 @@ var _ DisperserClient = &disperserClient{}
// // Subsequent calls will use the existing connection
// status2, requestId2, err := client.DisperseBlob(ctx, otherData, otherQuorums)
func NewDisperserClient(config *Config, signer core.BlobRequestSigner) *disperserClient {
if config == nil {
config = &Config{}
Copy link
Contributor

Choose a reason for hiding this comment

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

should it return error if config is nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep good call: f2100c8

@samlaf samlaf merged commit e2ead56 into master Oct 31, 2024
9 checks passed
@samlaf samlaf deleted the samlaf/fix--disperser-client-retrieve-blob-max-size-regression branch October 31, 2024 14:52
samlaf added a commit to Layr-Labs/eigenda-proxy that referenced this pull request Oct 31, 2024
samlaf added a commit to Layr-Labs/eigenda-proxy that referenced this pull request Oct 31, 2024
* fix(e2e tests): missing new eigenda-client required config fields - ethrpc and svcmanageraddr

* Revert "ci: give holesky-test workflow access to secrets via pull_request_target (#153)"

This reverts commit 15b10fd.
The commit was doing things very wrong. I hadn't understood how pull_request_target works.
Was causing the workflow to run against main branch head commit instead of PR commit.
We will need to find another solution to the problem of letting external contributors run this workflow.

* ide: update vscode settings.json with env vars to run holesky testnet e2e tests

* docs: shorten svcManagerAddr holesky testnet comment

* tests: add panic when both INTEGRATION and TESTNET env vars are set

This forces test runner to be fully aware of which test suite he is running (otherwise it implicitly runs the TESTNET suite)

* style: make handleGetShared returned error print hex encoded commitment

Previously it was printing as byte array, which is unreadable and clutters logs

* docs: better comments in metrics middleware

* deps: upgrade eigenda dep to regression fix commit

TODO: will need to update this after that PR is merged

* deps: update eigenda dependency to master head

Just merged Layr-Labs/eigenda#849 which will fix our ci bug
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.

4 participants