Commit graph

7 commits

Author SHA1 Message Date
Snider
76488e0beb feat(wire): add alias entry readers + AX usage-example comments
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Add readExtraAliasEntryOld (tag 20) and readExtraAliasEntry (tag 33)
wire readers so the node can deserialise blocks containing alias
registrations. Without these readers, mainnet sync would fail on any
block with an alias transaction. Three round-trip tests validate the
new readers.

Also apply AX-2 (comments as usage examples) across 12 files: add
concrete usage-example comments to exported functions in config/,
types/, wire/, chain/, difficulty/, and consensus/. Fix stale doc
in consensus/doc.go that incorrectly referenced *config.ChainConfig.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-05 08:46:54 +01:00
Claude
9631efa5a8
feat(config): add HardforkActivationHeight helper
Returns the raw activation height for a given hardfork version.
Needed by the pre-hardfork transaction freeze logic.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 20:51:54 +00:00
Claude
c7c536449b
feat(config): add BlockTarget constant (120s)
Replaces magic number 120 in difficulty tests with config.BlockTarget.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 21:59:41 +00:00
Claude
fcb867d53b
fix(p2p): correct network IDs and serialisation for C++ daemon compat
Three bugs found by integration testing against the C++ testnet daemon:

1. NetworkIDMainnet/Testnet had byte 10 swapped — the C++ #ifndef TESTNET
   branch (mainnet) sets P2P_NETWORK_ID_TESTNET_FLAG=1, and the #else
   (testnet) sets it to 0. Counter-intuitive but matches compiled binaries.

2. ClientVersion format "Lethean/go-blockchain 0.1.0" was rejected by the
   daemon's parse_client_version which expects "major.minor.rev.build[commit]".
   Changed to "6.0.1.2[go-blockchain]".

3. RequestChain, RequestGetObjects, and ResponseGetObjects used StringArrayVal
   for hash fields, but the C++ daemon uses KV_SERIALIZE_CONTAINER_POD_AS_BLOB
   which packs all 32-byte hashes into a single concatenated blob. Also,
   ResponseChainEntry.m_block_ids is an object array of block_context_info
   (hash + cumulative size), not a simple hash list.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 21:17:48 +00:00
Claude
fa1c127e12
feat(consensus): scaffold package with error types
Add consensus/ package with doc.go and sentinel error types for all
validation failures. Add MaxTransactionBlobSize constant to config.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 00:39:41 +00:00
Claude
888a0b6fff
feat(config): P2P network IDs and go-p2p dependency
Add NetworkIDMainnet and NetworkIDTestnet 16-byte UUIDs for P2P
handshake, ClientVersion constant, and NetworkID field to ChainConfig.
Add local replace directive for forge.lthn.ai/core/go-p2p.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 19:33:24 +00:00
Claude
4c0b7f290e
feat: Phase 0 scaffold -- config, types, wire, difficulty
Chain parameters from Lethean C++ source. Base58 address encoding with
Keccak-256 checksum. CryptoNote varint. LWMA difficulty skeleton.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 15:10:33 +00:00