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

refactor: move helper to get max blobs per block to fork config #7322

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Dec 20, 2024

As suggested in #7309 (comment)

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 35.29412% with 11 lines in your changes missing coverage. Please review.

Project coverage is 48.60%. Comparing base (760fbb8) to head (4fad863).
Report is 1 commits behind head on nc/eip-7691.

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              

Copy link
Member

@wemeetagain wemeetagain left a 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.

@nflaig
Copy link
Member Author

nflaig commented Jan 6, 2025

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)
Copy link
Member Author

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

@nflaig nflaig merged commit 8a49542 into nc/eip-7691 Jan 6, 2025
12 of 17 checks passed
@nflaig nflaig deleted the nflaig/config-get-max-blobs branch January 6, 2025 17:00
ensi321 added a commit that referenced this pull request Jan 9, 2025
* 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>
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