hyperledger / besu

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
https://www.hyperledger.org/projects/besu
Apache License 2.0
1.44k stars 765 forks source link

Small optimization on eth_sendRawTransaction #7101

Closed ahamlat closed 2 months ago

ahamlat commented 2 months ago

PR description

This PR is a small improvement on eth_sendRawTransaction, as it notifies the listeners on added transactions asynchronously. The PR also pre-calculates the sender of the transaction which is more a mitigation of the synchronized on LayeredPendingTransactions.addTransaction, the sender can be calculated by one the thread of ForkjoinPool.commonPool while the main thread is locking on syncronized.

image

Fixed Issue(s)

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

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