diff --git a/common/version/version.go b/common/version/version.go index 696291edd..9e5f7a771 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.4.70" +var tag = "v4.4.71" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok { diff --git a/rollup/internal/controller/sender/sender.go b/rollup/internal/controller/sender/sender.go index 30ebd8d5d..525ffc399 100644 --- a/rollup/internal/controller/sender/sender.go +++ b/rollup/internal/controller/sender/sender.go @@ -626,7 +626,7 @@ func (s *Sender) getSenderMeta() *orm.SenderMeta { } func (s *Sender) getBlockNumberAndBaseFeeAndBlobFee(ctx context.Context) (uint64, uint64, uint64, error) { - header, err := s.client.HeaderByNumber(ctx, nil) + header, err := s.client.HeaderByNumber(ctx, big.NewInt(rpc.PendingBlockNumber.Int64())) if err != nil { return 0, 0, 0, fmt.Errorf("failed to get header by number, err: %w", err) } @@ -637,11 +637,11 @@ func (s *Sender) getBlockNumberAndBaseFeeAndBlobFee(ctx context.Context) (uint64 } var blobBaseFee uint64 - if header.ExcessBlobGas != nil && header.BlobGasUsed != nil { - parentExcessBlobGas := eip4844.CalcExcessBlobGas(*header.ExcessBlobGas, *header.BlobGasUsed) - blobBaseFee = eip4844.CalcBlobFee(parentExcessBlobGas).Uint64() + if excess := header.ExcessBlobGas; excess != nil { + blobBaseFee = eip4844.CalcBlobFee(*excess).Uint64() } - return header.Number.Uint64(), baseFee, blobBaseFee, nil + // header.Number.Uint64() returns the pendingBlockNumber, so we minus 1 to get the latestBlockNumber. + return header.Number.Uint64() - 1, baseFee, blobBaseFee, nil } func makeSidecar(blob *kzg4844.Blob) (*gethTypes.BlobTxSidecar, error) {