Skip to content

Commit

Permalink
Block blob tx
Browse files Browse the repository at this point in the history
  • Loading branch information
gazzua authored and qqqeck committed Oct 21, 2024
1 parent 12f224d commit d4fc78a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 4 additions & 3 deletions consensus/misc/eip4844/eip4844.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
)

var (
minBlobGasPrice = big.NewInt(params.BlobTxMinBlobGasprice)
blobGaspriceUpdateFraction = big.NewInt(params.BlobTxBlobGaspriceUpdateFraction)
// minBlobGasPrice = big.NewInt(params.BlobTxMinBlobGasprice)
// blobGaspriceUpdateFraction = big.NewInt(params.BlobTxBlobGaspriceUpdateFraction)
)

// VerifyEIP4844Header verifies the presence of the excessBlobGas field and that
Expand Down Expand Up @@ -77,7 +77,8 @@ func CalcExcessBlobGas(parentExcessBlobGas uint64, parentBlobGasUsed uint64) uin

// CalcBlobFee calculates the blobfee from the header's excess blob gas field.
func CalcBlobFee(excessBlobGas uint64) *big.Int {
return fakeExponential(minBlobGasPrice, new(big.Int).SetUint64(excessBlobGas), blobGaspriceUpdateFraction)
return params.BigBlobBaseFee
//return fakeExponential(minBlobGasPrice, new(big.Int).SetUint64(excessBlobGas), blobGaspriceUpdateFraction)
}

// fakeExponential approximates factor * e ** (numerator / denominator) using
Expand Down
4 changes: 2 additions & 2 deletions consensus/misc/eip4844/eip4844_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func TestCalcBlobFee(t *testing.T) {
}
for i, tt := range tests {
have := CalcBlobFee(tt.excessBlobGas)
if have.Int64() != tt.blobfee {
t.Errorf("test %d: blobfee mismatch: have %v want %v", i, have, tt.blobfee)
if have.Cmp(params.BigBlobBaseFee) != 0 {
t.Errorf("test %d: blobfee mismatch: have %v want %v", i, have, params.BigBlobBaseFee)
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion core/txpool/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import (
var (
// blobTxMinBlobGasPrice is the big.Int version of the configured protocol
// parameter to avoid constructing a new big integer for every transaction.
blobTxMinBlobGasPrice = big.NewInt(params.BlobTxMinBlobGasprice)
//blobTxMinBlobGasPrice = big.NewInt(params.BlobTxMinBlobGasprice)
blobTxMinBlobGasPrice = params.BigBlobBaseFee
)

// ValidationOptions define certain differences between transaction validation
Expand Down
4 changes: 4 additions & 0 deletions params/protocol_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ var (
DurationLimit = big.NewInt(13) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
)

var (
BigBlobBaseFee, _ = new(big.Int).SetString("1000000000000000000000000000", 10) // Disable blob tx by setting blob fee 1,000,000,000 over
)

// System contracts.
var (
// SystemAddress is where the system-transaction is sent from as per EIP-4788
Expand Down

0 comments on commit d4fc78a

Please sign in to comment.