-
Notifications
You must be signed in to change notification settings - Fork 873
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
Transaction.gasPrice Optional #2396
Transaction.gasPrice Optional #2396
Conversation
...a/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetMinerDataByBlockHash.java
Outdated
Show resolved
Hide resolved
…s yet to sort out Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
…r, instead rely on validation logic Signed-off-by: garyschulte <[email protected]>
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.
LGTM
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/TransactionEncoder.java
Outdated
Show resolved
Hide resolved
@garyschulte maybe you have to ask those who work on the privacy features to be sure that there is no impact |
Signed-off-by: garyschulte <[email protected]>
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.
Overall it is looking good and I don't think it will cause any side effects on private txs.
I've left a few comments/suggestions. Nothing major.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java
Outdated
Show resolved
Hide resolved
@@ -112,7 +112,8 @@ public MainnetTransactionValidator( | |||
return signatureResult; | |||
} | |||
|
|||
if (goQuorumCompatibilityMode && !transaction.getGasPrice().isZero()) { | |||
if (goQuorumCompatibilityMode | |||
&& !transaction.getGasPrice().map(Wei::isZero).orElse(Boolean.TRUE)) { |
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.
This clause is getting harder and harder to understand. Maybe we could encapsulate the "tx cost zero" logic into a method in the Transaction class?
Something like: transaction.hasGasPrice()
or transaction.isGasPriceZero()
(I'm not great with names, feel free to come up with a better name for this method).
I recon this would make this if statement easier to read:
if (goQuorumCompatibilityMode && transaction.hasGasPrice()) {
....
}
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.
encapsulated in core Transaction. I went ahead and added 1559 fields just in case.
...hyperledger/besu/ethereum/permissioning/TransactionSmartContractPermissioningController.java
Outdated
Show resolved
Hide resolved
One thing that I'm thinking that we might want is to simplify the access to the tx gas price when we don't want to handle the optional value (e.g. when optional.empty means zero and not-empty means a Wei value). e.g. What I'm thinking is that having a method like |
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte [email protected]
PR description
Systemic treatment of gasPrice as Optional has revealed several areas where we are still assuming gasPrice is not null and where we do not have specific treatment of 1559 fee fields
Fixed Issue(s)
#2389
Changelog