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

Ban zero blob transactions #5425

Merged
merged 9 commits into from
May 5, 2023
Merged

Conversation

fab-10
Copy link
Contributor

@fab-10 fab-10 commented May 3, 2023

PR description

An update to EIP-4844 made zero blob transactions invalid, so this PR adds the check to verify that at least one blob is specified, this check could be done statically when creating the transaction.

Fixed Issue(s)

fixes #5401

Signed-off-by: Fabio Di Fabio <[email protected]>
@github-actions
Copy link

github-actions bot commented May 3, 2023

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.
  • I have considered running ./gradlew acceptanceTestNonMainnet locally if my PR affects non-mainnet modules.
  • I thought about the changelog and included a changelog update if required.
  • If my PR includes database changes (e.g. KeyValueSegmentIdentifier) I have thought about compatibility and performed forwards and backwards compatibility tests

Signed-off-by: Fabio Di Fabio <[email protected]>
builder.maxFeePerGas(maxFeePerGas.orElse(Wei.of(5000)));
builder.accessList(accessListEntries.orElse(List.of()));
builder.maxFeePerDataGas(maxFeePerDataGas.orElse(Wei.ONE));
builder.versionedHashes(versionedHashes.orElse(List.of(Hash.wrap(Bytes32.random()))));
Copy link
Contributor

Choose a reason for hiding this comment

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

Random will produce variable test data. I'd recommend something else like a converted ascii string "Versioned Hash Not Set", padded to 32 bytes.

Also, when random the version byte will almost always be invalid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I forgot to properly format the versioned hash, fixing

@shemnon
Copy link
Contributor

shemnon commented May 3, 2023

Unit tests need help. P2PPlainNetworkTest and TLSContextFactoryTest appear to be because of expired test certs. But TransactionCompleteResultTest feels like a quality hit.

@fab-10
Copy link
Contributor Author

fab-10 commented May 4, 2023

Unit tests need help. P2PPlainNetworkTest and TLSContextFactoryTest appear to be because of expired test certs. But TransactionCompleteResultTest feels like a quality hit.

Test fixed

@fab-10 fab-10 requested a review from shemnon May 4, 2023 12:31
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

LGTM. one comment on a var name in test

fab-10 and others added 3 commits May 5, 2023 10:37
…net/MainnetTransactionValidatorTest.java

Co-authored-by: Sally MacFarlane <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
…net/MainnetTransactionValidatorTest.java

Co-authored-by: Sally MacFarlane <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
@fab-10 fab-10 enabled auto-merge (squash) May 5, 2023 08:40
@fab-10 fab-10 merged commit 8b4819e into hyperledger:main May 5, 2023
@fab-10 fab-10 deleted the 4844-0-blob-txs-invalid branch May 5, 2023 08:57
elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
* Ban zero blob transactions

Signed-off-by: Fabio Di Fabio <[email protected]>

* Update CHANGELOG

Signed-off-by: Fabio Di Fabio <[email protected]>

* Fix tests

Signed-off-by: Fabio Di Fabio <[email protected]>

* Update ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java

Co-authored-by: Sally MacFarlane <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>

* Update ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java

Co-authored-by: Sally MacFarlane <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>

---------

Signed-off-by: Fabio Di Fabio <[email protected]>
Co-authored-by: Stefan Pingel <[email protected]>
Co-authored-by: Sally MacFarlane <[email protected]>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
* Ban zero blob transactions

Signed-off-by: Fabio Di Fabio <[email protected]>

* Update CHANGELOG

Signed-off-by: Fabio Di Fabio <[email protected]>

* Fix tests

Signed-off-by: Fabio Di Fabio <[email protected]>

* Update ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java

Co-authored-by: Sally MacFarlane <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>

* Update ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionValidatorTest.java

Co-authored-by: Sally MacFarlane <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>

---------

Signed-off-by: Fabio Di Fabio <[email protected]>
Co-authored-by: Stefan Pingel <[email protected]>
Co-authored-by: Sally MacFarlane <[email protected]>
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.

Ban Zero Blob Transactions
4 participants