From 98d57b24db473cf5f15d90837dfea8def7f61ecc Mon Sep 17 00:00:00 2001 From: irrun Date: Tue, 2 Apr 2024 11:20:15 +0800 Subject: [PATCH] fix: NPE and wrong profit (#13) --- internal/ethapi/api_bundle.go | 2 +- miner/bidder.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/ethapi/api_bundle.go b/internal/ethapi/api_bundle.go index 441345f9b6..6dd541338c 100644 --- a/internal/ethapi/api_bundle.go +++ b/internal/ethapi/api_bundle.go @@ -35,7 +35,7 @@ func (s *PrivateTxBundleAPI) BundlePrice(ctx context.Context) *big.Int { // SendBundle will add the signed transaction to the transaction pool. // The sender is responsible for signing the transaction and using the correct nonce and ensuring validity -func (s *PrivateTxBundleAPI) SendBundle(ctx context.Context, args *types.SendBundleArgs) error { +func (s *PrivateTxBundleAPI) SendBundle(ctx context.Context, args types.SendBundleArgs) error { if len(args.Txs) == 0 { return newBundleError(errors.New("bundle missing txs")) } diff --git a/miner/bidder.go b/miner/bidder.go index 33cc181e97..e8e3a24dd2 100644 --- a/miner/bidder.go +++ b/miner/bidder.go @@ -216,7 +216,7 @@ func (b *Bidder) bid(work *environment) { BlockNumber: parent.Number.Uint64() + 1, ParentHash: parent.Hash(), GasUsed: work.header.GasUsed, - GasFee: work.profit, + GasFee: work.state.GetBalance(consensus.SystemAddress).ToBig(), Txs: txs, // TODO: decide builderFee according to realtime traffic and validator commission }