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

Operation failed: 22:0 + 2, maximum offset value exceeded error while executing a transaction #1246

Closed
kkovaacs opened this issue Jun 16, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@kkovaacs
Copy link
Contributor

Describe the bug
While re-executing mainnet transaction 0x00ae9ae3059d3d85f2ae7f30ef703838c91bc7ac96b69b0606e05b41eb228946 I'm getting the following execution error:

Error at pc=0:4418:
Operation failed: 22:0 + 2, maximum offset value exceeded
Cairo traceback (most recent call last):
Unknown location (pc=0:1498)
Unknown location (pc=0:3561)

To Reproduce
Re-execute the transaction above.

Expected behavior
I'd expect the transaction to execute successfully.

Additional context
Execution seems to work just fine using cairo-lang. Fairly easy to test with the following JSON-RPC request:

curl -v --json '{
    "jsonrpc": "2.0",
    "id": "0",
    "method": "starknet_estimateFee",
    "params": {
        "request": {
            "type": "INVOKE",
            "max_fee": "0x223ae6125018d",
            "version": "0x1",
            "signature": [
                "0x46fa368940f191c89654c7a07f31d76424f53d08bb589b0ff8e62d218a63c75",
                "0x4a89058e781b582ecf4cf30793c9e5a0a9985880c9f1d501b95a8d3edc0038e"
            ],
            "nonce": "0x8",
            "sender_address": "0x2c133a0c1b78b0b16cf787bfeeb6a8978ef26e9d97a993cc7ffce9d192a313",
            "calldata": [
                "0x7",
                "0x5b456031650c1de9eec123d3e7d06a684d321a346d4a7cac9fd86c2b77cf70f",
                "0x34ca17ba0da4a2d6eb37fc61d82b68793d4b3bb23aeef721bc6045152fcfc00",
                "0x9",
                "0x2c133a0c1b78b0b16cf787bfeeb6a8978ef26e9d97a993cc7ffce9d192a313",
                "0x71539945d31799e04899aed68e7510db",
                "0xaf7",
                "0x1",
                "0x0",
                "0x188b208e802",
                "0x2",
                "0x64645b8f957a24af6b49b508e31e51b830966fd5cc9292125ac94fa4c6d8ccd",
                "0x1460191344144d26bbfdc82af69f7ce25cc75502facee5f9755c17cf31cc7d9",
                "0x5b456031650c1de9eec123d3e7d06a684d321a346d4a7cac9fd86c2b77cf70f",
                "0x34ca17ba0da4a2d6eb37fc61d82b68793d4b3bb23aeef721bc6045152fcfc00",
                "0x9",
                "0x2c133a0c1b78b0b16cf787bfeeb6a8978ef26e9d97a993cc7ffce9d192a313",
                "0x2daab8ea9e7e1055d7eaf39b1cac403b",
                "0xf82",
                "0x1",
                "0x0",
                "0x188b208e7a9",
                "0x2",
                "0x60e33dbbaa08af237d1dbcfac264c13c9d8daece5a12902f2360e3bd31e25a1",
                "0x50fd5bc0d7bac008e103e5e035f9ce82d6a90ea696b91fd34d68103ae078f8a",
                "0x5b456031650c1de9eec123d3e7d06a684d321a346d4a7cac9fd86c2b77cf70f",
                "0x34ca17ba0da4a2d6eb37fc61d82b68793d4b3bb23aeef721bc6045152fcfc00",
                "0x9",
                "0x2c133a0c1b78b0b16cf787bfeeb6a8978ef26e9d97a993cc7ffce9d192a313",
                "0x8c7ae5c732ebaebbc79071123ced50c7",
                "0xf3d",
                "0x1",
                "0x0",
                "0x188b208e74f",
                "0x2",
                "0x16b7192b78059d7ffe1512024e9532d809ddece2b6a7e6248cbca410977c1e2",
                "0x4f360e0d4e2a6bc51c447ee18fb65dbf5d4587959842807d451a03abc6f2265",
                "0x5b456031650c1de9eec123d3e7d06a684d321a346d4a7cac9fd86c2b77cf70f",
                "0x34ca17ba0da4a2d6eb37fc61d82b68793d4b3bb23aeef721bc6045152fcfc00",
                "0x9",
                "0x2c133a0c1b78b0b16cf787bfeeb6a8978ef26e9d97a993cc7ffce9d192a313",
                "0x43589d9ebebb49a29272448fc6b9542",
                "0xf6f",
                "0x1",
                "0x0",
                "0x188b208e6f7",
                "0x2",
                "0x4aebc088858a761831528b406c99081f5f978fd04dea2bd4d6728fd8e57a79f",
                "0x3cc70304473d07f9105cc368c649bf22a39ae83bcffd56f35c264f91f16f327",
                "0x5b456031650c1de9eec123d3e7d06a684d321a346d4a7cac9fd86c2b77cf70f",
                "0x34ca17ba0da4a2d6eb37fc61d82b68793d4b3bb23aeef721bc6045152fcfc00",
                "0x9",
                "0x2c133a0c1b78b0b16cf787bfeeb6a8978ef26e9d97a993cc7ffce9d192a313",
                "0x366d6ae51f07c6c4223422cacf8e00cc",
                "0x5f",
                "0x1",
                "0x0",
                "0x188b1c08fe9",
                "0x2",
                "0x5582ce99fca258449190e1ae09bf55165b88622dbd4edd200c530c5a425dbed",
                "0x67b4d3a9919fe95e889e410b9a940b261babdae4f346cfdeb00497a97a40da6",
                "0x5b456031650c1de9eec123d3e7d06a684d321a346d4a7cac9fd86c2b77cf70f",
                "0x34ca17ba0da4a2d6eb37fc61d82b68793d4b3bb23aeef721bc6045152fcfc00",
                "0x9",
                "0x2c133a0c1b78b0b16cf787bfeeb6a8978ef26e9d97a993cc7ffce9d192a313",
                "0x7b6818b48dc19285e4a045a3354327dc",
                "0x76d",
                "0x1",
                "0x0",
                "0x188b1997e45",
                "0x2",
                "0x6e82e457da68a74b98707c5a33995c1a8d9df1b99654a2998ecc08bb43d5745",
                "0xc43d3d789a1a428c54aed2ef3b1914e81541f4f8d65880d213993428cb1d75",
                "0x5b456031650c1de9eec123d3e7d06a684d321a346d4a7cac9fd86c2b77cf70f",
                "0x3556ee435402e506fc85acb898a9acb9daf2855fdec20673ec29a8cb1196cb7",
                "0x1d",
                "0x2c133a0c1b78b0b16cf787bfeeb6a8978ef26e9d97a993cc7ffce9d192a313",
                "0x744f02e8b25f48d70fc865bfe2d1282a796f68607ed19c20a99b151b86b5ebc",
                "0x6",
                "0x71539945d31799e04899aed68e7510db",
                "0xaf7",
                "0x2daab8ea9e7e1055d7eaf39b1cac403b",
                "0xf82",
                "0x8c7ae5c732ebaebbc79071123ced50c7",
                "0xf3d",
                "0x43589d9ebebb49a29272448fc6b9542",
                "0xf6f",
                "0x366d6ae51f07c6c4223422cacf8e00cc",
                "0x5f",
                "0x7b6818b48dc19285e4a045a3354327dc",
                "0x76d",
                "0x6",
                "0x1",
                "0x0",
                "0x1",
                "0x0",
                "0x1",
                "0x0",
                "0x1",
                "0x0",
                "0x1",
                "0x0",
                "0x1",
                "0x0",
                "0x0"
            ]
        },
        "block_id": {
            "block_number": 82026
        }
    }
}' http://localhost:9545/rpc/v0.2
@kkovaacs
Copy link
Contributor Author

The transaction above seems to work just fine using starknet-in-rust (that in turn uses cairo-rs 0.5.2) but fails with blockifier (uses cairo-rs 0.5.1). I suspect this might have been fixed by #1218.

@Oppen
Copy link
Contributor

Oppen commented Jun 19, 2023

It looks like you're right. There's a substraction that still reports the error as if it were a sum, so it's quite possible that we're trying to do 22:0 - 2 which is out of bounds. But if that's the case, the error is correct (AFAICT) and the behavior shouldn't be different between 0.5.2 and 0.5.1 (it's not the same region that changes).

@github-project-automation github-project-automation bot moved this from In Progress to Done in Starknet Jun 21, 2023
@pefontana
Copy link
Collaborator

pefontana commented Jun 21, 2023

Great @kkovaacs !
If you found a new bug please ping us!

@alonh5
Copy link
Contributor

alonh5 commented Jun 26, 2023

This is now fixed in blockifier's main-v0.12.0 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

5 participants