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

Juno traces overestimate data_availability #2114

Open
rianhughes opened this issue Sep 2, 2024 · 0 comments · May be fixed by #2118
Open

Juno traces overestimate data_availability #2114

rianhughes opened this issue Sep 2, 2024 · 0 comments · May be fixed by #2118
Assignees

Comments

@rianhughes
Copy link
Contributor

rianhughes commented Sep 2, 2024

There are two issues:

  1. Over charging fees for certain transactions (declare v0 and v1 - likely form abi-len not being set to zero). This affects the state diff (fee token balances will not update to values that should match those in the receipts) and potentially events (eg if the output depends on the fee charged). Fix: set abi-len to zero for v0 classes.
  2. the values in data_availability (sees we set the incorrect value). Fix: pass data_availability/data_gas directly from blockifier to users.
{
    "jsonrpc": "2.0",
    "method": "starknet_traceTransaction",
    "params": {
        "transaction_hash": "0x624eb5674b92db7a3fdc6b155c079645399bfb478b84be7e6328c4ed498586e"
    },
    "id": 1
}

Juno returns

"data_availability": {
                "l1_gas": 714251, (note this should actually be 707513, even though it's not in the receipts etc)
                "l1_data_gas": 0
            }

but both the receipt, and pathfinder return

  "data_availability": {
                "l1_gas": 1652,
                "l1_data_gas": 0
            }

Also, notice that the storage-diffs and events are different

Pathfinder

"storage_diffs": [
                {
                    "address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
                    "storage_entries": [
                        {
                            "key": "0x5496768776e3db30053404f18067d81a6e06f5a2b0de326e21298fd9d569a9a",
                            "value": "0x1e8ed57a80a39cd97b"
                        },
                        {
                            "key": "0x731014fb7868e8a2e5473b53ac436488e4666c5bfe28653f6e79c1d62e10520",
                            "value": "0x28cd47b6a65ff85b"
                        }
                    ]
                }
            ]

vs Juno

 "storage_diffs": [
                {
                    "address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
                    "storage_entries": [
                        {
                            "key": "0x5496768776e3db30053404f18067d81a6e06f5a2b0de326e21298fd9d569a9a",
                            "value": "0x1e8ed7bb8fca60095d"
                        },
                        {
                            "key": "0x731014fb7868e8a2e5473b53ac436488e4666c5bfe28653f6e79c1d62e10520",
                            "value": "0x28cb06a77f9cc879"
                        }
                    ]
                }
            ],

Events

From receipt

  "events": [
            {
                "from_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
                "keys": [
                    "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"
                ],
                "data": [
                    "0x4ead367641eb121d5c2ee8cfa589fc843d58b94125e317564aab00cca838841",
                    "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
                    "0xecb12f29666301",
                    "0x0"
                ]
            }
        ],

Juno

 "events": [
                {
                    "order": 0,
                    "keys": [
                        "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"
                    ],
                    "data": [
                        "0x4ead367641eb121d5c2ee8cfa589fc843d58b94125e317564aab00cca838841",
                        "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
                        "0xeef23e502992e3",
                        "0x0"
                    ]
                }
            ],
@rianhughes rianhughes self-assigned this Sep 2, 2024
@rianhughes rianhughes linked a pull request Sep 4, 2024 that will close this issue
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 a pull request may close this issue.

1 participant