Skip to content

Upgrade go-ethereum to v1.13.11 #3774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 8, 2024
Merged

Upgrade go-ethereum to v1.13.11 #3774

merged 2 commits into from
Feb 8, 2024

Conversation

lukasz-zimnoch
Copy link
Member

@lukasz-zimnoch lukasz-zimnoch commented Feb 7, 2024

Closes: #3772
Depends on: #3773

Here we bump up go-etherum version to v1.13.11. This version is ready for the Cancun-Deneb (Dencun) upgrade and adds support for the new “blob-carrying” EIP-4844 transaction type in API methods. The RPC client used in older go-ethereum versions does not recognize EIP-4844 transactions and may error out if there is a need to parse return data from transaction-related functions called against chains where the Dencun upgrade has been enabled. We observed this problem on our Sepolia testnet when calling eth_getBlockByNumber using version v1.10.19 after Jan 31th so after the date when Dencun was enabled on Sepolia

We are also taking an opportunity and optimize our GetBlockHashByNumber function. So far this function called the BlockByNumber function of the RPC client. Under the hood, that resulted in an inefficient eth_getBlockByNumber call with the show transaction details flag set to true which loaded full transaction data of the given block which is not necessary for the context of GetBlockHashByNumber. Here we improve that behavior by using the HeaderByNumber function of the RPC client. That function calls eth_getBlockByNumber with the show transaction details flag set to false which does not load transaction data and returns only data specific to the block header. This is enough to get the hash of the block.

Version `v1.13.11` is ready for the Cancun-Deneb (Dencun) upgrade
and adds support of the new “blob-carrying” EIP-4844 transaction type in
API-methods.

The RPC client used in older `go-ethereum` versions does not recognize
EIP-4844 transactions and may error out if there is a need to parse
return data from transaction-related functions called against chains
where the Dencun upgrade has been enabled.

We observed this problem on our Sepolia testnet when calling
`eth_getBlockByNumber` using version `v1.10.19` after Jan 31th so
after the date when Dencun was enabled on Sepolia

See https://github.com/ethereum/go-ethereum/releases/tag/v1.13.11
for reference.
So far the `GetBlockHashByNumber` function called the `BlockByNumber`
function of the RPC client. Under the hood, that resulted in an
inefficient `eth_getBlockByNumber` call with `show transaction details` flag
set to `true` which loaded full transaction data of the given block which
is not necessary in the context of `GetBlockHashByNumber`.

Here we improve that behavior by using the `HeaderByNumber` function
of the RPC client. That function calls `eth_getBlockByNumber` with
`show transaction details` flag set to `false` which does not load
transaction data and returns only data specific to the block header.
This is enough to get the hash of the block.
@lukasz-zimnoch lukasz-zimnoch self-assigned this Feb 7, 2024
@lukasz-zimnoch lukasz-zimnoch added this to the v2.0.0-m7 milestone Feb 7, 2024
Base automatically changed from tweak-libp2p to main February 8, 2024 15:21
@lukasz-zimnoch lukasz-zimnoch marked this pull request as ready for review February 8, 2024 15:29
@tomaszslabon tomaszslabon merged commit 66f00b8 into main Feb 8, 2024
@tomaszslabon tomaszslabon deleted the upgrade-go-ethereum branch February 8, 2024 15:36
tomaszslabon added a commit that referenced this pull request Feb 8, 2024
Closes: #3739
Depends on: keep-network/go-electrum#5
Depends on: #3774

So far, the `GetLatestBlockHeight` function of the Electrum client was
using `go-electrum`'s `SubscribeHeaders` under the hood. That caused a
memory leak because `GetLatestBlockHeight` was not interested in reading
from the returned `headersChan` channel. Each call to
`GetLatestBlockHeight` produced a new dangling goroutine blocked on a
buffered channel with one item inside.

Here we replace `SubscribeHeaders` with `SubscribeHeadersSingle` which
does not create a goroutine supposed to handle future headers
notifications. The `SubscribeHeadersSingle` just returns the current
chain tip and ignores further notifications coming from the Electrum
server.

See keep-network/go-electrum#5 for further
reference.
lukasz-zimnoch added a commit that referenced this pull request Feb 12, 2024
This pull request backports
#3774 to the
`releases/mainnet/v2.0.0-m7` branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade go-ethereum to v1.13.11 (Tremanre)
2 participants