-
Notifications
You must be signed in to change notification settings - Fork 873
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
Support rpc pending block tag when estimating gas #7951
Support rpc pending block tag when estimating gas #7951
Conversation
Signed-off-by: Fabio Di Fabio <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
# Conflicts: # besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java # besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java # besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java # besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java # consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/CliqueProtocolSchedule.java # consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/CliqueProtocolScheduleTest.java # consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueBlockCreatorTest.java # consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueMinerExecutorTest.java # consensus/common/src/main/java/org/hyperledger/besu/consensus/common/MigratingProtocolContext.java # consensus/common/src/test/java/org/hyperledger/besu/consensus/common/MigratingProtocolContextTest.java # consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftProtocolScheduleTest.java # ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java # ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EthGetBlockByNumberLatestDesyncIntegrationTest.java # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/JsonRpcMethodsFactory.java # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/TraceJsonRpcMethods.java # ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/AbstractEthGraphQLHttpServiceTest.java # ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java # ethereum/blockcreation/src/test/java/org/hyperledger/besu/ethereum/blockcreation/BlockMinerTest.java # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/ConsensusContextFactory.java # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/MainnetBlockValidator.java # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/ProtocolContext.java # ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockchainSetupUtil.java # ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/ExecutionContextTestFixture.java # ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java # ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServer.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fullsync/FullSyncTargetManagerTest.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/tasks/DetermineCommonAncestorTaskParameterizedTest.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/tasks/DetermineCommonAncestorTaskTest.java # ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java # ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/BlockchainReferenceTestCaseSpec.java # ethereum/retesteth/build.gradle # ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/RetestethContext.java
# Conflicts: # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCallMany.java # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java
# Conflicts: # besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java # consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/CliqueDifficultyCalculator.java # consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/CliqueProtocolSchedule.java # consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/headervalidationrules/CliqueDifficultyValidationRule.java # consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/CliqueDifficultyCalculatorTest.java # ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java
Signed-off-by: Fabio Di Fabio <[email protected]>
# Conflicts: # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthEstimateGas.java # plugin-api/build.gradle
Signed-off-by: Fabio Di Fabio <[email protected]>
# Conflicts: # metrics/core/src/main/java/org/hyperledger/besu/metrics/noop/NoOpMetricsSystem.java # plugin-api/build.gradle
# Conflicts: # plugin-api/build.gradle
…ding-block-tag # Conflicts: # besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java # besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java # besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java # besu/src/test/java/org/hyperledger/besu/controller/MergeBesuControllerBuilderTest.java # ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/GraphQLContextType.java # ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java
Signed-off-by: Fabio Di Fabio <[email protected]>
0f144e8
to
665f9b6
Compare
Signed-off-by: Fabio Di Fabio <[email protected]>
665f9b6
to
2850b15
Compare
# Conflicts: # besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java # besu/src/test/java/org/hyperledger/besu/controller/MergeBesuControllerBuilderTest.java # ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java # ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/AbstractEthGraphQLHttpServiceTest.java # ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java # plugin-api/build.gradle
Signed-off-by: Fabio Di Fabio <[email protected]>
e489386
to
5082d99
Compare
Signed-off-by: Fabio Di Fabio <[email protected]>
5082d99
to
8794721
Compare
Signed-off-by: Fabio Di Fabio <[email protected]>
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.
looks pretty good to me - does this not affect eth_call as well?
plugin-api/src/main/java/org/hyperledger/besu/plugin/services/TransactionSimulationService.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
public ProcessableBlockHeader simulatePendingBlockHeader() { |
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.
would it be useful to have a debug or trace log for when this is called
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.
done
# Conflicts: # CHANGELOG.md # ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java # plugin-api/build.gradle
4ab5abb
to
bb9c754
Compare
Signed-off-by: Fabio Di Fabio <[email protected]> Signed-off-by: Daniel Lehrner <[email protected]>
PR description
Implement proper support for
pending
block tag in estimate gas related RPC methods:eth_estimateGas
andeth_createAccessList
, since until nowpending
tag was just an alias forlatest
, while it should simulate what would be the next block, and simulate the tx on that pending block.Fixed Issue(s)
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