Skip to content

Commit b484e6f

Browse files
lightclientblakehhuynh
authored andcommitted
internal/ethapi: always return chain id (ethereum#25166)
The error was introduced in PR ethereum#21686, but there is no good reason to enforce sync in this method, and it causes issues with EL/CL integration.
1 parent 24bcd38 commit b484e6f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

internal/ethapi/api.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,12 +609,8 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI {
609609
}
610610

611611
// ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config.
612-
func (api *BlockChainAPI) ChainId() (*hexutil.Big, error) {
613-
// if current block is at or past the EIP-155 replay-protection fork block, return chainID from config
614-
if config := api.b.ChainConfig(); config.IsEIP155(api.b.CurrentBlock().Number()) {
615-
return (*hexutil.Big)(config.ChainID), nil
616-
}
617-
return nil, fmt.Errorf("chain not synced beyond EIP-155 replay-protection fork block")
612+
func (api *BlockChainAPI) ChainId() *hexutil.Big {
613+
return (*hexutil.Big)(api.b.ChainConfig().ChainID)
618614
}
619615

620616
// BlockNumber returns the block number of the chain head.

0 commit comments

Comments
 (0)