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

internal/ethapi: EstimateGas should use LatestBlockNumber by default #20

Merged
merged 1 commit into from
Sep 3, 2023

Conversation

0xcb9ff9
Copy link

@0xcb9ff9 0xcb9ff9 commented Sep 1, 2023

Description

upstream PR: go-ethereum#24363

We met a problem that if the args TransactionArgs depends on the latest committed block N, PendingBlockNumber is still N-1, which causes the estimation to fail.

LatestBlockNumber is a better default value IMO.

ethereum/go-ethereum#24363 (comment) :

if use pendingblocknumber,then in code:
block, err := b.BlockByNumberOrHash(ctx, blockNrOrHash)
you may get error or "block not found".

@0xcb9ff9 0xcb9ff9 added the upstream upstream PR label Sep 1, 2023
@0xcb9ff9 0xcb9ff9 self-assigned this Sep 1, 2023
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

Yes, I totally agree.
There is no pending block in RPC endpoint or other non-mining nodes.

@DarianShawn DarianShawn merged commit 38a0fee into dev Sep 3, 2023
@DarianShawn DarianShawn deleted the upstream/24363-fix-estimateGas branch September 3, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream upstream PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants