Commit graph

9 commits

Author SHA1 Message Date
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
Snider
71f0a5c1d5 refactor: replace fmt.Errorf/os.* with go-io/go-log conventions
Some checks failed
Security Scan / security (push) Successful in 11s
Test / Test (push) Failing after 23s
Replace all fmt.Errorf and errors.New in production code with
coreerr.E("Caller.Method", "message", err) from go-log. Replace
os.MkdirAll with coreio.Local.EnsureDir from go-io. Sentinel errors
(consensus/errors.go, wire/varint.go) intentionally kept as errors.New
for errors.Is compatibility.

270 error call sites converted across 38 files. Test files untouched.
crypto/ directory (CGO) untouched.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 21:17:49 +00:00
Claude
f9ff8ad877
test(mining): integration test against C++ testnet daemon
Build-tagged //go:build integration. Fetches a real template,
decodes it, computes header mining hash.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 02:20:05 +00:00
Claude
340aa99db6
test(mining): add CheckNonce and OnNewTemplate coverage
Brings mining/ package coverage from 78% to 86.6%.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 02:19:05 +00:00
Claude
9bc3158384
test(mining): error handling for invalid difficulty, blob, and submit
Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 02:16:32 +00:00
Claude
ad121a2dd4
test(mining): block submission and stats verification
Tests with difficulty=1 for guaranteed block finding. Verifies
OnBlockFound callback, submit count, hashrate > 0.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 02:15:05 +00:00
Claude
538b7b2e02
feat(mining): mining loop with template fetch and nonce grinding
Start(ctx) blocks until cancelled. Polls daemon for new blocks,
decodes template, computes header hash once, grinds nonces with
RandomX, submits solutions.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 02:11:25 +00:00
Claude
a5185cacf4
feat(mining): Config, Stats, and Miner struct
TemplateProvider interface for testability. Atomic stats for
lock-free reads from any goroutine.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 02:07:05 +00:00
Claude
c6631e555b
feat(mining): header mining hash and nonce checking
Port of C++ get_block_header_mining_hash(). Computes BlockHashingBlob
with nonce=0, Keccak-256's it. CheckNonce wraps RandomX + difficulty.

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