Skip to content

Conversation

fab-10
Copy link
Contributor

@fab-10 fab-10 commented Jun 3, 2025

PR description

This PR refreshes the TransactionSimulatorTest to ensure the block gas limit is always set, this also permit to simplify the TransactionSimulator code to avoid the special case when blockGasLimit is zero, that was in place only to support the unit tests, while in real world that never happens.

Fixed Issue(s)

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

@@ -521,17 +521,10 @@ public long calculateSimulationGasCap(
}
} else {
if (rpcGasCap > 0) {
if (blockGasLimit > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

block gas limit is always greater than zero, the zero case was only there because tests were not setting it

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 force-pushed the refresh-transaction-simulator-tests branch from 6f718f1 to 71c544a Compare June 3, 2025 13:42
@fab-10 fab-10 changed the title Refresh transaction simulator tests Block gas limit is always positive Jun 3, 2025
@fab-10 fab-10 marked this pull request as ready for review June 3, 2025 13:46
@fab-10 fab-10 mentioned this pull request Jun 3, 2025
9 tasks
@Gabriel-Trintinalia Gabriel-Trintinalia merged commit afa1e04 into hyperledger:main Jun 4, 2025
48 checks passed
@fab-10 fab-10 deleted the refresh-transaction-simulator-tests branch June 4, 2025 07:33
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.

3 participants