Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix worker nil pointer exception because of baseFee == nil #899

Merged
merged 1 commit into from
Jul 6, 2023

Commits on Jun 13, 2023

  1. Fix worker tracing nil pointer exception

    The `baseFee` can be `nil` in certain situations, the tracing must not use `baseFee` unless it was checked otherwise if such case happen, Go is going to panic:
    
    ```
    goroutine 115 [running]:
    math/big.(*Int).Bits(...)
    	/opt/homebrew/Cellar/go/1.20.4/libexec/src/math/big/int.go:105
    github.com/holiman/uint256.(*Int).SetFromBig(0x14001297410?, 0x107714520?)
    	/Users/maoueh/go/pkg/mod/github.com/holiman/uint256@v1.2.0/conversion.go:102 +0x24
    github.com/holiman/uint256.FromBig(...)
    	/Users/maoueh/go/pkg/mod/github.com/holiman/uint256@v1.2.0/conversion.go:50
    github.com/ethereum/go-ethereum/common/math.FromBig(0x1073923e0?)
    	/Users/maoueh/work/sf/ethereum.chain/common/math/uint.go:20 +0x34
    github.com/ethereum/go-ethereum/miner.(*worker).fillTransactions.func4({0x1400015c080?, 0x107827f08?}, {0x107836a40, 0x14000730be0})
    	/Users/maoueh/work/sf/ethereum.chain/miner/worker.go:1521 +0x4c
    github.com/ethereum/go-ethereum/common/tracing.Exec({0x107827f08, 0x140011b7020}, {0x0, 0x0}, {0x1066bde48, 0x27}, {0x140012975c0, 0x1, 0x0?})
    	/Users/maoueh/work/sf/ethereum.chain/common/tracing/context.go:70 +0x1e4
    github.com/ethereum/go-ethereum/miner.(*worker).fillTransactions(0x14000192780, {0x107827f08?, 0x140011b68d0?}, 0x1400060914c, 0x140002d4000, {0x107827e98, 0x1400005c0e8})
    	/Users/maoueh/work/sf/ethereum.chain/miner/worker.go:1520 +0x1a4
    github.com/ethereum/go-ethereum/miner.(*worker).commitWork(0x14000192780, {0x107827f08, 0x140011b6240}, 0x0?, 0x0, 0x6488d5f2)
    	/Users/maoueh/work/sf/ethereum.chain/miner/worker.go:1663 +0x3e8
    github.com/ethereum/go-ethereum/miner.(*worker).mainLoop(0x14000192780, {0x107827f08, 0x14000137290})
    	/Users/maoueh/work/sf/ethereum.chain/miner/worker.go:603 +0x7e4
    created by github.com/ethereum/go-ethereum/miner.newWorker
    	/Users/maoueh/work/sf/ethereum.chain/miner/worker.go:344 +0x7e0
    ```
    maoueh committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    5148c43 View commit details
    Browse the repository at this point in the history