0

I'm trying to run an undelegation+transaction of all my XTZ to an unrevealed account on Delphinet (7.5). This also happens in Carthagenet so I'm guessing is a calculation error on my part:

The first thing I do is dry-run the operation. The run_operation simulation gives me:

{
    "contents": [
        {
            "kind": "delegation",
            "source": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
            "fee": "0",
            "counter": "780743",
            "gas_limit": "800000",
            "storage_limit": "60000",
            "metadata": {
                "balance_updates": [

                ],
                "operation_result": {
                    "status": "applied",
                    "consumed_gas": "1000",
                    "consumed_milligas": "1000000"
                }
            }
        },
        {
            "kind": "transaction",
            "source": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
            "fee": "0",
            "counter": "780744",
            "gas_limit": "800000",
            "storage_limit": "60000",
            "amount": "27818571",
            "destination": "tz1crghTXjGHpecfMsoMcvV8FA3JqUkBnDEn",
            "metadata": {
                "balance_updates": [

                ],
                "operation_result": {
                    "status": "applied",
                    "balance_updates": [
                        {
                            "kind": "contract",
                            "contract": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                            "change": "-27818571"
                        },
                        {
                            "kind": "contract",
                            "contract": "tz1crghTXjGHpecfMsoMcvV8FA3JqUkBnDEn",
                            "change": "27818571"
                        },
                        {
                            "kind": "contract",
                            "contract": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                            "change": "-64250"
                        }
                    ],
                    "consumed_gas": "1427",
                    "consumed_milligas": "1427000",
                    "allocated_destination_contract": true
                }
            }
        }
    ]
}

I use that response and the forge result to calculate gas, storage and baker fee. For storage I parse the simulation response and check for paid_storage_size_diff field to add to the "consumed storage".

I run the /preapply sending this:

[
    {
        "protocol": "PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",
        "contents": [
            {
                "storage_limit": "0",
                "gas_limit": "1100",
                "source": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                "counter": "780743",
                "kind": "delegation",
                "fee": "2555"
            },
            {
                "amount": "27818571",
                "storage_limit": "0",
                "gas_limit": "1527",
                "kind": "transaction",
                "fee": "2625",
                "destination": "tz1crghTXjGHpecfMsoMcvV8FA3JqUkBnDEn",
                "source": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                "counter": "780744"
            }
        ],
        "signature": "edsig...Pbeo",
        "branch": "BM4p7UaW59i1ScvHnTBc3BUZ31MxeKtp3jsEpjiKjDE5wsS74WL"
    }
]

And get a proto.007-PsDELPH1.storage_exhausted.operation error as operation_result of the transaction.

[
    {
        "contents": [
            {
                "kind": "delegation",
                "source": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                "fee": "2555",
                "counter": "780743",
                "gas_limit": "1100",
                "storage_limit": "0",
                "metadata": {
                    "balance_updates": [
                        {
                            "kind": "contract",
                            "contract": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                            "change": "-2555"
                        },
                        {
                            "kind": "freezer",
                            "category": "fees",
                            "delegate": "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU",
                            "cycle": 92,
                            "change": "2555"
                        }
                    ],
                    "operation_result": {
                        "status": "backtracked",
                        "consumed_gas": "1000",
                        "consumed_milligas": "1000000"
                    }
                }
            },
            {
                "kind": "transaction",
                "source": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                "fee": "2625",
                "counter": "780744",
                "gas_limit": "1527",
                "storage_limit": "0",
                "amount": "27818571",
                "destination": "tz1crghTXjGHpecfMsoMcvV8FA3JqUkBnDEn",
                "metadata": {
                    "balance_updates": [
                        {
                            "kind": "contract",
                            "contract": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                            "change": "-2625"
                        },
                        {
                            "kind": "freezer",
                            "category": "fees",
                            "delegate": "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU",
                            "cycle": 92,
                            "change": "2625"
                        }
                    ],
                    "operation_result": {
                        "status": "backtracked",
                        "errors": [
                            {
                                "kind": "temporary",
                                "id": "proto.007-PsDELPH1.storage_exhausted.operation"
                            }
                        ],
                        "balance_updates": [
                            {
                                "kind": "contract",
                                "contract": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                                "change": "-27818571"
                            },
                            {
                                "kind": "contract",
                                "contract": "tz1crghTXjGHpecfMsoMcvV8FA3JqUkBnDEn",
                                "change": "27818571"
                            },
                            {
                                "kind": "contract",
                                "contract": "tz1Ydpp4ibTrGSPn2i6cqQZ6arWieUbcfWVn",
                                "change": "-64250"
                            }
                        ],
                        "consumed_gas": "1427",
                        "consumed_milligas": "1427000",
                        "allocated_destination_contract": true
                    }
                }
            }
        ],
        "signature": "edsig...Pbeo"
    }
]

What I'm missing on my calculations?

2

storage_exhausted means the storage_limit you have set is too low for your operation.

You have set 0. Your dry-run came back with "allocated_destination_contract": true. You need to pay an allocation fee to cover the cost of assigning the new address. Set your storage limit to 257

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.