EIP-4844: Increase Blob Throughput (#7688)

See https://github.com/ethereum/EIPs/pull/7154
This commit is contained in:
Andrew Ashikhmin 2023-06-09 11:07:28 +02:00 committed by GitHub
parent 1546a79771
commit 06af87dad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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()

View File

@ -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