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

feat: implement EIP-7691 increase blob throughput #7309

Merged
merged 23 commits into from
Jan 9, 2025
Merged

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Dec 17, 2024

Implement EIP-7691.

Outstanding items that is not covered in this PR:

  • Make callers of requestSszTypeByMethod to provide fork info
  • Make InboundRateLimitQuota fork-aware so byPeer limit can be correctly set for BlobSidecarsByRange and BlobSidecarsByRoot.
  • Make ReqRespRateLimiter to re-set the rate limit on fork activation

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 38.09524% with 52 lines in your changes missing coverage. Please review.

Project coverage is 48.60%. Comparing base (265579f) to head (6e0399f).
Report is 1 commits behind head on devnet-5.

Additional details and impacted files
@@             Coverage Diff              @@
##           devnet-5    #7309      +/-   ##
============================================
- Coverage     48.61%   48.60%   -0.02%     
============================================
  Files           603      603              
  Lines         40457    40513      +56     
  Branches       2065     2065              
============================================
+ Hits          19667    19690      +23     
- Misses        20752    20785      +33     
  Partials         38       38              

@ensi321 ensi321 marked this pull request as ready for review December 18, 2024 23:07
@ensi321 ensi321 requested a review from a team as a code owner December 18, 2024 23:07
@ensi321
Copy link
Contributor Author

ensi321 commented Dec 18, 2024

Please ignore E2E Tests and spec tests as they will be addressed in the next PR.

packages/config/src/constantsHelper.ts Outdated Show resolved Hide resolved
packages/config/src/constantsHelper.ts Outdated Show resolved Hide resolved
this.sendReqRespRequest(
peerId,
ReqRespMethod.BlobSidecarsByRoot,
[isForkPostElectra(fork) ? Version.V2 : Version.V1],
Copy link
Contributor

Choose a reason for hiding this comment

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

whats different in v2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Max size of the param in V1 is MAX_REQUEST_BLOB_SIDECARS(768) , V2 is MAX_REQUEST_BLOB_SIDECARS_ELECTRA(1152)

Copy link
Member

Choose a reason for hiding this comment

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

there is some discussion around this on discord, we might get rid of v2 again in a future spec release

@@ -207,7 +207,8 @@ export class ReqRespBeaconNode extends ReqResp {
versions: number[],
request: Req
): AsyncIterable<ResponseIncoming> {
const requestType = requestSszTypeByMethod(this.config)[method];
const fork = ForkName[ForkSeq[this.currentRegisteredFork] as keyof typeof ForkName];
const requestType = requestSszTypeByMethod(this.config, fork)[method];
Copy link
Contributor

@g11tech g11tech Dec 20, 2024

Choose a reason for hiding this comment

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

we need this for v1/v2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, request type for BlobSidecarsByRootV2 has changed. But ReqRespMethod does not communicate version info, so we can only pass in fork info to determine the correct type.

@@ -38,7 +39,8 @@ export function getReqRespHandlers({db, chain}: {db: IBeaconDb; chain: IBeaconCh
return onBeaconBlocksByRoot(body, chain, db);
},
[ReqRespMethod.BlobSidecarsByRoot]: (req) => {
const body = BlobSidecarsByRootRequestType(chain.config).deserialize(req.data);
const fork = req.version === Version.V2 ? ForkName.electra : ForkName.deneb;
const body = BlobSidecarsByRootRequestType(fork, chain.config).deserialize(req.data);
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't type be the same just that v2 will have context bytes/fork type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

V2 accepts higher number of blob requests so the ssz container is different.

Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

LGTM - we might have to remove req/resp v2 methods again in the future but as it's part of the spec for devnet-5 we should probably keep it for now as other clients might rely on it

MAX_BLOB_COMMITMENTS_PER_BLOCK: 16,
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 9,
MAX_BLOB_COMMITMENTS_PER_BLOCK: 32,
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 10,
Copy link
Member

@nflaig nflaig Jan 8, 2025

Choose a reason for hiding this comment

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

It looks like there is a consensus issue with Lighthouse in our sim tests due to this, need to use a image with the updated minimal preset values. Should not be a blocker to merge this but should figure out a solution (ie. updating LH image) before we merge the devnet-5 branch to unstable

@ensi321
Copy link
Contributor Author

ensi321 commented Jan 8, 2025

LGTM - we might have to remove req/resp v2 methods again in the future but as it's part of the spec for devnet-5 we should probably keep it for now as other clients might rely on it

Looks like removing v2 might be happening in devnet 5. Decision will be made in ACD this week. Will make another PR to remove them if included in devnet 5

@ensi321 ensi321 merged commit 42d6982 into devnet-5 Jan 9, 2025
19 of 23 checks passed
@ensi321 ensi321 deleted the nc/eip-7691 branch January 9, 2025 06:29
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.

3 participants