Skip to content

Use PendingTransaction interface in block creation classes#8254

Merged
fab-10 merged 1 commit intobesu-eth:mainfrom
fab-10:use-PendingTransaction-interface-in-block-creation
Feb 5, 2025
Merged

Use PendingTransaction interface in block creation classes#8254
fab-10 merged 1 commit intobesu-eth:mainfrom
fab-10:use-PendingTransaction-interface-in-block-creation

Conversation

@fab-10
Copy link
Copy Markdown
Contributor

@fab-10 fab-10 commented Feb 5, 2025

PR description

This PR is a prerequisite for letting plugins propose pending transaction during block creation, it removes the assumption that during block creation all pending transactions are of our internal type org.hyperledger.besu.ethereum.eth.transactions.PendingTransaction using the PendingTransaction interface instead.
No functional changes introduced by this PR.

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

@fab-10 fab-10 marked this pull request as ready for review February 5, 2025 15:47
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 force-pushed the use-PendingTransaction-interface-in-block-creation branch from c46518b to 08a62f0 Compare February 5, 2025 17:47
Copy link
Copy Markdown
Contributor

@garyschulte garyschulte left a comment

Choose a reason for hiding this comment

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

🚢

public Transaction getTransaction() {
return pendingTransaction.getTransaction();
// ToDo: can we avoid this cast? either by always using the interface
// or moving our Transaction implementation in the datatypes package
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.

seems ok to cast for now, but I like the notion of always using the interface long term. hopefully this doesn't just move the class cast exception into the plugin implementation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the plugins need to use Besu internal Transaction implementation, using the interface is a big change, but I think we should do it at some point

@fab-10 fab-10 merged commit a818793 into besu-eth:main Feb 5, 2025
@fab-10 fab-10 deleted the use-PendingTransaction-interface-in-block-creation branch February 5, 2025 20:31
pullurib pushed a commit to pullurib/besu that referenced this pull request Feb 6, 2025
…8254)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
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