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

Support rpc pending block tag when estimating gas #7951

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

fab-10
Copy link
Contributor

@fab-10 fab-10 commented Nov 27, 2024

PR description

Implement proper support for pending block tag in estimate gas related RPC methods: eth_estimateGas and eth_createAccessList, since until now pending tag was just an alias for latest, 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?

  • 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:

  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

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
# 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
@fab-10 fab-10 force-pushed the support-rpc-pending-block-tag branch 2 times, most recently from 0f144e8 to 665f9b6 Compare November 28, 2024 14:31
Signed-off-by: Fabio Di Fabio <[email protected]>
@fab-10 fab-10 force-pushed the support-rpc-pending-block-tag branch from 665f9b6 to 2850b15 Compare November 28, 2024 15:15
@fab-10 fab-10 changed the title Support rpc pending block tag Support rpc pending block tag when estimating gas Nov 28, 2024
# 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]>
@fab-10 fab-10 force-pushed the support-rpc-pending-block-tag branch from e489386 to 5082d99 Compare December 2, 2024 14:36
Signed-off-by: Fabio Di Fabio <[email protected]>
@fab-10 fab-10 force-pushed the support-rpc-pending-block-tag branch from 5082d99 to 8794721 Compare December 2, 2024 15:47
@fab-10 fab-10 marked this pull request as ready for review December 2, 2024 15:54
@fab-10 fab-10 self-assigned this Dec 2, 2024
Signed-off-by: Fabio Di Fabio <[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.

1 participant