Commit graph

209 commits

Author SHA1 Message Date
Virgil
adaa193afa refactor(blockchain): tighten chain sync operator UX 2026-04-04 11:57:15 +00:00
Virgil
b4f688fa7f refactor(blockchain): tighten AX seed validation 2026-04-04 11:53:12 +00:00
Virgil
9a54ef93d5 refactor(blockchain): improve chain command AX
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 11:45:06 +00:00
Virgil
bae418bbb8 refactor(blockchain): validate numeric seed ports
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 11:33:44 +00:00
Virgil
fefddd9800 refactor(blockchain): sharpen AX command wording
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 11:30:09 +00:00
Virgil
0fc3df6a1c refactor(blockchain): validate sync stop inputs
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 11:26:36 +00:00
Virgil
29c0e77281 refactor(blockchain): validate chain runtime inputs
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 11:20:47 +00:00
Virgil
3d071e5602 refactor(blockchain): surface sync preflight errors
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 11:16:50 +00:00
Virgil
d51a2bd628 refactor(blockchain): align sync wording with AX
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 11:13:19 +00:00
Virgil
20de2172cd refactor(blockchain): clarify sync background help text
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 11:11:05 +00:00
Virgil
b415c8bd80 refactor(blockchain): clarify chain sync help text
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 11:02:38 +00:00
Virgil
9f83885e2c refactor(blockchain): make sync handshake cancellable
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:48:59 +00:00
Virgil
cde31b595f refactor(blockchain): centralise chain command labels
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:46:02 +00:00
Virgil
fa7b674c4f refactor(blockchain): centralise chain example labels
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:42:25 +00:00
Virgil
a0e20f0c49 refactor(blockchain): centralise AX subcommand paths
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:23:31 +00:00
Virgil
4a8f5eac29 refactor(blockchain): use chain command constant in tests
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:20:16 +00:00
Virgil
852a3add68 refactor(blockchain): centralise chain command name
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:20:11 +00:00
Virgil
65cf3dcb9a refactor(blockchain): centralise chain command examples
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:16:56 +00:00
Virgil
cf7f1672cd refactor(blockchain): centralise chain app name for AX examples
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 10:13:15 +00:00
Virgil
31dedcf9a2 refactor(blockchain): restore qualified chain examples and crypto headers
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 10:09:10 +00:00
Virgil
1e40b3039d refactor(blockchain): align chain command examples with AX
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:05:14 +00:00
Virgil
c508980ae0 refactor(blockchain): add foreground chain example
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:03:06 +00:00
Virgil
9780153778 refactor(blockchain): reject unexpected chain args
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 10:00:05 +00:00
Virgil
f39140cf32 refactor(blockchain): reject conflicting sync flags
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 09:57:37 +00:00
Virgil
2fd4a13526 refactor(blockchain): qualify chain command examples
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 09:54:42 +00:00
Virgil
6235fe5bd0 refactor(blockchain): add stop example and SIGTERM handling
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 09:47:36 +00:00
Virgil
e022c09378 refactor(blockchain): tighten chain help text
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 09:28:32 +00:00
Virgil
c919edbcd9 refactor(blockchain): surface chain command examples
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 09:20:59 +00:00
Virgil
6e9554c5d3 refactor(blockchain): clarify chain command metadata
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 09:13:28 +00:00
Virgil
bd53b3935f refactor(blockchain): make chain explorer title explicit
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 08:55:46 +00:00
Virgil
6ea3af7587 refactor(blockchain): align AX command references
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 08:52:58 +00:00
Virgil
a2df164822 refactor(blockchain): spell out command sync names
Some checks failed
Security Scan / security (push) Has been cancelled
Test / Test (push) Has been cancelled
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 04:18:37 +00:00
Virgil
243749a6d8 refactor: align command paths with AX naming
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
2026-04-04 04:10:23 +00:00
d004158022 Merge pull request '[agent/claude] Migrate module path to dappco.re/go/core/blockchain. Update ...' (#4) from agent/migrate-module-path-to-dappco-re-go-core into main
Some checks failed
Security Scan / security (push) Successful in 9s
Test / Test (push) Failing after 22s
2026-03-22 02:49:31 +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
Snider
6370d96c31 Merge remote-tracking branch 'github/dev'
Some checks failed
Security Scan / security (push) Successful in 10s
Test / Test (push) Failing after 23s
2026-03-22 00:58:07 +00:00
Snider
2b145d6ebf chore: sync dependencies for v0.1.5
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 17:54:14 +00:00
Snider
abb1e2b748 chore: sync dependencies for v0.1.4
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 17:50:27 +00:00
Claude
97c5510184
refactor: complete coreerr.E() conversion across all packages
Some checks failed
Security Scan / security (push) Successful in 12s
Test / Test (push) Failing after 25s
Convert all remaining fmt.Errorf and errors.New in production code
to coreerr.E(). Covers crypto/ (keygen, signature, clsag, keyimage,
pow), consensus/block, and chain/ring. Only sentinel error definitions
in errors.go and varint.go retain errors.New (correct usage).

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 23:42:51 +00:00
Claude
772cd1b0fd
refactor: convert remaining fmt.Errorf to coreerr.E()
Some checks failed
Security Scan / security (push) Successful in 8s
Test / Test (push) Failing after 22s
Converts the last 3 fmt.Errorf calls in production code (excluding
crypto/ CGo boundary) to coreerr.E() for conventions consistency.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 23:24:53 +00:00
Snider
f19054f7b1 chore: sync dependencies for v0.1.3
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 22:20:06 +00:00
Claude
70fab6f7d0
fix: restore HF5 asset tags, HTLC/multisig inputs, and tx version check after conventions sweep
Some checks failed
Test / Test (push) Failing after 16s
Security Scan / security (push) Failing after 13m58s
The conventions sweep (71f0a5c) overwrote HF5 code and removed HTLC/multisig
input handling. This commit restores:

- wire: HF5 asset wire tags (40/49/50/51) and reader functions for
  asset_descriptor_operation, asset_operation_proof,
  asset_operation_ownership_proof, and asset_operation_ownership_proof_eth
- wire: HTLC and multisig input encode/decode with string field helpers
- consensus: checkTxVersion enforcing version 3 after HF5 / rejecting before
- consensus: HF1-gated acceptance of HTLC and multisig input/output types
- consensus: HTLC key image deduplication in checkKeyImages
- consensus: HTLC ring signature counting in verifyV1Signatures
- chain: corrected error assertion in TestChain_GetBlockByHeight_NotFound

All 14 packages pass go test -race ./...

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 21:32:33 +00:00
Claude
89b0375e18
fix(wire): restore TxOutTarget type switches after conventions sweep
The coreerr.E() sweep reverted the HF1 type assertion changes in
encodeOutputsV1/V2 and decodeOutputsV1/V2. Restores full target
variant support (TxOutToKey, TxOutMultisig, TxOutHTLC) in all four
output functions.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 21:23:48 +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
8d41b76db3
feat(consensus): add pre-hardfork transaction freeze for HF5
Some checks failed
Security Scan / security (push) Successful in 8s
Test / Test (push) Failing after 16s
Rejects non-coinbase transactions during the 60-block window before
HF5 activation. Coinbase transactions are exempt. Implements
IsPreHardforkFreeze and ValidateTransactionInBlock.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 20:59:19 +00:00
Claude
efbf050c1b
feat(consensus): enforce transaction version 3 after HF5
After HF5 activation, only version 3 transactions are accepted.
Before HF5, version 3 is rejected. Matches C++ check_tx_semantic
hardfork gating logic.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 20:57:54 +00:00
Claude
939ad198fe
test(wire): add v3 transaction round-trip tests with asset operations
Tests v3 transactions containing asset_descriptor_operation (tag 40)
in extra and asset_operation_proof (tag 49) in proofs. Validates
hardfork_id encoding and bit-identical round-tripping.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 20:56:36 +00:00
Claude
d8e12a1539
feat(wire): add asset proof tags 49, 50, 51 readers
Reads asset_operation_proof, asset_operation_ownership_proof, and
asset_operation_ownership_proof_eth structures. All use CHAIN_TRANSITION_VER
with version byte prefix. Stored as opaque bytes.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 20:55:33 +00:00
Claude
3e79f34a65
feat(wire): add asset_descriptor_operation tag 40 reader
Reads the CHAIN_TRANSITION_VER structure for asset deploy/emit/update/burn
operations. Stores as opaque bytes for bit-identical round-tripping.
Required for HF5 block deserialisation.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-16 20:53:39 +00: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