Skip to content

Fix input/output indexes to be represented as a u32 (*requires reindex*)#69

Merged
philippem merged 2 commits intoBlockstream:new-indexfrom
shesek:202402-vout-u32
Mar 14, 2026
Merged

Fix input/output indexes to be represented as a u32 (*requires reindex*)#69
philippem merged 2 commits intoBlockstream:new-indexfrom
shesek:202402-vout-u32

Conversation

@shesek
Copy link
Collaborator

@shesek shesek commented Feb 15, 2024

Bitcoin's consensus rules allows for output indexes larger than u16, which would result in an overflow prior to this fix.

This recently happened with a transaction on testnet:
https://blockstream.info/testnet/tx/ca3b75556430e1adf9e9790bce9c73a3d9afdb42305588e64c65b258c06c05c9

Based on @junderw's mempool/electrs#75. Thanks!

This PR branch is based on top of #67, which should get merged first.

Note that this change requires a full database reindex.

@LeoComandini
Copy link
Collaborator

utACK 8a69538, code review

@shesek
Copy link
Collaborator Author

shesek commented Feb 20, 2024

Rebased.

@shesek shesek changed the title Fix output indexes to be represented as a u32 Fix output indexes to be represented as a u32 (*requires reindex*) Feb 20, 2024
@sammy007
Copy link

sammy007 commented Jun 8, 2024

Any ETA on merging this obviously necessary fix?

shesek added 2 commits March 12, 2026 17:42
Bitcoin's consensus rules allows for indexes larger than u16,
which would result in an overflow prior to this fix.

This recently happened with a transaction on testnet:
https://blockstream.info/testnet/tx/ca3b75556430e1adf9e9790bce9c73a3d9afdb42305588e64c65b258c06c05c9

Based on @junderw's mempool/electrs#75. Thanks!

This change requires a full database reindex and bumps the DB_VERSION.
and not the main TxEdge structs, which were updated for the V3 schema.
@shesek
Copy link
Collaborator Author

shesek commented Mar 13, 2026

Rebased

@shesek shesek changed the title Fix output indexes to be represented as a u32 (*requires reindex*) Fix input/output indexes to be represented as a u32 (*requires reindex*) Mar 13, 2026
@philippem philippem merged commit 4e1fe8e into Blockstream:new-index Mar 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants