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

Effective gas price #4759

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

Effective gas price #4759

wants to merge 10 commits into from

Conversation

Frozen
Copy link
Contributor

@Frozen Frozen commented Sep 17, 2024

This PR address this issue by setting the effectiveGasPrice to the transaction gas price. It is not implementing the full EIP 1559.

EffectiveGasPricefield added to TxRusult. Added json and rlp serialization tests.

@Frozen Frozen self-assigned this Sep 17, 2024
@Frozen Frozen force-pushed the feature/effective-gas-price branch from 9ddc0cd to c6faf4c Compare September 17, 2024 20:44
@Frozen Frozen marked this pull request as ready for review September 20, 2024 16:43
@Frozen Frozen force-pushed the feature/effective-gas-price branch from 0bb2b32 to e3a5dd6 Compare September 20, 2024 17:40
rpc/harmony/v2/types.go Outdated Show resolved Hide resolved
@sophoah
Copy link
Contributor

sophoah commented Sep 23, 2024

@Frozen During my test, effectiveGasPrice field in the transaction receipt is still not available. I checked eth_getTransactionReceipt and hmy_getTransactionReceipt

Please make sure the effectiveGasPrice is the same as the gasPrice

@Frozen Frozen force-pushed the feature/effective-gas-price branch 2 times, most recently from a230a06 to af35364 Compare September 27, 2024 21:10
@sophoah
Copy link
Contributor

sophoah commented Sep 30, 2024

@Frozen hmyv1 and v2 APIs has the hex vs decimal difference see below effectiveGasPrice in decimal vs cumulatedGasPrice in hex

{
  "transaction-hash": "0x6ce7fd454c5c3e642a4573bd684f28acaf5f5478dddf56f1ec64c8808b57190a",
  "blockchain-receipt": {
    "blockHash": "0xfacba8e14ccd7ae0e066df602b49251a09bccd510597fa8f5c17b0859df493f0",
    "blockNumber": "0x9",
    "contractAddress": "0x0000000000000000000000000000000000000000",
    "cumulativeGasUsed": "0x5208",
    "effectiveGasPrice": 100000000000,
    "from": "one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur",
    "gasUsed": "0x5208",
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "root": "0x",
    "shardID": 0,
    "status": "0x1",
    "to": "one19zzwsxr0uf2fe34y8qkadek2v0eh6h5mg2deg6",
    "transactionHash": "0x6ce7fd454c5c3e642a4573bd684f28acaf5f5478dddf56f1ec64c8808b57190a",
    "transactionIndex": "0x0"
  },
  "time-signed-utc": "2024-09-30 08:17:36.579582"
}

Also eth_getTransactionReceipt still doesn't have the field effectiveGasPrice

{
 "jsonrpc": "2.0",
 "id": 1,
 "result": {
   "blockHash": "0xfacba8e14ccd7ae0e066df602b49251a09bccd510597fa8f5c17b0859df493f0",
   "blockNumber": "0x9",
   "contractAddress": null,
   "cumulativeGasUsed": "0x5208",
   "from": "0x15a128e599b74842bccba860311efa92991bffb5",
   "gasUsed": "0x5208",
   "logs": [],
   "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
   "status": "0x1",
   "to": "0x2884e8186fe2549cc6a4382dd6e6ca63f37d5e9b",
   "transactionHash": "0xad611cd8342d244e74f64888309fdf819c23f308f425edbeee289492729ae47a",
   "transactionIndex": "0x0"
 }
}

@Frozen Frozen force-pushed the feature/effective-gas-price branch from af35364 to 150f2f5 Compare October 14, 2024 22:22
@Frozen
Copy link
Contributor Author

Frozen commented Oct 16, 2024

Fixed json hex view for effectiveGasPrice

  "cumulativeGasUsed": "0x5208",
  "effectiveGasPrice": "0x17480",

@sophoah
Copy link
Contributor

sophoah commented Oct 17, 2024

eth_getTransactionReceipt and the blockchain receipt generated by the hmy command during a transfer works now.

Could you check hmy_getTransactionReceipt and hmyv2_getTransactionReceipt ? those would be the last ones that should require the field effectiveGasPrice

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.

2 participants