The chain contains op types the explorer has no serializer for (e.g.
ChannelSetKeys, opcode 16), and a single such transaction aborted the
entire backfill. Same approach as #19, adapted to the current tx format:
unrecognized opcodes and proof variants (e.g. the NoProof unit variant)
fall back to an UnknownOp/UnknownSignature pair that preserves the raw
data verbatim. Typed support can be added incrementally; known ops keep
their strict proof-type checks.
Also adds a typed ChannelSetKeys serializer (opcode 16), shaped from a
real op captured on the chain (fixture included) — its DB model already
existed, but with List[bytes] keys, which break the JSON column's utf-8
encoding; changed to HexBytes like every other byte field.
Recent nodes changed the wire format in three ways that broke block
ingestion (serializers raised on every block, so the DB never populated):
- cryptarchia/info wraps its fields under "cryptarchia_info" and reports
mode as an object ({"Started": "Online"}). Normalize before validating.
- Byte fields (inscriptions, Ed25519 signatures, Groth16 pi_a/pi_b/pi_c)
arrive as hex strings instead of int arrays. Accept both encodings via
BytesFromHexOrIntArray, since the encoding has drifted between releases.
- mantle_tx now carries its canonical hash and dropped the gas price
fields. Prefer the node-provided hash (a locally computed JSON hash does
not match the chain's real tx hash) and default gas prices to 0.
Tested with a real block fixture captured from a node.
Batches updates to sqlite db in chunks of 10k. Well within SQlite query
limits (32,766) as of v3.32.0 which is bundled with python 3.9+.
Adds cleanup code to terminate httpx client connection in node_api.
style: fmt files
style: fmt file
Adds a new class attribute to NodeHttpApi that instantiates an httpx
client to reuse during startup.
Adds respective cleanup function for client connection
Updates get_block_by_hash to use httpx client
Previously genesis block was assigned height=0, causing chain height
to undercount by one. Block count should equal the height of the tip.
Fix: genesis block now starts at height=1.
Fixes#12