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>
20 lines
837 B
Go
20 lines
837 B
Go
// Copyright (c) 2017-2026 Lethean (https://lt.hn)
|
|
//
|
|
// Licensed under the European Union Public Licence (EUPL) version 1.2.
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
// Package consensus implements Lethean blockchain validation rules.
|
|
//
|
|
// Validation is organised in three layers:
|
|
//
|
|
// - Structural: transaction size, input/output counts, key image
|
|
// uniqueness. No cryptographic operations required.
|
|
// - Economic: block reward calculation, fee extraction, balance
|
|
// checks, overflow detection.
|
|
// - Cryptographic: PoW hash verification (RandomX via CGo),
|
|
// ring signature verification, proof verification.
|
|
//
|
|
// All validation functions take a hardfork schedule ([]config.HardFork)
|
|
// and a block height for hardfork-aware gating. The package has no
|
|
// dependency on chain/ or any storage layer.
|
|
package consensus
|