-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
refactor: move helper to get max blobs per block to fork config #7322
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## nc/eip-7691 #7322 +/- ##
===============================================
- Coverage 48.60% 48.60% -0.01%
===============================================
Files 604 603 -1
Lines 40516 40513 -3
Branches 2065 2065
===============================================
- Hits 19694 19690 -4
- Misses 20784 20785 +1
Partials 38 38 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good addition to #7309
Either this or just copy pasta isForkPostElectra(fork) ? config.XXX_ELECTRA : config.XXX
where needed.
we had this initially but there are multiple places this needs to be done for blob count and this is expected to be bumped up again in the next hard fork, having a single getter which encapsulates the fork logic seems good for this specific case |
@@ -244,5 +244,7 @@ function validateInclusionProof(blobSidecar: deneb.BlobSidecar): boolean { | |||
} | |||
|
|||
function computeSubnetForBlobSidecar(fork: ForkName, config: ChainConfig, blobIndex: BlobIndex): number { | |||
return blobIndex % getBlobSidecarSubnetCount(fork, config); | |||
return ( | |||
blobIndex % (isForkPostElectra(fork) ? config.BLOB_SIDECAR_SUBNET_COUNT_ELECTRA : config.BLOB_SIDECAR_SUBNET_COUNT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noting here, we don't want a getter for this as it's not used as much and will be no longer relevant with peerdas
* Init * Add reqresp v2 definition * Update validateGossipBlock * Partial commit * Reqresp. Add todos * polish * Fork-aware requestSszTypeByMethod * Fixed minimal constants * Bump config test version * Update blob sidecar subnet computation * Pass proper commitment limit to block gossip error * Update blob sidecar index check * Lint * Update kzg unit test * Subscribe to correct number of blob sidecar subnets * Refactor constants getter to constantsHelper * address comment * Pass fork as first arg * Update packages/state-transition/src/block/processExecutionPayload.ts * refactor: move helper to get max blobs per block to fork config (#7322) * Simplify type cast --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com>
As suggested in #7309 (comment)