Skip to content
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

server: Use HeaderByNumber() instead of BlockByNumber() in the function requesting LPT from faucet #2550

Merged
merged 2 commits into from
Aug 1, 2022

Conversation

leszko
Copy link
Contributor

@leszko leszko commented Aug 1, 2022

What does this pull request do? Explain your changes. (required)

After the Arbitrum Nitro migration, the function BlockByNumber() from ethereum/go-ethereum fails with the following message:

Unable to get latest block: transaction type not supported

It's related to the fact that Arbitrum uses its own transaction format, and therefore requires its own go-ethereum fork OffchainLabs/go-ethereum.

One option is to use OffchainLabs/go-ethereum, what we considered in #2470. Another option, implemented in this PR, is to find all the chain interactions that fail and fix them. I checked all the transaction executions and actually this one is the one that fails. Therefore, I suggest to continue using ethereum/go-ethereum and merge this PR.

Specific updates (required)

How did you test each of these updates (required)

Tested in Arbitrum Rinkeby Testnet

Does this pull request close any open issues?

fix #2547

Checklist:

Copy link
Contributor

@thomshutt thomshutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - This is safe to merge now right? (i.e we don't need to align deploying it with the migration)

@leszko
Copy link
Contributor Author

leszko commented Aug 1, 2022

LGTM - This is safe to merge now right? (i.e we don't need to align deploying it with the migration)

Yes, it's safe.

@@ -1029,13 +1029,13 @@ func requestTokensHandler(client eth.LivepeerEthClient) http.Handler {
}

backend := client.Backend()
blk, err := backend.BlockByNumber(r.Context(), nil)
h, err := backend.HeaderByNumber(r.Context(), nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to only fetch the block header as opposed to the entire block here anyway because we don't care about most of the data in the block anyway and we can just get the information we need from the slimmer header.

Copy link
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leszko leszko merged commit f6948b8 into livepeer:master Aug 1, 2022
@leszko leszko deleted the rafal/faucet-token-update-client branch August 1, 2022 19:36
ad-astra-video pushed a commit to ad-astra-video/go-livepeer that referenced this pull request Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to get latest block: transaction type not supported
3 participants