From cc0fd43710c7b90f4235296a28e9bdf1d17d86cf Mon Sep 17 00:00:00 2001 From: "lightclient@protonmail.com" Date: Fri, 24 Jun 2022 18:40:02 +0200 Subject: [PATCH 1/3] internal/ethapi: add note about eth_chainId compatibility with EIP-695 --- internal/ethapi/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index c4bf86a40bd..f4fb43dee44 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -609,6 +609,9 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI { } // ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config. +// +// Note, this method does not conform to EIP-695 becuase the configured chain id is always +// returned regardless of the current head block. func (api *BlockChainAPI) ChainId() *hexutil.Big { return (*hexutil.Big)(api.b.ChainConfig().ChainID) } From d0b7859f0e24fa9490b5428406b002f3f2d20a51 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 25 Jun 2022 20:07:34 +0200 Subject: [PATCH 2/3] Update api.go --- internal/ethapi/api.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index f4fb43dee44..45da0a769ee 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -610,8 +610,9 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI { // ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config. // -// Note, this method does not conform to EIP-695 becuase the configured chain id is always -// returned regardless of the current head block. +// 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 the head block here, but it caused issues in CL clients. func (api *BlockChainAPI) ChainId() *hexutil.Big { return (*hexutil.Big)(api.b.ChainConfig().ChainID) } From 314549dbc778e6a41f9cff401450b55c846c4560 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 25 Jun 2022 21:34:03 +0200 Subject: [PATCH 3/3] Update api.go --- internal/ethapi/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 45da0a769ee..b05c9a08d37 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -612,7 +612,8 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI { // // 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 the head block here, but it caused issues in CL clients. +// 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 { return (*hexutil.Big)(api.b.ChainConfig().ChainID) }