From e392a9bfeb494b62c5d2798258169e8a8a9da691 Mon Sep 17 00:00:00 2001 From: allen Date: Thu, 11 Sep 2025 08:45:21 -0400 Subject: [PATCH] core/types: fix LatestSignerForChainID panic with chainID 0 --- core/types/transaction_signing.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go index 01aa67c6ba..519ff7c756 100644 --- a/core/types/transaction_signing.go +++ b/core/types/transaction_signing.go @@ -92,14 +92,14 @@ func LatestSigner(config *params.ChainConfig) Signer { // LatestSignerForChainID returns the 'most permissive' Signer available. Specifically, // this enables support for EIP-155 replay protection and all implemented EIP-2718 -// transaction types if chainID is non-nil. +// transaction types if chainID is non-nil and greater than zero. // // Use this in transaction-handling code where the current block number and fork // configuration are unknown. If you have a ChainConfig, use LatestSigner instead. // If you have a ChainConfig and know the current block number, use MakeSigner instead. func LatestSignerForChainID(chainID *big.Int) Signer { var signer Signer - if chainID != nil { + if chainID != nil && chainID.Sign() > 0 { signer = NewPragueSigner(chainID) } else { signer = HomesteadSigner{}