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

Different versions that have inconsistent return field values when calling receipts #11252

Closed
4 of 11 tasks
dubuqingfeng opened this issue Sep 7, 2023 · 4 comments · Fixed by #11357
Closed
4 of 11 tasks
Labels

Comments

@dubuqingfeng
Copy link

Checklist

  • This is not a security-related bug/issue. If it is, please follow please follow the security policy.
  • I have searched on the issue tracker and the lotus forum, and there is no existing related issue or discussion.
  • I am running the Latest release, the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.
  • I did not make any code changes to lotus.

Lotus component

  • lotus daemon - chain sync
  • lotus fvm/fevm - Lotus FVM and FEVM interactions
  • lotus miner/worker - sealing
  • lotus miner - proving(WindowPoSt/WinningPoSt)
  • lotus JSON-RPC API
  • lotus message management (mpool)
  • Other

Lotus Version

v1.22.1

v1.23.3

Repro Steps

No response

Describe the Bug

We have two nodes with different versions that have inconsistent return field values when calling receipts

v1.23.3:

"effectiveGasPrice":"0x21b84"

v1.22.1:

"effectiveGasPrice":"0x21b82"

Logging Information

v1.23.3


➜  ~ curl --location --request POST 'https://v1.23.3/rpc/v1' \
--header 'Content-Type: application/json; charset=utf-8' \
--data '
    {
        "id": 744,
        "jsonrpc": "2.0",
        "method": "eth_getTransactionReceipt",
        "params": [
            "0x6accb8eb1ef2eb0a0d9a1262dd8dbc94efe4afff8479951d05a6ee65f97991a2"
        ]
    }
'

{"jsonrpc":"2.0","result":{"transactionHash":"0x6accb8eb1ef2eb0a0d9a1262dd8dbc94efe4afff8479951d05a6ee65f97991a2","transactionIndex":"0x12","blockHash":"0x8d0220c486c6f3f387245bf63b24ccce069a5f1df9b57ca79189966fcbb87465","blockNumber":"0x30b34f","from":"0xff000000000000000000000000000000001f24c5","to":"0xff000000000000000000000000000000001f43de","root":"0x0000000000000000000000000000000000000000000000000000000000000000","status":"0x1","contractAddress":null,"cumulativeGasUsed":"0x0","gasUsed":"0x39450d1","effectiveGasPrice":"0x21b84","logsBloom":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","logs":[],"type":"0x2"},"id":744}

v1.22.1

 curl --location --request POST 'http://v1.22.1/rpc/v1' \
> --header 'Content-Type: application/json; charset=utf-8' \
> --data '
>     {
>         "id": 744,
>         "jsonrpc": "2.0",
>         "method": "eth_getTransactionReceipt",
>         "params": [
>             "0x6accb8eb1ef2eb0a0d9a1262dd8dbc94efe4afff8479951d05a6ee65f97991a2"
>         ]
>     }'
{"jsonrpc":"2.0","result":{"transactionHash":"0x6accb8eb1ef2eb0a0d9a1262dd8dbc94efe4afff8479951d05a6ee65f97991a2","transactionIndex":"0x12","blockHash":"0x8d0220c486c6f3f387245bf63b24ccce069a5f1df9b57ca79189966fcbb87465","blockNumber":"0x30b34f","from":"0xff000000000000000000000000000000001f24c5","to":"0xff000000000000000000000000000000001f43de","root":"0x0000000000000000000000000000000000000000000000000000000000000000","status":"0x1","contractAddress":null,"cumulativeGasUsed":"0x0","gasUsed":"0x39450d1","effectiveGasPrice":"0x21b82","logsBloom":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","logs":[],"type":"0x2"},"id":744}
@dubuqingfeng
Copy link
Author

other rpc:

$ curl 'https://rpc.ankr.com/filecoin'
--data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x6accb8eb1ef2eb0a0d9a1262dd8dbc94efe4afff8479951d05a6ee65f97991a2"],"id":1}
'
{"jsonrpc":"2.0","result":{"transactionHash":"0x6accb8eb1ef2eb0a0d9a1262dd8dbc94efe4afff8479951d05a6ee65f97991a2","transactionIndex":"0x12","blockHash":"0x8d0220c486c6f3f387245bf63b24ccce069a5f1df9b57ca79189966fcbb87465","blockNumber":"0x30b34f","from":"0xff000000000000000000000000000000001f24c5","to":"0xff000000000000000000000000000000001f43de","root":"0x0000000000000000000000000000000000000000000000000000000000000000","status":"0x1","contractAddress":null,"cumulativeGasUsed":"0x0","gasUsed":"0x39450d1","effectiveGasPrice":"0x21b84","logsBloom":"0xfffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbffffffffffffffffffffffffffffffffffffdffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffffffffffffffffffffff","logs":[],"type":"0x2"},"id":1

curl 'https://api.node.glif.io/'
--data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x6accb8eb1ef2eb0a0d9a1262dd8dbc94efe4afff8479951d05a6ee65f97991a2"],"id":1}
'

{"jsonrpc":"2.0","result":{"transactionHash":"0x6accb8eb1ef2eb0a0d9a1262dd8dbc94efe4afff8479951d05a6ee65f97991a2","transactionIndex":"0x12","blockHash":"0x8d0220c486c6f3f387245bf63b24ccce069a5f1df9b57ca79189966fcbb87465","blockNumber":"0x30b34f","from":"0xff000000000000000000000000000000001f24c5","to":"0xff000000000000000000000000000000001f43de","root":"0x0000000000000000000000000000000000000000000000000000000000000000","status":"0x1","contractAddress":null,"cumulativeGasUsed":"0x0","gasUsed":"0x39450d1","effectiveGasPrice":"0x21b84","logsBloom":"0xf7ffdffdf3fc5ffafffffffcfdbfffd7ffdfd7ffe7e9fdffdfffbfdefefeffffbfffdffffefbefff9fffffffffffb7ffffcffffffaffffffffdffdf7ff7e9ffbffffffffdebffffddefffffffff3dffffffffffefffffbfffff37fffe777effffffbff7fff93bfef3fffffffffffdffffff5f5ffffbff7fff77fffff7bbffffaffffebfffbff7fbfffe7fffdffdfffffffbbbfbfffffe7fffdfffffefeffefffbf7fdff7dfeebfebffffefffd5fffb7fffffefefffefffffffbfffffdeaedff6eeffdffbffffdf7bbfffebffff6f6e7ddf7fffdfdfffffffffffbffffffbfefbbfbffffffffff7ffdbff7defff7ffffaffffefffffdbff5ffffdbff6fffff6a7","logs":[],"type":"0x2"},"id":1}

@rjan90
Copy link
Contributor

rjan90 commented Sep 7, 2023

Hey @dubuqingfeng! These seems to be related to the execution traces changes that happened from v1.22.x --> v1.23.x.

Check out the Execution Trace Format Changes section in https://github.com/filecoin-project/lotus/releases/tag/v1.23.0

@wanyvic
Copy link

wanyvic commented Sep 7, 2023

Hey @dubuqingfeng! These seems to be related to the execution traces changes that happened from v1.22.x --> v1.23.x.

Check out the Execution Trace Format Changes section in https://github.com/filecoin-project/lotus/releases/tag/v1.23.0

lotus/node/impl/full/eth.go

Lines 2275 to 2282 in 7bb1f98

ts, err := cs.GetTipSetFromKey(ctx, lookup.TipSet)
if err != nil {
return api.EthTxReceipt{}, xerrors.Errorf("failed to lookup tipset %s when constructing the eth txn receipt: %w", lookup.TipSet, err)
}
baseFee := ts.Blocks()[0].ParentBaseFee
gasOutputs := vm.ComputeGasOutputs(lookup.Receipt.GasUsed, int64(tx.Gas), baseFee, big.Int(tx.MaxFeePerGas), big.Int(tx.MaxPriorityFeePerGas), true)
totalSpent := big.Sum(gasOutputs.BaseFeeBurn, gasOutputs.MinerTip, gasOutputs.OverEstimationBurn)

The baseFee was taken from the wrong TipSet. Maybe the parent TipSet should be used instead.

ts, err := cs.GetTipSetFromKey(ctx, lookup.TipSet) 
parentTs, err := cs.LoadTipSet(ctx, ts.Parents())
baseFee := parentTs.Blocks()[0].ParentBaseFee 

@Stebalien
Copy link
Member

@wanyvic you're absolutely right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants