Skip to content

Commit

Permalink
Merge pull request #36 from astriaorg/bharath/fix-tip-fee-calc
Browse files Browse the repository at this point in the history
fix: Auctioneer: multiply effective tip with gas used by tx while streaming bid
  • Loading branch information
bharath-123 authored Jan 15, 2025
2 parents ff39ee3 + d9af4a0 commit bb12dfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grpc/optimistic/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (o *OptimisticServiceV1Alpha1) GetBidStream(_ *optimsticPb.GetBidStreamRequ

totalCost := big.NewInt(0)
effectiveTip := cmath.BigMin(pendingTx.GasTipCap(), new(big.Int).Sub(pendingTx.GasFeeCap(), optimisticBlock.BaseFee))
totalCost.Add(totalCost, effectiveTip)
totalCost = totalCost.Mul(effectiveTip, big.NewInt(int64(pendingTx.Gas())))

marshalledTxs := [][]byte{}
marshalledTx, err := pendingTx.MarshalBinary()
Expand Down Expand Up @@ -169,7 +169,7 @@ func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlockStream(stream optimist

func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlock(ctx context.Context, req *optimsticPb.BaseBlock) (*astriaPb.Block, error) {
// we need to execute the optimistic block
log.Debug("ExecuteOptimisticBlock called", "timestamp", req.Timestamp, "sequencer_block_hash", req.SequencerBlockHash)
log.Debug("ExecuteOptimisticBlock called", "timestamp", req.Timestamp, "sequencer_block_hash", common.BytesToHash(req.SequencerBlockHash).String())

// Deliberately called after lock, to more directly measure the time spent executing
executionStart := time.Now()
Expand Down

0 comments on commit bb12dfa

Please sign in to comment.