-
Notifications
You must be signed in to change notification settings - Fork 929
Extend simulate transaction on pending block plugin API #8174
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
Extend simulate transaction on pending block plugin API #8174
Conversation
578f11d
to
7a37179
Compare
Signed-off-by: Fabio Di Fabio <[email protected]>
7a37179
to
79579ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, non-blocking feedback
operationTracer, | ||
transactionSimulator.simulatePendingBlockHeader()) | ||
(org.hyperledger.besu.ethereum.core.ProcessableBlockHeader) pendingBlockHeader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we change the import in TransactionSimulator and BlockHashProcessor to org.hyperledger.besu.plugin.data.ProcessableBlockHeader, we do not need this cast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried but found much more places to change and gave up
if (maybeBlockHash.isPresent()) { | ||
final Hash blockHash = maybeBlockHash.get(); | ||
final var maybeBlockHeader = | ||
blockchain.getBlockHeader(blockHash).or(() -> blockchain.getBlockHeaderSafe(blockHash)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be just a call to getBlockHeaderSafe() since it defers to getBlockHeader if it is not in the cache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but getBlockHeaderSafe
is always synchronized, so we can a bit doing first the non synchronized way
…8174) Signed-off-by: Fabio Di Fabio <[email protected]> Signed-off-by: Daniel Lehrner <[email protected]>
* fixes syntax errors (hyperledger#8164) Signed-off-by: jflo <[email protected]> * Pectra testnet fork slots (hyperledger#8163) * adds Prague slot times Signed-off-by: jflo <[email protected]> --------- Signed-off-by: jflo <[email protected]> * Check if discovery service is running before `admin_addPeer` (hyperledger#8160) Signed-off-by: Gabriel-Trintinalia <[email protected]> * update eth_call error message (hyperledger#8129) Signed-off-by: Karim Taam <[email protected]> * Refactor the methods for getting mutable states in the WorldState provider (hyperledger#8113) Refactor the methods for retrieving mutable states in the WorldState provider and make additional improvements to clean up the code. --------- Signed-off-by: Karim Taam <[email protected]> * Extend simulate transaction on pending block plugin API (hyperledger#8174) Signed-off-by: Fabio Di Fabio <[email protected]> * debug_traceBlock use existing block header instead of hash (hyperledger#8184) This means you don't need to have the block already in the chain when you call debug_traceBlock with a block's RLP (you just need the parent). Signed-off-by: Simon Dudley <[email protected]> * fixes warning on sonar analysis (hyperledger#8193) Signed-off-by: jflo <[email protected]> * add spotless to PR checklist (hyperledger#8185) Signed-off-by: Sally MacFarlane <[email protected]> * Reuse constant INVALID_PARAMS_ERROR_CODE for RpcErrorType.java (hyperledger#8154) Magic number "-32602" has been defined in the super interface, so reusing that constant value. Signed-off-by: Andrew Cheng <[email protected]> Co-authored-by: Sally MacFarlane <[email protected]> * Improve BLOCKHASH Short Circuit (hyperledger#8171) * Improve BLOCKHASH Short Circuit Signed-off-by: Danno Ferrin <[email protected]> Co-authored-by: Justin Florentine <[email protected]> * TransactionResult: add v for blob and pending tx (hyperledger#8196) * add v for blob and pending tx Signed-off-by: Sally MacFarlane <[email protected]> * add v for blob and pending tx in tests Signed-off-by: Sally MacFarlane <[email protected]> * add v for blob tx in test Signed-off-by: Sally MacFarlane <[email protected]> --------- Signed-off-by: Sally MacFarlane <[email protected]> * Prague t8n and referenceTests fixes for EEST (hyperledger#8167) Fix referenceTests bug with fallback EMPTY Address. T8n support for excessBlobGas for both state tests and blockchain test. State tests should use the given excessBlobGas rather than computing from the parent header. Signed-off-by: Simon Dudley <[email protected]> * disable fast sync actions test Signed-off-by: Sally MacFarlane <[email protected]> --------- Signed-off-by: jflo <[email protected]> Signed-off-by: Gabriel-Trintinalia <[email protected]> Signed-off-by: Karim Taam <[email protected]> Signed-off-by: Fabio Di Fabio <[email protected]> Signed-off-by: Simon Dudley <[email protected]> Signed-off-by: Sally MacFarlane <[email protected]> Signed-off-by: Andrew Cheng <[email protected]> Co-authored-by: Justin Florentine <[email protected]> Co-authored-by: Gabriel-Trintinalia <[email protected]> Co-authored-by: Karim Taam <[email protected]> Co-authored-by: Fabio Di Fabio <[email protected]> Co-authored-by: Simon Dudley <[email protected]> Co-authored-by: Andrew Cheng <[email protected]> Co-authored-by: Danno Ferrin <[email protected]>
…8174) Signed-off-by: Fabio Di Fabio <[email protected]> Signed-off-by: Bhanu Pulluri <[email protected]>
PR description
Extend the simulate transaction plugin API to allow for plugin to access the pending block header, and giving the possibility of allowing future nonce during the simulation, for example we accepting txs to the txpool, also the coinbase of the pending block header is now correctly populated, and removed deprecated methods.
Fixed Issue(s)
fixes #8173
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests