Commit graph

13 commits

Author SHA1 Message Date
Virgil
bb941ebcc5 fix(consensus): tighten fork-era type gating
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Reject Zarcanum inputs and outputs before HF4 instead of letting
unsupported combinations pass semantic validation.

Also restrict PoS miner stake inputs to txin_to_key pre-HF4 and
txin_zc post-HF4, with regression coverage for the affected paths.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 22:18:53 +00:00
Virgil
219aeae540 refactor(consensus): unexport block version helpers
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 21:48:36 +00:00
Virgil
2e92407233 fix(consensus): restore pre-hf1 miner tx version
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
2026-04-04 21:37:38 +00:00
Virgil
0ab8bfbd01 fix(consensus): validate miner tx versions by fork era
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 21:18:42 +00:00
Virgil
2f3f46e8c5 fix(consensus): count zarcanum miner outputs in rewards
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 20:56:56 +00:00
Virgil
0ba5bbe49c feat(consensus): enforce block version in chain sync
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
2026-04-04 18:56:36 +00:00
Snider
34128d8e98 refactor: migrate module path to dappco.re/go/core/blockchain
Some checks failed
Security Scan / security (pull_request) Successful in 11s
Test / Test (pull_request) Failing after 19s
Update go.mod module line, all require/replace directives, and every
.go import path from forge.lthn.ai/core/go-blockchain to
dappco.re/go/core/blockchain. Add replace directives to bridge
dappco.re paths to existing forge.lthn.ai registry during migration.
Update CLAUDE.md, README, and docs to reflect the new module path.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 01:49:26 +00:00
Claude
d7917234ed
feat(consensus): add ErrBlockVersion alias and comprehensive block version tests
Add ErrBlockVersion as an alias for ErrBlockMajorVersion for clarity.
Add table-driven tests for expectedBlockMajorVersion covering all
hardfork boundaries (HF0 through HF4+) on both mainnet and testnet
schedules. Add standalone checkBlockVersion tests with Good/Bad/Ugly
pattern including version 255 edge case and exact HF1 boundary checks.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 20:47:47 +00:00
Claude
b1a0e9637b
feat(consensus): validate block major version for HF1
Adds expectedBlockMajorVersion and checkBlockVersion, called from
ValidateBlock before timestamp validation. Block version must match
the fork era: HF0->0, HF1->1, HF3->2, HF4+->3.
Tests cover both mainnet and testnet fork schedules including
boundary heights.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 20:40:11 +00:00
Claude
7abac5e011
feat(consensus): full block validation orchestrator
ValidateBlock combines timestamp, miner tx, and reward checks into
a single entry point for block-level consensus validation.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 00:53:51 +00:00
Claude
83a715cdb8
feat(consensus): block reward validation
ValidateBlockReward checks miner tx output sum against expected reward
with size penalty and hardfork-aware fee treatment.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 00:52:55 +00:00
Claude
3ee066e233
feat(consensus): miner transaction validation
ValidateMinerTx checks genesis input height, input count (1 for PoW,
2 for PoS), and stake input type per hardfork version.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 00:51:56 +00:00
Claude
b3f33f5265
feat(consensus): block timestamp validation
CheckTimestamp enforces future time limits (7200s PoW, 1200s PoS)
and median-of-last-60 timestamp ordering.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 00:50:39 +00:00