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

[R4R]-{estimateGas}feature: EstimateGas performance optimization #38

Merged
merged 5 commits into from
Mar 6, 2024

Conversation

boz14676
Copy link

@boz14676 boz14676 commented Feb 5, 2024

EstimateGas performance optimization:

Reference:https://github.com/ethereum/go-ethereum/blob/master/eth/gasestimator/gasestimator.go#L52

  1. Introduction of Optimistic Gas Limit
  2. Finely Tuned Binary Search
  3. Handling of Fee Caps
  4. Rapid Processing of Special Cases
  5. Joint Consideration of Account Balance and Gas Limits
  6. Error Handling and Early Return

@@ -21,6 +21,7 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/ethereum/go-ethereum/consensus"

Choose a reason for hiding this comment

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

go import format

Copy link
Author

Choose a reason for hiding this comment

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

resolved

@Tri-stone Tri-stone changed the title feature: Optimize GasEstimate method [R4R]-{estimateGas}feature: Optimize GasEstimate method Feb 5, 2024
.gitignore Outdated
@@ -49,3 +49,4 @@ profile.cov
/dashboard/assets/package-lock.json

**/yarn-error.log
node_modules

Choose a reason for hiding this comment

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

please delete un-releated file

Copy link
Author

Choose a reason for hiding this comment

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

resolved

@Tri-stone Tri-stone changed the title [R4R]-{estimateGas}feature: Optimize GasEstimate method [WIP]-{estimateGas}feature: Optimize GasEstimate method Feb 7, 2024
@boz14676 boz14676 changed the title [WIP]-{estimateGas}feature: Optimize GasEstimate method [R4R]-{estimateGas}feature: Optimize GasEstimate method Feb 19, 2024
internal/ethapi/api.go Outdated Show resolved Hide resolved
"encoding/json"
"errors"
"github.com/ethereum/go-ethereum"

Choose a reason for hiding this comment

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

go format

Copy link
Author

Choose a reason for hiding this comment

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

resolved

@boz14676 boz14676 force-pushed the zhangbo/optimize_estimate_gas branch 3 times, most recently from c2631f7 to 318a5a7 Compare February 21, 2024 09:58
feature: Optimize GasEstimate method

[R4R]-[estimateGas]feat: enlarge a buffer for Estimation

feature: Optimize GasEstimate method

feature: Optimize GasEstimate method

feature: Optimize GasEstimate method02
@boz14676 boz14676 force-pushed the zhangbo/optimize_estimate_gas branch from 318a5a7 to 9bab5f8 Compare February 21, 2024 10:02
@boz14676 boz14676 changed the title [R4R]-{estimateGas}feature: Optimize GasEstimate method [R4R]-{estimateGas}optimization: EstimateGas performance optimization Feb 21, 2024
@boz14676 boz14676 changed the title [R4R]-{estimateGas}optimization: EstimateGas performance optimization [R4R]-{estimateGas}feature: EstimateGas performance optimization Feb 21, 2024
@Tri-stone Tri-stone changed the base branch from release/v0.5.0 to develop March 1, 2024 09:45
state, header, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)
if state == nil || err != nil {
return nil, err
}
Copy link

Choose a reason for hiding this comment

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

Is there a situation where has state == nil && err == nil? If so, the caller may get a NullPointerException due to err == nil and using result(nil).xxx(). If not, just using err!=nil is enough, since state ==nil err must !=nil

@Tri-stone Tri-stone merged commit bb4117b into develop Mar 6, 2024
2 checks passed
Tri-stone added a commit that referenced this pull request Mar 12, 2024
Tri-stone added a commit that referenced this pull request Mar 12, 2024
Tri-stone added a commit that referenced this pull request Mar 12, 2024
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.

5 participants