hirosystems / stacks-blockchain-api

API for the Stacks blockchain
https://stacks-blockchain-api.vercel.app
GNU General Public License v3.0
170 stars 108 forks source link

fix: inconsistent block transaction results in Rosetta response #1958

Closed zone117x closed 2 months ago

zone117x commented 2 months ago

Fix possible cause of Rosetta block lookups returning inconsistent results. E.g. reports of block response with 0 transactions:

curl --location 'https://xxx/block' \
--header 'Content-Type: application/json' \
--data '{
    "network_identifier": {
        "blockchain": "stacks",
        "network": "mainnet"
    },
    "block_identifier": {
        "index": 147250
    }
}'

{
    "block": {
        "block_identifier": {
            "index": 147250,
            "hash": "0x2dc8a524911e12f3c4d14de79ca5893b70c7c34d07d0bef59d31b8568650c07f"
        },
        "parent_block_identifier": {
            "index": 147249,
            "hash": "0x52ae92098398349b936e1b1c29591150566d38b800101dc0dff805c47aca2f0b"
        },
        "timestamp": 1713772872000,
        "transactions": []
    }
}
github-actions[bot] commented 2 months ago

Vercel deployment URL: https://stacks-blockchain-fm7uez7ec-blockstack.vercel.app :rocket:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 36.14%. Comparing base (20097fc) to head (21c54a7). Report is 230 commits behind head on develop.

Files Patch % Lines
src/api/controllers/db-controller.ts 33.33% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1958 +/- ## ============================================ - Coverage 76.82% 36.14% -40.68% ============================================ Files 80 94 +14 Lines 11515 12555 +1040 Branches 2575 2926 +351 ============================================ - Hits 8846 4538 -4308 - Misses 2540 7470 +4930 - Partials 129 547 +418 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

blockstack-devops commented 2 months ago

:tada: This PR is included in version 7.11.0-beta.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

blockstack-devops commented 4 weeks ago

:tada: This PR is included in version 7.11.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: