bosnet / sebak

SEBAK, the next BOScoin Blockchain
https://devteam.blockchainos.org
GNU General Public License v3.0
44 stars 15 forks source link

Requesting operations for an account sometimes returns a different amount of results for the same request #925

Open dahemmer opened 5 years ago

dahemmer commented 5 years ago

When calling https://mainnet.blockchainos.org/api/v1/accounts/GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR/operations?cursor=JEdBN0FCQkNTTEY2T1BLNkJPTjQzQ1NWVzZINVdNWFpFS0lKNDM3Mk9QM1I0M0VEUFRQMjVJR09SLQAAAAAABgnJAAAAAAAAAAA3MDNjNTYxMC0wNDIyLTExZTktYjFlYi0wMjQyYWMxMjAwMDI%3D&limit=20&reverse=true, _embedded.records sometimes contain a different amount of records.

The bug can be reproduced, but the behavior is inconsistent. I had to perform the request multiple times to get the different responses below.

I'm not sure if this is a bug related to the operations for an account endpoint, or if it relates to all other endpoints as well.

Call 1 (the desired response) containing 4 records

{
    "_embedded": {
        "records": [
            {
                "_links": {
                    "self": {
                        "href": "/api/v1/transactions/B2LPnAkctZVsrPVazgAn2SuM8WDy84pk1ReEVkopGGkZ/operations/223"
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/B2LPnAkctZVsrPVazgAn2SuM8WDy84pk1ReEVkopGGkZ"
                    }
                },
                "block_height": 348545,
                "body": {
                    "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                    "amount": "27976564374"
                },
                "confirmed": "2018-12-17T13:10:33.279197406Z",
                "hash": "5nunt3dhp3Fodv9Ppk6nSqcNGJtVJimoji7DaWnz16Nq-B2LPnAkctZVsrPVazgAn2SuM8WDy84pk1ReEVkopGGkZ",
                "index": 223,
                "proposed_time": "2018-12-17T13:10:33.265373938Z",
                "source": "GCD2K7NFW6IBLSLYX5IZMYVVN2ETASI674Q4V4VAPHBIHRXXBTUWKTXT",
                "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                "tx_hash": "B2LPnAkctZVsrPVazgAn2SuM8WDy84pk1ReEVkopGGkZ",
                "type": "payment"
            },
            {
                "_links": {
                    "self": {
                        "href": "/api/v1/transactions/Edaup5W5DK1catNcgFwTwyDFZDiNtq6nuQwmzSdqTXiF/operations/0"
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/Edaup5W5DK1catNcgFwTwyDFZDiNtq6nuQwmzSdqTXiF"
                    }
                },
                "block_height": 35604,
                "body": {
                    "target": "GCAP52WC7SJZXPNWCSSBJVD55PE2VBHBPQOW3PAOAJNIEXKYZFPLHTOO",
                    "amount": "229180000000"
                },
                "confirmed": "2018-11-29T09:44:25.759358708Z",
                "hash": "GWUKgUP99afpYfA18w9VCTNY4PQmbqAULBD3VDheWwFb-Edaup5W5DK1catNcgFwTwyDFZDiNtq6nuQwmzSdqTXiF",
                "index": 0,
                "proposed_time": "2018-11-29T09:25:12.950735722Z",
                "source": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                "target": "GCAP52WC7SJZXPNWCSSBJVD55PE2VBHBPQOW3PAOAJNIEXKYZFPLHTOO",
                "tx_hash": "Edaup5W5DK1catNcgFwTwyDFZDiNtq6nuQwmzSdqTXiF",
                "type": "payment"
            },
            {
                "_links": {
                    "self": {
                        "href": "/api/v1/transactions/3cx4G5L8h6p8eAAbcbtY7SDCmQ8PA6WWbfs9hWG8er7E/operations/0"
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/3cx4G5L8h6p8eAAbcbtY7SDCmQ8PA6WWbfs9hWG8er7E"
                    }
                },
                "block_height": 35357,
                "body": {
                    "target": "GAFCGKMUQ34ZDD3I2NS2RFBOGIQEUUHREH5WRPCGBSOWYUUJJUEWPRMO",
                    "amount": "1400000000000",
                    "linked": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR"
                },
                "confirmed": "2018-11-29T09:43:55.418548352Z",
                "hash": "Ho5aGJURVpj8USEGDgj2GJjcQEYc1JGZdqdAmi9m2Vht-3cx4G5L8h6p8eAAbcbtY7SDCmQ8PA6WWbfs9hWG8er7E",
                "index": 0,
                "proposed_time": "2018-11-29T08:59:37.764130154Z",
                "source": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                "target": "GAFCGKMUQ34ZDD3I2NS2RFBOGIQEUUHREH5WRPCGBSOWYUUJJUEWPRMO",
                "tx_hash": "3cx4G5L8h6p8eAAbcbtY7SDCmQ8PA6WWbfs9hWG8er7E",
                "type": "create-account"
            },
            {
                "_links": {
                    "self": {
                        "href": "/api/v1/transactions/CvbUf2gNzJZFsKkkFbwHQsuVv97aKd8jpGTf7iCgjKi8/operations/798"
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/CvbUf2gNzJZFsKkkFbwHQsuVv97aKd8jpGTf7iCgjKi8"
                    }
                },
                "block_height": 230,
                "body": {
                    "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                    "amount": "1629189227504"
                },
                "confirmed": "2018-11-27T07:48:10.883635297Z",
                "hash": "92fW1T9nVt9WKrr1Y6sDyLfH6SutFGedNCK3hqPzTVDM-CvbUf2gNzJZFsKkkFbwHQsuVv97aKd8jpGTf7iCgjKi8",
                "index": 798,
                "proposed_time": "2018-11-27T07:48:10.817828899Z",
                "source": "GAMX6BVPNPWWRGGAUZGT57YG4ZYNI3FO5UHXYSGYBODQVFWIEBWVFDRX",
                "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                "tx_hash": "CvbUf2gNzJZFsKkkFbwHQsuVv97aKd8jpGTf7iCgjKi8",
                "type": "create-account"
            }
        ]
    },
    "_links": {
        "next": {
            "href": "/api/v1/accounts/GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR/operations?cursor=JEdBN0FCQkNTTEY2T1BLNkJPTjQzQ1NWVzZINVdNWFpFS0lKNDM3Mk9QM1I0M0VEUFRQMjVJR09SLQAAAAAABVGBAAAAAAAAAAAyMzc5OGNkYy0wMWZkLTExZTktYjFlYi0wMjQyYWMxMjAwMDI%3D&limit=20&reverse=false"
        },
        "prev": {
            "href": "/api/v1/accounts/GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR/operations?cursor=JEdBN0FCQkNTTEY2T1BLNkJPTjQzQ1NWVzZINVdNWFpFS0lKNDM3Mk9QM1I0M0VEUFRQMjVJR09SLQAAAAAAAADmAAAAAAAAAAFjZDhhYjYzYy1mMjE4LTExZTgtODk0YS0wMjQyYWMxMjAwMDI%3D&limit=20&reverse=true"
        },
        "self": {
            "href": "/api/v1/accounts/GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR/operations?cursor=JEdBN0FCQkNTTEY2T1BLNkJPTjQzQ1NWVzZINVdNWFpFS0lKNDM3Mk9QM1I0M0VEUFRQMjVJR09SLQAAAAAABgnJAAAAAAAAAAA3MDNjNTYxMC0wNDIyLTExZTktYjFlYi0wMjQyYWMxMjAwMDI%3D&limit=20&reverse=true"
        }
    }
}

Call 2 (the faulty response) containing 5 records

{
    "_embedded": {
        "records": [
            {
                "_links": {
                    "self": {
                        "href": "/api/v1/transactions/HL52XFujFJa6jDpMVeD5ZkFziGf52qjjtYmknXitpMXb/operations/542"
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/HL52XFujFJa6jDpMVeD5ZkFziGf52qjjtYmknXitpMXb"
                    }
                },
                "block_height": 395721,
                "body": {
                    "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                    "amount": "10000000000"
                },
                "confirmed": "2018-12-20T06:42:33.250196235Z",
                "hash": "7t9DEpV2BczwAzVfhNafenAxqV4EL7abkkQLhwE2BDWi-HL52XFujFJa6jDpMVeD5ZkFziGf52qjjtYmknXitpMXb",
                "index": 542,
                "proposed_time": "2018-12-20T06:42:33.240223454Z",
                "source": "GAKHZ2O6CUSYACJEPUIGDXH6I554QLIQV5QOX7EKPFOAVP7KNHUV2OW2",
                "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                "tx_hash": "HL52XFujFJa6jDpMVeD5ZkFziGf52qjjtYmknXitpMXb",
                "type": "payment"
            },
            {
                "_links": {
                    "self": {
                        "href": "/api/v1/transactions/B2LPnAkctZVsrPVazgAn2SuM8WDy84pk1ReEVkopGGkZ/operations/223"
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/B2LPnAkctZVsrPVazgAn2SuM8WDy84pk1ReEVkopGGkZ"
                    }
                },
                "block_height": 348545,
                "body": {
                    "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                    "amount": "27976564374"
                },
                "confirmed": "2018-12-17T13:10:33.272188506Z",
                "hash": "5nunt3dhp3Fodv9Ppk6nSqcNGJtVJimoji7DaWnz16Nq-B2LPnAkctZVsrPVazgAn2SuM8WDy84pk1ReEVkopGGkZ",
                "index": 223,
                "proposed_time": "2018-12-17T13:10:33.265373938Z",
                "source": "GCD2K7NFW6IBLSLYX5IZMYVVN2ETASI674Q4V4VAPHBIHRXXBTUWKTXT",
                "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                "tx_hash": "B2LPnAkctZVsrPVazgAn2SuM8WDy84pk1ReEVkopGGkZ",
                "type": "payment"
            },
            {
                "_links": {
                    "self": {
                        "href": "/api/v1/transactions/Edaup5W5DK1catNcgFwTwyDFZDiNtq6nuQwmzSdqTXiF/operations/0"
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/Edaup5W5DK1catNcgFwTwyDFZDiNtq6nuQwmzSdqTXiF"
                    }
                },
                "block_height": 35604,
                "body": {
                    "target": "GCAP52WC7SJZXPNWCSSBJVD55PE2VBHBPQOW3PAOAJNIEXKYZFPLHTOO",
                    "amount": "229180000000"
                },
                "confirmed": "2018-11-29T09:36:57.789949439Z",
                "hash": "GWUKgUP99afpYfA18w9VCTNY4PQmbqAULBD3VDheWwFb-Edaup5W5DK1catNcgFwTwyDFZDiNtq6nuQwmzSdqTXiF",
                "index": 0,
                "proposed_time": "2018-11-29T09:25:12.950735722Z",
                "source": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                "target": "GCAP52WC7SJZXPNWCSSBJVD55PE2VBHBPQOW3PAOAJNIEXKYZFPLHTOO",
                "tx_hash": "Edaup5W5DK1catNcgFwTwyDFZDiNtq6nuQwmzSdqTXiF",
                "type": "payment"
            },
            {
                "_links": {
                    "self": {
                        "href": "/api/v1/transactions/3cx4G5L8h6p8eAAbcbtY7SDCmQ8PA6WWbfs9hWG8er7E/operations/0"
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/3cx4G5L8h6p8eAAbcbtY7SDCmQ8PA6WWbfs9hWG8er7E"
                    }
                },
                "block_height": 35357,
                "body": {
                    "target": "GAFCGKMUQ34ZDD3I2NS2RFBOGIQEUUHREH5WRPCGBSOWYUUJJUEWPRMO",
                    "amount": "1400000000000",
                    "linked": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR"
                },
                "confirmed": "2018-11-29T09:36:27.516757818Z",
                "hash": "Ho5aGJURVpj8USEGDgj2GJjcQEYc1JGZdqdAmi9m2Vht-3cx4G5L8h6p8eAAbcbtY7SDCmQ8PA6WWbfs9hWG8er7E",
                "index": 0,
                "proposed_time": "2018-11-29T08:59:37.764130154Z",
                "source": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                "target": "GAFCGKMUQ34ZDD3I2NS2RFBOGIQEUUHREH5WRPCGBSOWYUUJJUEWPRMO",
                "tx_hash": "3cx4G5L8h6p8eAAbcbtY7SDCmQ8PA6WWbfs9hWG8er7E",
                "type": "create-account"
            },
            {
                "_links": {
                    "self": {
                        "href": "/api/v1/transactions/CvbUf2gNzJZFsKkkFbwHQsuVv97aKd8jpGTf7iCgjKi8/operations/798"
                    },
                    "transaction": {
                        "href": "/api/v1/transactions/CvbUf2gNzJZFsKkkFbwHQsuVv97aKd8jpGTf7iCgjKi8"
                    }
                },
                "block_height": 230,
                "body": {
                    "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                    "amount": "1629189227504"
                },
                "confirmed": "2018-11-27T07:48:10.883635297Z",
                "hash": "92fW1T9nVt9WKrr1Y6sDyLfH6SutFGedNCK3hqPzTVDM-CvbUf2gNzJZFsKkkFbwHQsuVv97aKd8jpGTf7iCgjKi8",
                "index": 798,
                "proposed_time": "2018-11-27T07:48:10.817828899Z",
                "source": "GAMX6BVPNPWWRGGAUZGT57YG4ZYNI3FO5UHXYSGYBODQVFWIEBWVFDRX",
                "target": "GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR",
                "tx_hash": "CvbUf2gNzJZFsKkkFbwHQsuVv97aKd8jpGTf7iCgjKi8",
                "type": "create-account"
            }
        ]
    },
    "_links": {
        "next": {
            "href": "/api/v1/accounts/GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR/operations?cursor=JEdBN0FCQkNTTEY2T1BLNkJPTjQzQ1NWVzZINVdNWFpFS0lKNDM3Mk9QM1I0M0VEUFRQMjVJR09SLQAAAAAABgnJAAAAAAAAAAA3MDFmODg4NC0wNDIyLTExZTktOTNlZi0wMjQyYWMxMjAwMDI%3D&limit=20&reverse=false"
        },
        "prev": {
            "href": "/api/v1/accounts/GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR/operations?cursor=JEdBN0FCQkNTTEY2T1BLNkJPTjQzQ1NWVzZINVdNWFpFS0lKNDM3Mk9QM1I0M0VEUFRQMjVJR09SLQAAAAAAAADmAAAAAAAAAAFjZDhhYjYzYy1mMjE4LTExZTgtODk0YS0wMjQyYWMxMjAwMDI%3D&limit=20&reverse=true"
        },
        "self": {
            "href": "/api/v1/accounts/GA7ABBCSLF6OPK6BON43CSVW6H5WMXZEKIJ4372OP3R43EDPTP25IGOR/operations?cursor=JEdBN0FCQkNTTEY2T1BLNkJPTjQzQ1NWVzZINVdNWFpFS0lKNDM3Mk9QM1I0M0VEUFRQMjVJR09SLQAAAAAABgnJAAAAAAAAAAA3MDNjNTYxMC0wNDIyLTExZTktYjFlYi0wMjQyYWMxMjAwMDI%3D&limit=20&reverse=true"
        }
    }
}