@inversealtruism/cairnx-core 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.8
4
+
5
+ - Token moves in the applied log (CONVENTION section 41, no gate): an applied mint, transfer or fill that moved tokens
6
+ carries `moves`, each `{ leg, ticker, from, to, amount }` (`TokenMove`, legs `mint`, `xfer`, `sale`, `fee` and
7
+ `fill`), written by the line that applies the balance change in `src/resolve/tokens.ts` and `src/resolve/attest.ts`.
8
+ A server that credits token deposits, or a replica that lists transfers, reads a capped mint's credit, a partial
9
+ fill's delivered units, a sale and its fee from the log instead of restating the rules that decide them. A zero
10
+ amount writes no move, a refused entry none, and `moves` is an entry's last key. No rule changed: canonical state,
11
+ `stateHash`, `eventsHash`, every pinned vector and `replay-hashes.json` are unchanged, and the log with `moves` left
12
+ out is 0.2.7's (`scripts/seal-differential.mjs` against npm's 0.2.7 and 0.2.4). `test/vectors/moves.json` (13 cases,
13
+ `conformance/gen-moves-vectors.mjs`, expectations written by hand) pins them; `conformance/moves-check.mjs` checks,
14
+ from the input events and the result, the identity (for every ticker and address, received less sent equals
15
+ available plus locked), each transfer's and mint's move against its own record and each fill's moves against its
16
+ fill record, run by `test/moves.test.ts` over the replay corpus at every pinned height and every case file, and by
17
+ the seal over every input of its differential.
18
+ - `CAIRNX_CORE_VERSION` (`src/version.ts`), this package's version, kept equal to package.json's by
19
+ `test/version.test.ts`: a host hands it to cairnx-api's `prepareView` without reading the manifest at run time.
20
+ - `GATE_HEIGHTS` (`src/gates.ts`), the gate table as frozen data: `ACTIVATION_HEIGHT` and every `V<n>_HEIGHT` by its
21
+ exported name, built from the constants of `types.ts`, which are unchanged; `test/gates.test.ts` keeps it equal to
22
+ the individual exports and complete. A reader that compares gate tables (the replica, a witness) imports it.
23
+ - Forward resolution is a root export, moved from the reference service without a change to its body: `resolveNameIn(names,
24
+ name)` answers `{ name, addr, via, lapsed, owner }` for the name's `nset` address, else its owner, with `lapsed` from
25
+ the name's `expired`, and null for an absent name or a pending reservation; `nameView(names, name)` gives the class a
26
+ reader shows (`held`, `pending`, `lapsed`, `free`, `reserved`), the owner, and a held name's address and profile
27
+ (CONVENTION section 35.3), or null for a string that is not a name. Both live in `src/forward.ts` and read `names`
28
+ only; that change left `resolve.ts`, `resolve/`, `records.ts` and `types.ts` as they were in 0.2.7. CONVENTION.md section 35.4
29
+ states the rule, and section 36.3 now says a name pays to its `addr`, else its owner, which is what the reference
30
+ service answers. `test/vectors/forward.json` (14 cases, `conformance/gen-forward-vectors.mjs`, expectations written
31
+ by hand) pins both functions; `test/forward.test.ts` replays it and compares the service's call shape with an oracle
32
+ over every name of the replay corpus at each pinned height.
33
+ - CONVENTION.md corrected to match the implementation; no behaviour changed (that change touched neither `src/` nor
34
+ `dist/`; every pinned replay hash and existing vector byte-identical). It now states: what a pending reservation refuses and how
35
+ it is materialized (sections 9, 17, 22, 28); the expiry sweep before each event and at `tipHeight + 1`, and that a
36
+ name's `expired` is read at the tip's epoch (section 5); the zero-delivery partial fill (12); the commit height as
37
+ the first anchoring of its hash, the salt form and the reveal's own position and id as the contest key (9, 28, 29);
38
+ the lowercase form of record hashes (3, 13, 18); the bid link and `done` (13); a token-priced offer's `"0"` price
39
+ (3, 11); the recapture premium as the integer staircase `1 + floor(19 * (720 - e) / 720)` and the recaptured
40
+ record's anchor (17, 29). Corrected sentences: `feesPaid` counts the fees applied records owed (10); a whole fill's
41
+ `paid` is what it paid to payto, and a completed partial offer's `fill` carries `got` (5, A3); the claim fields stay
42
+ after the hold and the offer end (20, A4); offers below 29 960 carry `feeBps` 0 (19); a same-block re-post of what
43
+ an `ocancel` releases is refused from V14, and section 16 no longer says the case cannot occur on chain (12b, 16);
44
+ the fclaim grant checks the expiry's 2^53 bound first and its order decides only the reason code (31); a list
45
+ holding a transaction id at two places with the first copy below V29 is not a list section 33 produces, no
46
+ conformance level covers it and the two reference implementations differ there (32); an un-finalized reservation
47
+ is gone from the state at a tip equal to `finalizeBy` (28); one key can anchor several records in one block (6,
48
+ 16); the state's key order puts array-index keys first (5), the field lists of section 5 and A3/A4 are complete,
49
+ and `FILL_UNDERPAID`, `FILL_REBATE_UNPAID` and `TREASURY_FEE_UNPAID` say what they mean on the rebate lane (40.4).
50
+ README.md gives the recapture premium as 19x stepping down to 1x over about 28 days, where it said 20x to 1x over
51
+ about 30.
52
+ - `test/vectors/cases-convention.json` (16 vectors, `conformance/gen-convention-vectors.mjs`) pins those rules and
53
+ three the text stated that no vector pinned (`feeBps` 0 below 29 960, a CSD-priced offer wanting `"0"`, and a bid
54
+ anchored after the offer that names it ending `done` with empty `offers`), each in a vector an implementation of
55
+ the earlier text fails; replayed by `test/vectors.test.ts`, against the Python
56
+ reference by `conformance/crosscheck-resolve.mjs`, and by the seal, which pins the file's sha256. A file of its own
57
+ keeps the three case files the seal freezes at their bytes.
58
+ - `test/holdcount.test.ts`: the honest path of `countOtherHoldsAtGrant`'s skip of the buyer's closed holds, with the
59
+ call shape the site and wallet send (`closed` from `myProvenFillClosedOffer`, the count into `verifyFillSpv`): three
60
+ completed fclaim buys inside one hold window, then a fourth, counted 0 and safe to fill. No test passed `closed`
61
+ before.
62
+
3
63
  ## 0.2.7
4
64
 
5
65
  - No state change; replay cost. `resolve()` no longer copies and walks every open offer, open bid, pending reservation