Repository navigation
Publish as @runonflux/bitcore-lib 0.16.0 on Node 24 - #20
Merged
Merged
Conversation
The gulp 3 and bitcore-build pipeline does not run on current Node, and its browser bundle tasks have no consumer. scripts/test.js runs each test file in its own mocha process, because seven inherited files throw while loading, and checks every outcome against test/inherited-failures.json: the 831 tests and 7 files that fail at 8f5453f on Node 8, 12 and 16 alike. 2007 tests pass, as at 8f5453f. chai 6 assertions are properties, so `.to.be.true()` and `.to.be.undefined()` become `.to.be.true` and `.to.be.undefined`. npm-shrinkwrap.json gives way to package-lock.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
elliptic 6 takes pointFromX(x, odd) and carries its own bn.js 4, so a Point receives its coordinates as hex and every coordinate stays elliptic's BN; scalars pass through bn.js duck typing. _getX and _getY keep elliptic's accessors when another copy of this library has already replaced getX and getY on elliptic's shared prototype. Point#validate takes elliptic's square root of x^3 + 7 itself, as elliptic 3's pointFromX did, so each invalid point is rejected with the message it had, and also requires the point to satisfy the curve equation. elliptic 3 left a compressed key whose x has no curve point with a y that passed validation, so PublicKey accepted it; it is now rejected with 'Point does not lie on the curve'. bn.js 2 `mod` by a positive modulus is never negative, which bn.js 5 spells `umod`. bn.js 5 provides gt, gte and lt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test/differential.js loads bitcore-lib 8f5453f, a devDependency pinned with the dependency tree of its npm-shrinkwrap.json, beside this library and requires identical output from both: every block and transaction of the corpus parsed, serialised byte for byte, rendered as JSON and hashed, with the explorer's block hash and txids; input and output scripts, addresses, keys and signatures found in them; fluxnode collateral keys, redeem scripts and signature recovery; v6 fluxnode starts carrying delegates, built from the corpus's starts; private keys, WIF, public keys, P2PKH and P2SH addresses on livenet and testnet; HD derivation; deterministic ECDSA, recovery, low S, DER parsing and cross verification; and signed transactions with sighashes of every type. The corpus holds 124 mainnet blocks and 4 raw transactions from explorer.runonflux.io: PoW and PoN blocks, coinbase and transparent transactions, sprout joinsplits, sapling spends and outputs, v5 fluxnode starts and confirms, v6 P2SH fluxnode starts. Mainnet carries no v6 start with delegates in the sampled blocks. npm 12 fetches git dependencies only with allow-git set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lodash 4 names all, any and contains every, some and includes. Its extend also copies inherited properties, so lodash 3's extend, which copies own properties, becomes assign. The differential test also covers URI, Unit and Opcode, which use assign. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bs58 6 is an ES module that also ships a CommonJS build behind its "require" export condition; that build exposes the codec as `default`. Its decode returns a Uint8Array, which Base58.decode copies into a Buffer as before, and it rejects the same characters with the same message. bitcore.deps.bs58 is the bs58 6 codec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Buffer.compare exists on every supported Node, so buffer-compare is no longer a dependency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Buffer constructor is deprecated (DEP0005). Node implements it as Buffer.alloc for a number and Buffer.from for anything else, which is what each call now names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
elliptic 6 reduces coordinates modulo p before validation, so a point given x + p or y + p, or a signature whose recovery X r + n exceeds p, passed as the reduced point. Point and Point.fromX now reject such a coordinate with the error validate() gives for the unreduced value, as with elliptic 3. The differential test covers these coordinates and recovery ids 2 and 3 when r + n exceeds p. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Multiplication, multiply-add, addition and equality on the base point and another point agree for scalars 0, 1, 2, n - 1, n, n + 1, 2^256 + 5 and random scalars. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The library is published to npm under the runonflux scope, so its dependents take it by version instead of from GitHub. The package ships index.js and lib only. The README and docs require it by that name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The differential test's devDependency bitcore-lib-8f5453f is test/fixtures/bitcore-lib-8f5453f.tgz (index.js, lib, package.json and LICENSE at that commit), so installing the repo fetches nothing from git and needs no .npmrc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI runs the tests on every push and pull request. A published GitHub release sets the package version from its tag, runs the tests and stages that version on npm through trusted publishing: it stays unpublished until a maintainer approves it on npmjs.com with 2FA. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm verifies a provenance-signed publish by comparing repository.url with the GitHub repository the workflow ran in, case-sensitively. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…does fluxd hashes a version 5 or 6 fluxnode transaction without sig, and a confirmation also without benchmarkSig. The id here hashed them, so every fluxnode transaction had an id fluxd does not know: the explorer listed those ids in blocks and answered 404 for each, and a block holding one failed validMerkleRoot. The corpus's txids are now fluxd's (the Flux API's getblock); 2086 of its 2274 were the explorer's. The differential test compares everything but a fluxnode transaction's id with 8f5453f, requires fluxd's ids and a valid merkle root, and checks that the id covers the delegate data and not the signature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishes the library as
@runonflux/bitcore-lib0.16.0 on Node 24 with current dependencies. A differential test runs every operation through this and the previous code (8f5453f, a fixture) and requires identical output; the one difference is that off-curve points are refused.The suite matches its manifest exactly: 2153 passing, the 831 failures inherited from upstream as listed, none unlisted. Running on labnet (the lab's own Flux chain): the API answers identically to 1.3.0, the React UI works against it in a browser, live updates arrive over the websocket, and a transaction sent through
/api/tx/sendwas mined.Publishing. This package is released through npm's staged publishing. Publishing a
GitHub release (tag
vX.Y.Z) runs CI, which sets the version from the tag, runs the tests andstages that version on npm through trusted publishing (GitHub's OIDC; no npm token is stored).
A staged version is not public: nobody can install it until a maintainer approves it on
npmjs.com, or with
npm stage approve, which requires 2FA. Each package needs a trustedpublisher on npmjs.com for this repository's
ci.yml, allowing staged publishing only.Order: each layer is published before the one above it. The packages depend on each other
by version, so they are released lowest first, each approved before the next:
bitcoind-rpcandbitcore-libbitcore-messagebitcore-node,insight-apiandinsight-uiThis package depends on none of the others, so it is released first.
🤖 Generated with Claude Code