-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
internal/ethapi/api.go
Outdated
@@ -21,6 +21,7 @@ import ( | |||
"encoding/hex" | |||
"errors" | |||
"fmt" | |||
"github.com/ethereum/go-ethereum/consensus" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go import format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
.gitignore
Outdated
@@ -49,3 +49,4 @@ profile.cov | |||
/dashboard/assets/package-lock.json | |||
|
|||
**/yarn-error.log | |||
node_modules |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
"encoding/json" | ||
"errors" | ||
"github.com/ethereum/go-ethereum" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
c2631f7
to
318a5a7
Compare
feature: Optimize GasEstimate method [R4R]-[estimateGas]feat: enlarge a buffer for Estimation feature: Optimize GasEstimate method feature: Optimize GasEstimate method feature: Optimize GasEstimate method02
318a5a7
to
9bab5f8
Compare
state, header, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) | ||
if state == nil || err != nil { | ||
return nil, err | ||
} |
There was a problem hiding this comment.
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
EstimateGas performance optimization:
Reference:https://github.com/ethereum/go-ethereum/blob/master/eth/gasestimator/gasestimator.go#L52