-
Notifications
You must be signed in to change notification settings - Fork 956
EIP-7825: Transaction gas limit cap #8700
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
Conversation
import org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket; | ||
import org.hyperledger.besu.evm.gascalculator.GasCalculator; | ||
|
||
public class OsakaTargetingGasLimitCalculator extends CancunTargetingGasLimitCalculator { |
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.
I don't really understand this class name, and it seems more like a transaction validator than a gas calculator
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.
looking at the interface GasLimitCalculator
from which all the specify forks derive, probably is clearer what is the scope, probably since this hierarchy of classes has evolved and changed since its inception, could be time to rename? Do you have any suggestion?
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.
It's not a transaction validator per se, but it computes parameters that are used by the MainnetTransactionValidator
and block header validation rules, such as the next gas limit and the next blob gas target. In this context, the current name makes sense. Maybe we could drop either target or limit from the name but I think it is out of the scope of this PR.
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.
The PR looks good to me overall, but we need to change the TransactionSimulator
as well. If no gasLimit
is provided in the call object, it defaults to the block's gas limit—which is always greater than 30M. I suggest updating TransactionSimulator.calculateSimulationGasCap
to use min(transactionGasLimit, blockGasLimit)
when no initial gas cap is explicitly provided.
Good point, I missed that part, and I think in a future PR we also need to evaluate if and how that can impact the |
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
# Conflicts: # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java # ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java
2c4dde7
to
79424b6
Compare
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
…rict Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
# Conflicts: # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java # ethereum/core/src/test/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulatorTest.java
* EIP-7825: Transaction gas limit cap (#8700) * EIP-7825: Transaction gas limit cap Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> * Support transaction gas limit cap when simulating a tx Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> * Do not allow isAllowExceedingGasLimit for when block simulation is strict Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> --------- Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> * EIP-7823 - Modexp upper bounds (#8632) Signed-off-by: Simon Dudley <simon.dudley@consensys.net> * Change Maven artifactIds to avoid possible collisions with other libs (#8589) * Improve Maven artifacts naming to avoid possible collisions with other libs Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> * Rename besu subproject to app (#8746) * Rename `besu` module to `app` Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> * Implement percentiles array size limit for eth_feeHistory (#8748) * implement percentiles array size limit for eth_feeHistory Signed-off-by: garyschulte <garyschulte@gmail.com> * Revert "feat: remove chain head check if peer supports eth/69 (#8725)" (#8753) This reverts commit ed1086d. Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> --------- Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> Signed-off-by: Simon Dudley <simon.dudley@consensys.net> Signed-off-by: garyschulte <garyschulte@gmail.com> Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net> Co-authored-by: Simon Dudley <simon.dudley@consensys.net> Co-authored-by: garyschulte <garyschulte@gmail.com>
PR description
Built on top of #8736
Implement EIP-7825: Transaction gas limit cap
The gas limit cap is driven by the protocol schedule, and at Osaka fork will be 30M, while before Osaka it is Long.MAX_VALUE that is a safe assumption, since no transactions have every or will reach that value before Osaka activation.
The 30M value is currently hard coded, but a future development can make it configurable, in case there is a need for that feature.
The transaction gas limit cap is also supported during simulations, with the following behavior:
rpc_gas_cap
Fixed Issue(s)
fixes #8604
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew spotlessApply
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests