ElementsProject / ElementsProject/lightning

Endianness of Blocks Table Hash Column inconsistent

Open
#9,465 0 comments 0 reactions 1 assignee Claimed by @Andezion View on GitHub
Dominant language
C
Stars
3.1k
Forks
1k
Avg merge
4d 10h
Merged PRs (30d)
13

Description

Entries in the Column Hash of the Table Blocks are with different Endianess.

clightning=# select height,hash from blocks where height < 704390 limit 10;
height | hash
--------+--------------------------------------------------------------------
704384 | \x16d21ffcb083152845de0e272e9344802db1954e0b2609000000000000000000
704385 | \x14fe28544948d000c28972a52e04ee0a367adea7f3e40a000000000000000000
704386 | \x9d9794f66a3e575711161d7097b152e231fa43305e7306000000000000000000
704387 | \xcbed94f7979f1f92b31663db567955a884736d1d04be02000000000000000000
704388 | \xa3ee441fc79a2792da9424e270ed60b3db75466684d302000000000000000000
704389 | \x33329d09746da50be2998704096a50bbb50bc00ac7990b000000000000000000
704225 | \x00000000000000000006a4b424229e1f6913422d59d070b62bd37ada926d3fea
549524 | \x00000000000000000001e08b870b2d6d31d8ba20f5bdad8e7cb809fd8ce6a8fb
601046 | \x000000000000000000125c9e34c7e49692a3a88c664dae35f7c72c4ade4ad7f1
601260 | \x0000000000000000000debf11962f89e2ae08f8ff75803b0da6170af6c5c346b
(10 rows)

These entries were written by the same lightningd binary using PostgreSQL 18 on the same machine in one run.

I assume the error is in wallet_filteredblock_add() (called from got_filteredblock in gossip_control.c) where the hash is written uncorrected from the bcli call.

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.