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

all: improve EstimateGas API #632

Open
wants to merge 1 commit into
base: dev-upgrade
Choose a base branch
from

Conversation

JukLee0ira
Copy link

@JukLee0ira JukLee0ira commented Sep 3, 2024

Proposed changes

PR 20830 separate consensus errors and EVM Internal errors.Since EVM errors have already been separated in #200 , this PR will embed EVM errors into the executionResult structure, following the upstream code.

Test

Before this PR is merged:

  • RPC: http://127.0.0.1:8545 – The changes from this PR are applied.
  • RPC: https://rpc.apothem.network/ – The changes from this PR are not applied.

Request:

RPC="https://rpc.apothem.network"
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "eth_estimateGas",
  "params": [
    {
      "from": "0xf366aa107A5Ed1d54AFDEA5506B3059Ce402Da28",
      "to": "0x53381ac6FE72C3cf469891F46248dc3dc02E8EA3",
      "data": "0xabcd012345"
    },
    "latest"
  ]}' | jq

Response:

{"jsonrpc":"2.0","id":0,"result":"0x535c"}

Request:

RPC="http://127.0.0.1:8545"
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "eth_estimateGas",
  "params": [
    {
      "from": "0xf366aa107A5Ed1d54AFDEA5506B3059Ce402Da28",
      "to": "0x53381ac6FE72C3cf469891F46248dc3dc02E8EA3",
      "data": "0xabcd012345"
    },
    "latest"
  ]}' | jq

Response:

{"jsonrpc":"2.0","id":0,"result":"0x535c"}

Types of changes

What types of changes does your code introduce to XDC network?
Put an in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Regular KTLO or any of the maintaince work. e.g code style
  • CICD Improvement
  • N/A

Impacted Components

Which part of the codebase this PR will touch base on,

Put an in the boxes that apply

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Checklist

Put an in the boxes once you have confirmed below actions (or provide reasons on not doing so) that

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

@gzliudan gzliudan changed the title all: improve EstimateGas API WIP: all: improve EstimateGas API Sep 5, 2024
@gzliudan gzliudan changed the title WIP: all: improve EstimateGas API [WIP] all: improve EstimateGas API Sep 9, 2024
@JukLee0ira JukLee0ira force-pushed the evm-execution-result branch 10 times, most recently from 4be9366 to 6a89145 Compare September 13, 2024 03:10
@JukLee0ira JukLee0ira marked this pull request as ready for review September 13, 2024 03:10
@JukLee0ira JukLee0ira changed the title [WIP] all: improve EstimateGas API all: improve EstimateGas API Sep 18, 2024
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