hirosystems / hirosystems/stacks-blockchain-api

[TESTNET BUG] reward_slot_holders endpoint isn't always showing the correct address

Open
#2,295 0 comments 0 reactions 0 assignees View on GitHub
bug testnet
Dominant language
TypeScript
Stars
193
Forks
127
Avg merge
16h 35m
Merged PRs (30d)
46

Description

## Describe the bug

Since the Bitcoin chain behind Testnet is regtest, some of the addresses on the `reward_slot_holders` page are not in the correct format (i.e. they are testnet addresses instead of regtest ones, even if the node processes them as regtest addresses).

## Steps To Reproduce

For example, at block [54053](https://mempool.bitcoin.regtest.hiro.so/block/5d1adaf430f5f8553c49cf96171acd7934021025f067c7006bc675541344b34d), the 2 rewarded addresses according to the [bitcoin chain](https://mempool.bitcoin.regtest.hiro.so/tx/0be05f8677131a0b91a9d38b132ed8e3324e9041969c42ee942e690e4eb6becc) were:
- `mgZ5KJFnXmSvdrPNR7eQGz2RUKeqBanpAM`
- `bcrt1qxnzlc57krja4jzq6vq3fylll0rydxr2xst4erg`

However, the [reward_slot_holders](https://api.testnet.hiro.so/extended/v1/burnchain/reward_slot_holders?limit=250&offset=200) endpoint shows one of the addresses as a testnet one (`tb1qxnzlc57krja4jzq6vq3fylll0rydxr2xjzv55p`):

![Image](https://github.com/user-attachments/assets/1ca98332-0be4-42a9-825d-14f00dfa6c3d)

Going to the individual `reward_slot_holders` for each address:
- [mgZ5KJFnXmSvdrPNR7eQGz2RUKeqBanpAM](https://api.testnet.hiro.so/extended/v1/burnchain/reward_slot_holders/mgZ5KJFnXmSvdrPNR7eQGz2RUKeqBanpAM) - is being shown right
- [tb1qxnzlc57krja4jzq6vq3fylll0rydxr2xjzv55p](https://api.testnet.hiro.so/extended/v1/burnchain/reward_slot_holders/tb1qxnzlc57krja4jzq6vq3fylll0rydxr2xjzv55p) - the address does not exist on the bitcoin chain, however the reward slots received by `bcrt1qxnzlc57krja4jzq6vq3fylll0rydxr2xst4erg` appear here
- [bcrt1qxnzlc57krja4jzq6vq3fylll0rydxr2xst4erg](https://api.testnet.hiro.so/extended/v1/burnchain/reward_slot_holders/bcrt1qxnzlc57krja4jzq6vq3fylll0rydxr2xst4erg) - no reward slots shown, even though they were received

This example is relevant because `tb1qxnzlc57krja4jzq6vq3fylll0rydxr2xjzv55p` and `bcrt1qxnzlc57krja4jzq6vq3fylll0rydxr2xst4erg` contain the same version and hashbytes, but the first is on testnet while the last one is on regtest.

## Expected behavior

The reward slot holders endpoint should show the slots received by `tb1qxnzlc57krja4jzq6vq3fylll0rydxr2xjzv55p` under the `bcrt1qxnzlc57krja4jzq6vq3fylll0rydxr2xst4erg` address instead.

## Environment

Hosted API (https://api.testnet.hiro.so) and hosted bitcoin explorer (https://mempool.bitcoin.regtest.hiro.so)

----

### Minor, Non-launch blocking bugs
**Minor bugs**
- [x] Bugs in non-critical software (CLI, UI, etc) that doesn’t impact critical functionality

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.