File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,14 @@ func blockToModels(
149149 for idx , ethTx := range transactions {
150150 ethTxHex := ethTx .Hash ().Hex ()
151151 v , r , s := ethTx .RawSignatureValues ()
152- signer := ethtypes .LatestSignerForChainID (ethTx .ChainId ())
152+ chainID := ethTx .ChainId ()
153+ if chainID != nil && chainID .Cmp (big .NewInt (0 )) == 0 {
154+ // Legacy transactions don't have a chain ID but `ChainId()` returns 0, which is invalid
155+ // for `LatestSignerForChainId` which expects a null in that case (zero causes a panic).
156+ // https://github.com/ethereum/go-ethereum/issues/31653
157+ chainID = nil
158+ }
159+ signer := ethtypes .LatestSignerForChainID (chainID )
153160 from , _ := signer .Sender (ethTx )
154161 ethAccList := ethTx .AccessList ()
155162 accList := make ([]model.AccessTuple , 0 , len (ethAccList ))
You can’t perform that action at this time.
0 commit comments