Skip to content

BAL: check max item size before bal hash#10231

Draft
daniellehrner wants to merge 1 commit intobesu-eth:mainfrom
daniellehrner:fix/move_bal_exceeds_items_check
Draft

BAL: check max item size before bal hash#10231
daniellehrner wants to merge 1 commit intobesu-eth:mainfrom
daniellehrner:fix/move_bal_exceeds_items_check

Conversation

@daniellehrner
Copy link
Copy Markdown
Contributor

PR description

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
  • hive tests: Engine or other RPCs modified?

Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
if (blockAccessListBuilder.isPresent()) {
final BlockAccessList bal = blockAccessListBuilder.get().build();

final long itemCost = protocolSpec.getGasCalculator().getBlockAccessListItemCost();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

* @param itemCost per-item gas cost from the gas calculator
* @return true if the BAL exceeds the gas-limit-derived item cap
*/
public static boolean exceedsItemLimit(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

static call seems to be wrong as it will not be possible to have a behavior linked to a specific fork anymore

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.

2 participants