Skip to content

Commit

Permalink
use latest instead of pending
Browse files Browse the repository at this point in the history
  • Loading branch information
Thegaram committed Mar 5, 2025
1 parent 2d9afa1 commit f5b8420
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rollup/internal/controller/sender/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func (s *Sender) getSenderMeta() *orm.SenderMeta {
}

func (s *Sender) getBlockNumberAndBaseFeeAndBlobFee(ctx context.Context) (uint64, uint64, uint64, error) {
header, err := s.client.HeaderByNumber(ctx, big.NewInt(rpc.PendingBlockNumber.Int64()))
header, err := s.client.HeaderByNumber(ctx, big.NewInt(rpc.LatestBlockNumber.Int64()))
if err != nil {
return 0, 0, 0, fmt.Errorf("failed to get header by number, err: %w", err)
}
Expand All @@ -677,8 +677,8 @@ func (s *Sender) getBlockNumberAndBaseFeeAndBlobFee(ctx context.Context) (uint64
if excess := header.ExcessBlobGas; excess != nil {
blobBaseFee = misc.CalcBlobFee(*excess).Uint64()
}
// header.Number.Uint64() returns the pendingBlockNumber, so we minus 1 to get the latestBlockNumber.
return header.Number.Uint64() - 1, baseFee, blobBaseFee, nil

return header.Number.Uint64(), baseFee, blobBaseFee, nil
}

func makeSidecar(blob *kzg4844.Blob) (*gethTypes.BlobTxSidecar, error) {
Expand Down

0 comments on commit f5b8420

Please sign in to comment.