Skip to content
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

Improve blob size transaction selector #7312

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

fab-10
Copy link
Contributor

@fab-10 fab-10 commented Jul 12, 2024

PR description

The main goal of this PR is to make clearer the reason a blob tx is not selected during block creation, with the introduction of 2 specifics not selected results:

  • BLOBS_FULL = The block already contains the max number of allowed blobs.
  • TX_TOO_LARGE_FOR_REMAINING_DATA_GAS = The transaction has not been selected since there is not enough remaining data gas in the block to fit the blobs of the tx.

and to achieve that it was clearer to extract the blob tx selection login in its own class BlobSizeTransactionSelector, while doing that a small bug was fixed, since data gas used was added to gas used when computing if a block was full, while these 2 gas types are independent, see here for details.

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:

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

@fab-10 fab-10 force-pushed the blob-size-selector-improvement branch 4 times, most recently from 53f13b9 to b8eec9b Compare July 15, 2024 08:38
return true;
}

return transaction.getGasLimit() + blobGasUsed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding blobGasUsed is incorrect here, since here we only want to check the gas used and not the data gas used

@fab-10 fab-10 marked this pull request as ready for review July 15, 2024 09:34
@Gabriel-Trintinalia
Copy link
Contributor

Gabriel-Trintinalia commented Jul 16, 2024

Can we use the term blob gas instead of data gas? for the variables and transaction selection reasons?

@macfarla
Copy link
Contributor

from reading the description this PR is doing 4 very excellent things, but would be easier to review as several smaller PRs

@fab-10 fab-10 force-pushed the blob-size-selector-improvement branch from b8eec9b to 1c9d469 Compare July 16, 2024 08:20
@fab-10
Copy link
Contributor Author

fab-10 commented Jul 16, 2024

from reading the description this PR is doing 4 very excellent things, but would be easier to review as several smaller PRs

Fair point, splitting in 3 PRs:

first one Stop transaction selection on TX_EVALUATION_TOO_LONG
second one Fix and restore disabled block creation unit tests

the fix to blob gas is related to this refactor so make sense to keep in this PR

@fab-10
Copy link
Contributor Author

fab-10 commented Jul 16, 2024

Can we use the term blob gas instead of data gas? for the variables and transaction selection reasons?

I also like more blob gas because is more common, and I will rename to it, but in many other places we have data gas like the DataGas type, so it is up to another PR to align the naming everywhere

@fab-10 fab-10 force-pushed the blob-size-selector-improvement branch 3 times, most recently from 2de28d5 to b17a880 Compare July 16, 2024 10:44
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 force-pushed the blob-size-selector-improvement branch from b17a880 to 16b455b Compare July 16, 2024 12:36
@fab-10 fab-10 enabled auto-merge (squash) July 16, 2024 12:47
@fab-10 fab-10 merged commit 99260fa into hyperledger:main Jul 16, 2024
40 checks passed
@fab-10 fab-10 deleted the blob-size-selector-improvement branch July 17, 2024 07:40
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