Skip to content

Commit 8b2e1fd

Browse files
claudewilliamdemeo
authored andcommitted
Address PR #1219 Copilot review comments
- Ledger.lagda.md: HasCoin-CertState counts only the rewards balance (getCoin = rewardsBalance ∘ DStateOf), not the deposit pots; correct the prose to say components 3 and 4 (coinFromDeposits, coinFromGovDeposit) are added at the LedgerState level. - CHANGELOG.md: the HasCoin-LedgerState entry now also lists the coinFromGovDeposit summand, not just the three CertState deposit fields. - session-start.sh: enabling flakes keyed only on the presence of any experimental-features line, so a bare `experimental-features = nix-command` would skip flakes. Check for `flakes` specifically and append via extra-experimental-features (which doesn't clobber an existing setting). https://claude.ai/code/session_0174ZBS1RKAGSbBXDsESUwoA
1 parent 67d9962 commit 8b2e1fd

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

.claude/hooks/session-start.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ log "nix present: $(nix --version 2>/dev/null || echo unknown)"
5959
# 2. Enable flakes and configure the binary caches the flake expects (from ci.yml).
6060
mkdir -p "$HOME/.config/nix"
6161
NIX_CONF="$HOME/.config/nix/nix.conf"
62-
grep -q 'experimental-features' "$NIX_CONF" 2>/dev/null || \
63-
echo 'experimental-features = nix-command flakes' >> "$NIX_CONF"
62+
# Append via extra-experimental-features so we don't clobber an existing
63+
# experimental-features line, and key the check on `flakes` specifically: a bare
64+
# `experimental-features = nix-command` must not cause us to skip enabling flakes.
65+
grep -qE 'experimental-features.*flakes' "$NIX_CONF" 2>/dev/null || \
66+
echo 'extra-experimental-features = nix-command flakes' >> "$NIX_CONF"
6467
grep -q 'cache.iog.io' "$NIX_CONF" 2>/dev/null || cat >> "$NIX_CONF" <<'CONF'
6568
substituters = https://cache.iog.io https://cache.nixos.org/
6669
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
`coinFromDeposits` alone no longer accounts for them.
1616
- Move cert-deposit helpers from `Utxo` to `Certs`.
1717
- Fix `updateCertDeposits`: use `foldl` (CERTS is head-first).
18-
- Add `HasCoin-UTxOState` and `HasCoin-LedgerState` instances; the latter sums UTxO total, rewards balance, and all three deposit fields.
18+
- Add `HasCoin-UTxOState` and `HasCoin-LedgerState` instances; the latter sums UTxO total, rewards balance, the three `CertState` deposit fields (`coinFromDeposits`), and governance-action deposits (`coinFromGovDeposit`).
1919
- Apply per-transaction direct deposits to `CertState` after each `CERTS` step in `SUBLEDGER-V` and `LEDGER-V` (CIP-159).
2020
- Forbid CIP-159 fields (`txDirectDeposits`, `txBalanceIntervals`) in legacy mode via explicit `UTXOW-legacy` premises.
2121
- Allow partial withdrawals in `PRE-CERT` rule; define `applyWithdrawals` and `_≤ᵐ_` (CIP-159).

src/Ledger/Dijkstra/Specification/Ledger.lagda.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ allColdCreds govSt es =
186186
4. the governance-action deposits, summed by `coinFromGovDeposit`{.AgdaFunction} over
187187
`GovActionState.deposit`{.AgdaField} for each action in the current `GovState`{.AgdaRecord}.
188188

189-
N.B. `HasCoin-CertState` only counts components 2–3; component 4 must be added at the
189+
N.B. `HasCoin-CertState` counts only the rewards balance (component 2) — its `getCoin` is
190+
`rewardsBalance ∘ DStateOf`{.AgdaFunction} — so components 3 and 4 must be added at the
190191
`LedgerState`{.AgdaRecord} level to make the `LEDGER-pov` equation balance against the
191192
`UTXO`{.AgdaDatatype} batch-balance equation, which charges `newCertDeposits`{.AgdaFunction}
192193
and `govProposalsDeposits`{.AgdaFunction} on the *produced* side. Cert deposits flow into

0 commit comments

Comments
 (0)