From aa132a40baca8847c700f3589ddc62c3083248f2 Mon Sep 17 00:00:00 2001 From: Vitaly Drogan Date: Mon, 11 Mar 2024 21:11:05 +0100 Subject: [PATCH] remove panic from worker.go --- miner/environment_diff.go | 2 +- miner/worker.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/miner/environment_diff.go b/miner/environment_diff.go index 7d3f94bdf..a24b8d48c 100644 --- a/miner/environment_diff.go +++ b/miner/environment_diff.go @@ -74,7 +74,7 @@ func (envDiff *environmentDiff) applyToBaseEnv() { func (envDiff *environmentDiff) commitBlobTx(tx *types.Transaction, chData chainData) (*types.Receipt, int, error) { sc := tx.BlobTxSidecar() if sc == nil { - panic("blob transaction without blobs in miner") + return nil, popTx, errors.New("blob transaction without blobs in miner") } // Checking against blob gas limit: It's kind of ugly to perform this check here, but there // isn't really a better place right now. The blob gas limit is checked at block validation time diff --git a/miner/worker.go b/miner/worker.go index fb3872a81..09d46ed99 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -862,7 +862,7 @@ func (w *worker) commitTransaction(env *environment, tx *types.Transaction) ([]* func (w *worker) commitBlobTransaction(env *environment, tx *types.Transaction) ([]*types.Log, error) { sc := tx.BlobTxSidecar() if sc == nil { - panic("blob transaction without blobs in miner") + return nil, errors.New("blob transaction without blobs in miner") } // Checking against blob gas limit: It's kind of ugly to perform this check here, but there // isn't really a better place right now. The blob gas limit is checked at block validation time