Skip to content

Commit

Permalink
EIP-4844: Increase Blob Throughput (#7688)
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis authored Jun 9, 2023
1 parent 1546a79 commit 06af87d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion consensus/merge/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (s *Merge) FinalizeAndAssemble(config *chain.Config, header *types.Header,
return nil, nil, nil, err
}
if config.IsCancun(header.Time) {
dataGasUsed := uint64(misc.CountBlobs(txs) * params.DataGasPerBlob)
dataGasUsed := uint64(misc.CountBlobs(txs)) * params.DataGasPerBlob
header.DataGasUsed = &dataGasUsed
}
return types.NewBlock(header, outTxs, uncles, outReceipts, withdrawals), outTxs, outReceipts, nil
Expand Down
2 changes: 1 addition & 1 deletion core/types/blob_tx_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (txw *BlobTxWrapper) ValidateBlobTransactionWrapper() error {
// the following check isn't strictly necessary as it would be caught by data gas processing
// (and hence it is not explicitly in the spec for this function), but it doesn't hurt to fail
// early in case we are getting spammed with too many blobs or there is a bug somewhere:
if l1 > params.MaxBlobsPerBlock {
if uint64(l1) > params.MaxBlobsPerBlock {
return fmt.Errorf("number of blobs exceeds max: %v", l1)
}
kzgCtx := libkzg.Ctx()
Expand Down
8 changes: 4 additions & 4 deletions params/protocol_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ const (

// stuff from EIP-4844
FieldElementsPerBlob = 4096 // each field element is 32 bytes
MaxDataGasPerBlock = 1 << 19
DataGasPerBlob = 1 << 17
TargetDataGasPerBlock uint64 = 1 << 18
MaxDataGasPerBlock uint64 = 0xC0000
TargetDataGasPerBlock uint64 = 0x60000
DataGasPerBlob uint64 = 0x20000
MinDataGasPrice = 1
DataGasPriceUpdateFraction = 2225652
DataGasPriceUpdateFraction = 3338477
MaxBlobsPerBlock = MaxDataGasPerBlock / DataGasPerBlob

BlobVerificationGas uint64 = 1800000
Expand Down

0 comments on commit 06af87d

Please sign in to comment.