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

Transactions sometimes contain duplicate operations #854

Open
dahemmer opened this issue Nov 29, 2018 · 5 comments
Open

Transactions sometimes contain duplicate operations #854

dahemmer opened this issue Nov 29, 2018 · 5 comments
Assignees

Comments

@dahemmer
Copy link

dahemmer commented Nov 29, 2018

Certain transactions contain duplicate operations. In the example below, the transaction contains 3 operations of which 2 are identical with hash BKeQ9vQZVS1o1BDQJHGN2R64FGDZPomvxQYCjaWUH3rg-5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3

GET https://mainnet.blockchainos.org/api/v1/transactions/5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3/operations

{
    "_embedded": {
        "records": [
            {
                "_links": {
                    "self": {
                        "href": ""
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3"
                    }
                },
                "block_height": 35117,
                "body": {
                    "target": "GCPQQIX2LRX2J63C7AHWDXEMNGMZR2UI2PRN5TCSOVMEMF7BAUADMKH5",
                    "amount": "0",
                    "txs": 0,
                    "block-height": 35116,
                    "block-hash": "AKZrQDKN4SkLfv9cV5Kb1c5dDQHXCFp8gtqaBdz3Ak24",
                    "total-txs": 35756,
                    "total-ops": 0
                },
                "confirmed": "2018-11-29T08:39:37.544066049Z",
                "hash": "GokCh3SRCs8R7baqAxroJLp2GECKawtoqRYN6miEuFam-5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3",
                "proposed_time": "2018-11-29T08:39:37.525279579Z",
                "source": "GAYRF72WHUB7IQYCV7C7A3CARH4OP2GCR4SKBFKQLALAMCSR67RRBTFD",
                "target": "GCPQQIX2LRX2J63C7AHWDXEMNGMZR2UI2PRN5TCSOVMEMF7BAUADMKH5",
                "tx_hash": "5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3",
                "type": "collect-tx-fee"
            },
            {
                "_links": {
                    "self": {
                        "href": ""
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3"
                    }
                },
                "block_height": 35117,
                "body": {
                    "target": "GCPQQIX2LRX2J63C7AHWDXEMNGMZR2UI2PRN5TCSOVMEMF7BAUADMKH5",
                    "amount": "0",
                    "txs": 0,
                    "block-height": 35116,
                    "block-hash": "AKZrQDKN4SkLfv9cV5Kb1c5dDQHXCFp8gtqaBdz3Ak24",
                    "total-txs": 35756,
                    "total-ops": 0
                },
                "confirmed": "2018-11-29T08:39:37.544066049Z",
                "hash": "GokCh3SRCs8R7baqAxroJLp2GECKawtoqRYN6miEuFam-5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3",
                "proposed_time": "2018-11-29T08:39:37.525279579Z",
                "source": "GAYRF72WHUB7IQYCV7C7A3CARH4OP2GCR4SKBFKQLALAMCSR67RRBTFD",
                "target": "GCPQQIX2LRX2J63C7AHWDXEMNGMZR2UI2PRN5TCSOVMEMF7BAUADMKH5",
                "tx_hash": "5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3",
                "type": "collect-tx-fee"
            },
            {
                "_links": {
                    "self": {
                        "href": ""
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3"
                    }
                },
                "block_height": 35117,
                "body": {
                    "target": "GCPQQIX2LRX2J63C7AHWDXEMNGMZR2UI2PRN5TCSOVMEMF7BAUADMKH5",
                    "amount": "500000000",
                    "initial_balance": "5000000000000000",
                    "ratio": "0.00000010000000000",
                    "block-height": 35116,
                    "block-hash": "AKZrQDKN4SkLfv9cV5Kb1c5dDQHXCFp8gtqaBdz3Ak24",
                    "total-txs": 35756,
                    "total-ops": 0
                },
                "confirmed": "2018-11-29T08:39:37.544066049Z",
                "hash": "BKeQ9vQZVS1o1BDQJHGN2R64FGDZPomvxQYCjaWUH3rg-5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3",
                "proposed_time": "2018-11-29T08:39:37.525279579Z",
                "source": "GAYRF72WHUB7IQYCV7C7A3CARH4OP2GCR4SKBFKQLALAMCSR67RRBTFD",
                "target": "GCPQQIX2LRX2J63C7AHWDXEMNGMZR2UI2PRN5TCSOVMEMF7BAUADMKH5",
                "tx_hash": "5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3",
                "type": "inflation"
            },
            {
                "_links": {
                    "self": {
                        "href": ""
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3"
                    }
                },
                "block_height": 35117,
                "body": {
                    "target": "GCPQQIX2LRX2J63C7AHWDXEMNGMZR2UI2PRN5TCSOVMEMF7BAUADMKH5",
                    "amount": "500000000",
                    "initial_balance": "5000000000000000",
                    "ratio": "0.00000010000000000",
                    "block-height": 35116,
                    "block-hash": "AKZrQDKN4SkLfv9cV5Kb1c5dDQHXCFp8gtqaBdz3Ak24",
                    "total-txs": 35756,
                    "total-ops": 0
                },
                "confirmed": "2018-11-29T08:39:37.544066049Z",
                "hash": "BKeQ9vQZVS1o1BDQJHGN2R64FGDZPomvxQYCjaWUH3rg-5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3",
                "proposed_time": "2018-11-29T08:39:37.525279579Z",
                "source": "GAYRF72WHUB7IQYCV7C7A3CARH4OP2GCR4SKBFKQLALAMCSR67RRBTFD",
                "target": "GCPQQIX2LRX2J63C7AHWDXEMNGMZR2UI2PRN5TCSOVMEMF7BAUADMKH5",
                "tx_hash": "5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3",
                "type": "inflation"
            }
        ]
    },
    "_links": {
        "next": {
            "href": "/api/v1/transactions/5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3/operations?cursor=ITVON050N1BuQ1BOa25vZHYzSlRjUmdxaUxMVkpjRUNaWUw4RGFFUXNGZ1kzLQAAAAAAAIktAAAAAAAAAAA0ZTIzNjkyNS1mM2IyLTExZTgtYjBkOC0wMjQyYWMxNjAwMDI%3D&limit=20&reverse=false"
        },
        "prev": {
            "href": "/api/v1/transactions/5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3/operations?cursor=ITVON050N1BuQ1BOa25vZHYzSlRjUmdxaUxMVkpjRUNaWUw4RGFFUXNGZ1kzLQAAAAAAAIktAAAAAAAAAAA0ZTIzNTQxNS1mM2IyLTExZTgtYjBkOC0wMjQyYWMxNjAwMDI%3D&limit=20&reverse=true"
        },
        "self": {
            "href": "/api/v1/transactions/5N7Nt7PnCPNknodv3JTcRgqiLLVJcECZYL8DaEQsFgY3/operations"
        }
    }
}
@dahemmer
Copy link
Author

Another example having a duplicate operation with hash 61o2dEHuLbdUhWepTaiJS7K5rKG7qV1Ka48voxRwsnYf-9ijoehH6SKHWpyASzFsASoSnzhSwsKmpeeCmsR4HXi54, but now in two different blocks (height 35256 <-> 35257).

https://mainnet.blockchainos.org/api/v1/transactions/9ijoehH6SKHWpyASzFsASoSnzhSwsKmpeeCmsR4HXi54/operations

@Geod24
Copy link
Contributor

Geod24 commented Nov 29, 2018

Yeah using hashes for operation has proven to be troublesome. See also #851 . We're working on it.

@kfangw kfangw self-assigned this Nov 30, 2018
@kfangw
Copy link
Contributor

kfangw commented Nov 30, 2018

We are planing to resolve the issue.
But It is not easy to solve because it is related to the DB migration issue #842

Let us finish our discussion and tell you about the plan.
Thanks for your reporting issue @dahemmer

@kfangw
Copy link
Contributor

kfangw commented Dec 3, 2018

see #862
And the */operations API may be deprecated

When #863 is merged and released, please use transactions instead of using operations API

@spikeekips
Copy link
Contributor

@kfangw This issues was already resolved? If then, please close this issue.

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

No branches or pull requests

5 participants