internal/ethapi: add note about eth_chainId compatibility with EIP-695 (#25168)

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
lightclient 2022-06-25 21:34:21 +02:00 committed by GitHub
parent 647c6f2db6
commit c7f485d9e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -609,6 +609,11 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI {
} }
// ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config. // ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config.
//
// Note, this method does not conform to EIP-695 because the configured chain ID is always
// returned, regardless of the current head block. We used to return an error when the chain
// wasn't synced up to a block where EIP-155 is enabled, but this behavior caused issues
// in CL clients.
func (api *BlockChainAPI) ChainId() *hexutil.Big { func (api *BlockChainAPI) ChainId() *hexutil.Big {
return (*hexutil.Big)(api.b.ChainConfig().ChainID) return (*hexutil.Big)(api.b.ChainConfig().ChainID)
} }