Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
89e12f6
Add Exp.expRayToWad, the native-range inverse of lnWadToRay
duncancmt Jun 28, 2026
6b48449
AGENTS.md: assembly and tooling conventions
duncancmt Jun 28, 2026
2c5976f
Optimize the Exp range reduction to a Q128 ln2 basis
duncancmt Jun 28, 2026
1b06007
Size the Exp margin to cover the range-reduction bias; never overesti…
duncancmt Jun 28, 2026
77c7798
Carry ln2 in one wide word; shrink the Exp margin 8x
duncancmt Jun 28, 2026
397d852
Scaffold the expRayToWad EVMYulLean proof: importer exp kind + package
duncancmt Jun 28, 2026
8c58232
Add reusable exp seam word-lemmas, overflow-guard, and revert reduction
duncancmt Jun 29, 2026
7a6e397
Prove fun_expRayToWad_70 reverts above the supported range
duncancmt Jun 29, 2026
e9b89eb
Parametrize the exp 70-revert by fuel slack and add the wrapper revert
duncancmt Jun 29, 2026
30c3f75
Prove expRayToWad reverts above the supported range
duncancmt Jun 29, 2026
c5f0dc1
Add exp-formal CI pass and axiom-gated Theorems signpost
duncancmt Jun 29, 2026
2a43c71
Reduce the exp value-path functions at the scale point x=0
duncancmt Jun 29, 2026
50ab83c
Add branch-agnostic allocate/abi_encode directs for the exp value .ok…
duncancmt Jun 29, 2026
c6e1751
Prove expRayToWad(0) = 1e18
duncancmt Jun 29, 2026
0d1618f
Prove the wordNat_slt bridge for the general exp kernel reduction
duncancmt Jun 29, 2026
8c7ca7d
Reduce the general exp kernel to the evm* tree (symbolic x)
duncancmt Jun 29, 2026
568099f
Add the slt_thresh_lt guard-skip sibling for the exp value path
duncancmt Jun 29, 2026
3a07533
Prove the exp value-path function chain returns the evm* tree (symbol…
duncancmt Jun 29, 2026
2a70ec2
Reduce the exp run-level value path to the evm* tree
duncancmt Jun 29, 2026
6c43f9c
Add the word-level transport foundation for exp monotonicity (Mono/Wo…
duncancmt Jun 29, 2026
d90527e
Add the exp layered tree definition and run-level bridge (Mono/Tree, …
duncancmt Jun 29, 2026
5900f7e
Add the exp clamp/pin shell decomposition (Mono/Shell, Mono/ShellOn)
duncancmt Jun 29, 2026
6b913b5
Reduce top-level exp monotonicity to the region analytic core (Mono/Top)
duncancmt Jun 29, 2026
acfea23
Add the exp octave-index transport and its monotonicity (Mono/Octave)
duncancmt Jun 29, 2026
3b835eb
Add the exp k bound and reduced-argument transport (Mono/Octave)
duncancmt Jun 29, 2026
002b79b
Prove within-octave reduced-argument monotonicity (Mono/Octave)
duncancmt Jun 29, 2026
fa4903c
Add the Mono facade and the Theorems gate entry for monotonicity
duncancmt Jun 29, 2026
4b46b76
Port cert Foundation (Poly) and exp Horner-stage transports
duncancmt Jun 29, 2026
d4486b9
Add quotient-stage transports for the exp kernel (tod, num/den, r0)
duncancmt Jun 29, 2026
dc95959
Discharge RegionMonotonicityFacts range and nonneg obligations
duncancmt Jun 29, 2026
cb2c588
Reduce same-octave r0 monotonicity to the tod*ev cross inequality
duncancmt Jun 29, 2026
daad001
Add per-stage Lipschitz bound for the exp Horner accumulators
duncancmt Jun 29, 2026
e86f5bf
Add reduced/squared-argument step gaps for adjacent same-octave inputs
duncancmt Jun 29, 2026
e71fca9
Add composed Lipschitz bounds for the exp even/odd accumulators
duncancmt Jun 29, 2026
fc50b86
Prove the same-octave cross inequality tod1*ev2 <= tod2*ev1
duncancmt Jun 29, 2026
5d1140d
Prove the within-octave adjacent r0/r1 monotone step
duncancmt Jun 29, 2026
88db2c7
Lift the adjacent step to region monotonicity of r1Tree
duncancmt Jun 29, 2026
26ea25f
Reduce RegionMonotonicityFacts to the octave-seam step
duncancmt Jun 29, 2026
2715aa0
Reduce the octave-seam step to the r0 doubling bound
duncancmt Jun 29, 2026
37e41ef
Reduce runtime monotonicity to the single seam r0 doubling bound
duncancmt Jun 29, 2026
62539d2
Add `Common` package: shared function-agnostic proof machinery
duncancmt Jun 29, 2026
725153c
Repoint `LnProof` at the shared `Common` package
duncancmt Jun 29, 2026
71f949f
Extract shared EVM-word lemmas to `Common.Word`; repoint `ExpProof`
duncancmt Jun 29, 2026
aacceb5
CI: build `Common` in the ln/exp formal checks
duncancmt Jun 29, 2026
1a400a6
Add expRayToWad Real.exp floor-bracket spec
duncancmt Jun 29, 2026
c9893d3
Add expRayToWad real-free Nat cut predicates
duncancmt Jun 29, 2026
21c1e1a
Add expRayToWad real bridge from cuts and accumulator to floor brackets
duncancmt Jun 29, 2026
ca4c0c7
Add exp reduced-argument Taylor cut cert generator and symbolic defs
duncancmt Jun 29, 2026
3a79e2d
Add exp reduced-argument Taylor cap bridge (Floor/Caps.lean)
duncancmt Jun 29, 2026
f9b201e
Regenerate + verify exp cut certs in CI
duncancmt Jun 29, 2026
d4f4946
Add exp floor brackets and worst-case comment
duncancmt Jun 29, 2026
e02a358
Reduce the exp accumulator bound to the octave-folded r0 bound
duncancmt Jun 29, 2026
1f91ade
Prove the exp reduced argument stays in the cert domain [-H128, H128]
duncancmt Jun 29, 2026
a0e2a25
Fix exp floor-bracket spec to target the signed input value
duncancmt Jun 29, 2026
deb104b
Prove the exp below-clamp target bound (RuntimeR0Bound.belowC)
duncancmt Jun 29, 2026
b04d64c
Add the exp even-Horner truncation bridge (RuntimeR0Bound gap-2, even…
duncancmt Jun 29, 2026
59ff19b
Add the exp odd-Horner truncation bridge (RuntimeR0Bound gap-2, odd h…
duncancmt Jun 29, 2026
0c91cad
Wire the discharged RuntimeR0Bound ingredients into the exp gate
duncancmt Jun 29, 2026
a7d05fe
Add the exp v-form Taylor cert for RuntimeR0Bound
duncancmt Jun 29, 2026
4658fa1
Add the exp reduced-argument real bound (RuntimeR0Bound gap-1)
duncancmt Jun 29, 2026
8289fe5
Add the exp v-truncation cert-polynomial bridge (RuntimeR0Bound, even…
duncancmt Jun 29, 2026
5a28eb6
Add the exp odd/tod/num/den cert brackets and the sdiv floor sandwich
duncancmt Jun 29, 2026
879cf4f
Tighten exp v-form cert margins to 2^-130 and gap-1 to 9/(8*2^128)
duncancmt Jun 29, 2026
bfee642
Tighten the exp tod cert bracket to 4*2^1193
duncancmt Jun 29, 2026
5889df8
Add the exp r0-vs-cert-rational bracket (RuntimeR0Bound/SeamR0Bound)
duncancmt Jun 29, 2026
2c1bc43
Add the exp octave-fold target identity, cert real bounds, and loose …
duncancmt Jun 29, 2026
d1485c0
Add the exp loose per-point deficit bound (nonnegative half)
duncancmt Jun 29, 2026
f1fe987
Add the exp negative-half integer brackets and reciprocal symmetry
duncancmt Jun 29, 2026
373ac16
Add the exp negative-half and combined per-point real bounds
duncancmt Jun 29, 2026
13cd65d
Discharge SeamR0Bound for runtime monotonicity
duncancmt Jun 29, 2026
7503a4a
Use le_or_gt in the exp per-point sign split (drop deprecated le_or_lt)
duncancmt Jun 29, 2026
e06806f
Add the exp fractional gap-2 telescoping
duncancmt Jun 29, 2026
2b0a9cf
Tighten the exp v-step bound to feed the joint over budget
duncancmt Jun 29, 2026
8ab5c66
Prove the exp joint per-point never-over (nonneg half) within the margin
duncancmt Jun 29, 2026
e6188b2
Prove the exp joint never-over on the negative half
duncancmt Jun 29, 2026
8414069
Add the exp per-point deficit (under) brackets, both signs
duncancmt Jun 29, 2026
5d32b5a
Make exp global floor brackets hypothesis-free; reduce central exact …
duncancmt Jun 29, 2026
b0c1fd6
Speed up the Floor/R0Exp.lean compile
duncancmt Jun 29, 2026
874a1b8
Split the deficit side into Floor/R0ExpUnder.lean
duncancmt Jun 29, 2026
25d16a3
Speed up the over-side R0Exp tactics
duncancmt Jun 29, 2026
717d0d8
Wire LnProof into the exp proof package for the round-trip
duncancmt Jun 29, 2026
58fe2b6
Prove the expRayToWad/lnWadToRay round trip
duncancmt Jun 29, 2026
5481ffa
Switch the exp cert pipeline to the v-form and restate the round trip
duncancmt Jun 30, 2026
c72c6a1
Tighten planning-reference guidance and block new markdown files
duncancmt Jun 30, 2026
f8dcb07
Tighten expRayToWad margin to the proof's decomposition floor
duncancmt Jun 30, 2026
5ffd01e
Tighten the proven maximum-underestimation bound for expRayToWad
duncancmt Jun 30, 2026
52b42f3
Remove the expRayToWad fuzz tests
duncancmt Jun 30, 2026
d104590
Align exp formal CI and documentation
duncancmt Jun 30, 2026
374cc75
Strengthen exp clamp boundary proof
duncancmt Jun 30, 2026
c23a4c1
Align the Exp.sol error-budget comment with the proofs
duncancmt Jul 1, 2026
acaef48
Cover the exp edges, the 1-ulp witness, and oracle-free fuzz
duncancmt Jul 1, 2026
73ae66e
Re-run the exp proof on all its inputs; share the LnProof pipeline
duncancmt Jul 1, 2026
0c7f13a
Prune the dead exp proof pathway; signpost the unconditional surface
duncancmt Jul 1, 2026
1ece210
State the exp proof comments in current terms
duncancmt Jul 1, 2026
5eae57f
Delete pyproject.toml
duncancmt Jun 30, 2026
e7a0d6d
WIP: clean up slop
duncancmt Jul 2, 2026
29f469d
WIP: clean up slop
duncancmt Jul 2, 2026
f6049d0
WIP: clean up slop
duncancmt Jul 2, 2026
e3b45ef
WIP: clean up slop
duncancmt Jul 2, 2026
b26ab44
WIP: clean up slop
duncancmt Jul 2, 2026
2b85d70
WIP: clean up slop
duncancmt Jul 2, 2026
51a0ca9
WIP: clean up slop
duncancmt Jul 2, 2026
e444a7d
WIP: clean up slop
duncancmt Jul 2, 2026
5a6a6a3
WIP: clean up slop
duncancmt Jul 2, 2026
1276222
WIP: clean up slop
duncancmt Jul 2, 2026
4f61b03
Fix missing CI trigger
duncancmt Jul 2, 2026
e35bb61
WIP: clean up slop
duncancmt Jul 2, 2026
05ecaf1
Homogenize
duncancmt Jul 2, 2026
742f170
Share the formal CI toolchain setup across the proof workflows
duncancmt Jul 2, 2026
9d7cad5
Add exact-floor witnesses across the exp negative octaves
duncancmt Jul 2, 2026
3531403
Refer to src/wrappers/ in AGENTS.md
duncancmt Jul 2, 2026
cfdaa93
WIP: clean up slop
duncancmt Jul 2, 2026
46d670e
Carry v at Q123 so the exp monic stage is a bare add
duncancmt Jul 2, 2026
0429f66
Carry the exp rational at full staircase precision; tighten the margin
duncancmt Jul 2, 2026
bc6b64e
Document the fixed-point rational coefficient derivation pipeline
duncancmt Jul 2, 2026
d5d72ca
WIP: clean up slop
duncancmt Jul 2, 2026
32120e5
Set the exp margin at the certifiable granularity envelope
duncancmt Jul 2, 2026
053090f
State the exact Ln bias margin
duncancmt Jul 2, 2026
5d22714
WIP: clean up slop
duncancmt Jul 2, 2026
456f1f0
WIP: clean up slop
duncancmt Jul 2, 2026
28802d2
WIP: clean up slop
duncancmt Jul 2, 2026
51b4b79
Re-derive the exp proof for the Q123 kernel
duncancmt Jul 2, 2026
2ecccca
Fold the exp output on the 5^18 grid; unsigned close; 32-piece margin
duncancmt Jul 2, 2026
8efdde5
Certify the 5^18 fold, unsigned close, and 32-piece granularity
duncancmt Jul 2, 2026
7e3577f
Merge fable/exp into dcmt/exp
duncancmt Jul 2, 2026
1cbda8f
Cleanup
duncancmt Jul 2, 2026
e1b5dca
Notation
duncancmt Jul 2, 2026
1773fb9
Post-merge cleanup
duncancmt Jul 2, 2026
cc34ee4
Anchor the Ln runtime model to the Solidity-level guard
duncancmt Jul 2, 2026
542bb55
Formatting
duncancmt Jul 2, 2026
431f33b
Style
duncancmt Jul 2, 2026
384f015
Request the Yul IR from every compile in generate_from_forge.sh
duncancmt Jul 2, 2026
3891092
Share the exp granularity piece table between the generator and the p…
duncancmt Jul 2, 2026
3d3818c
Merge fable/exp into dcmt/exp
duncancmt Jul 2, 2026
ed10526
Share the cover-certificate generator helpers in Common.GenCover
duncancmt Jul 2, 2026
f2ecd31
Renumber the exp Seam reductions to the current compiled Yul
duncancmt Jul 2, 2026
e82bfdf
Remove dead hypotheses, no-op tactics, and unused simp arguments
duncancmt Jul 2, 2026
7f13c76
Deduplicate the word-level proof machinery into Common.Word
duncancmt Jul 2, 2026
9b7d589
Carry ev at Q88 and Od at Q89; tighten the margin to the new envelope
duncancmt Jul 3, 2026
2001290
Refit the exp coefficients on the Q88/Q89 grids; halve the cut nudge
duncancmt Jul 3, 2026
e24c696
Comment style; clarity
duncancmt Jul 3, 2026
8b3045d
Formatting
duncancmt Jul 3, 2026
2505893
Extend the supported exp range through the k = 64 octave
duncancmt Jul 3, 2026
0341b5b
Merge fable/exp into dcmt/exp
duncancmt Jul 3, 2026
7c732dc
Write the clamp constant as a negation
duncancmt Jul 3, 2026
13a4ca9
Merge fable/exp into dcmt/exp
duncancmt Jul 3, 2026
48e3f29
Fix comment
duncancmt Jul 3, 2026
007cbee
Fold the exp output scale into the closing division; rebase CINV to 2…
duncancmt Jul 4, 2026
66aea3a
Extend the supported exp range through the k = 65 octave
duncancmt Jul 5, 2026
b5fe25a
Express the even closing constant as the doubled odd constant
duncancmt Jul 5, 2026
e99a89a
Document settling negatives with the envelope instruments
duncancmt Jul 5, 2026
1712174
Add decision-making discipline to the development guide
duncancmt Jul 7, 2026
45cc47f
Clean up comments
duncancmt Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/actions/build-ln-proof/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build LnProof
description: >-
Generate the LnWrapper EVMYulLean artifacts and certificate literals, then
build the LnProof Lean package. Requires Foundry, solc 0.8.34, the pinned
Lean toolchain, and a built formal/yul importer.

runs:
using: composite
steps:
- name: Generate EVMYulLean artifacts from compiled LnWrapper Yul IR
shell: bash
run: |
./formal/yul/generate_from_forge.sh \
ln \
src/wrappers/LnWrapper.sol:LnWrapper \
formal/ln/LnProof/LnProof/LnYul.lean \
0.8.34

- name: Fetch Ln proof dependency cache
uses: ./.github/actions/fetch-lean-cache
with:
working-directory: formal/ln/LnProof

- name: Generate Ln certificate artifacts
shell: bash
working-directory: formal/ln/LnProof
run: |
lake build LnProof.Floor.CertDefs Common.Foundation.KroneckerShift LnProof.Floor.Consts Common.GenCover
lake env lean GenFloorCertLit.lean
lake build LnProof.Cert.FloorCertLit
lake env lean GenCover.lean
lake env lean GenErr1.lean
lake build LnProof.Error.Core
lake env lean GenErrLit.lean

- name: Build Ln proof package
shell: bash
working-directory: formal/ln/LnProof
run: lake build
25 changes: 25 additions & 0 deletions .github/actions/fetch-lean-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Fetch Lean build cache
description: >-
Run `lake exe cache get` for a Lean package, first materializing the
ProofWidgets release layout it requires.

inputs:
working-directory:
description: Directory containing the Lean package's lakefile.
required: true

runs:
using: composite
steps:
- name: Fetch Lean build cache
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
# Mathlib's `cache get` fetches the ProofWidgets cloud release, then
# deletes its `lib`/`ir` outputs and fails if they are missing. Fetch
# the release and ensure those directories exist before it runs.
lake build proofwidgets:release
mkdir -p \
.lake/packages/proofwidgets/.lake/build/lib \
.lake/packages/proofwidgets/.lake/build/ir
lake exe cache get
83 changes: 83 additions & 0 deletions .github/actions/setup-formal/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Set up the formal toolchain
description: >-
The shared prefix of every *-formal workflow: install Foundry and the pinned
Lean toolchain, restore the Lean build cache, install solc 0.8.34, fetch the
Yul importer's Mathlib cache, and build the Yul importer. Requires the
repository (with submodules) to be checked out first.

inputs:
lean-toolchain-files:
description: >-
Newline-separated lean-toolchain file paths. The first names the
toolchain to install; every subsequent file must pin the same toolchain.
required: true
cache-name:
description: Per-proof segment of the Lean build cache key (e.g. exp-formal).
required: true
cache-paths:
description: >-
Newline-separated proof-package build directories to cache, in addition
to the Yul importer's and EVMYulLean's.
required: true
cache-hash-globs:
description: >-
Newline-separated hashFiles patterns covering the proof packages' lake
configuration and Lean sources, hashed into the cache key alongside the
Yul importer's and EVMYulLean's.
required: true

runs:
using: composite
steps:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.5.1

- name: Install pinned Lean toolchain
shell: bash
env:
LEAN_TOOLCHAIN_FILES: ${{ inputs.lean-toolchain-files }}
run: |
curl https://raw.githubusercontent.com/leanprover/elan/917c18d0ad52f649c2603dc8b973f5b9fa5f8f43/elan-init.sh -sSf | sh -s -- -y --default-toolchain none
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
LEAN_TOOLCHAIN=''
while IFS= read -r file; do
[ -n "$file" ] || continue
if [ -z "$LEAN_TOOLCHAIN" ]; then
LEAN_TOOLCHAIN="$(cat "$file")"
else
test "$LEAN_TOOLCHAIN" = "$(cat "$file")"
fi
done <<< "$LEAN_TOOLCHAIN_FILES"
"$HOME/.elan/bin/elan" toolchain install "$LEAN_TOOLCHAIN"
"$HOME/.elan/bin/elan" default "$LEAN_TOOLCHAIN"

- name: Restore Lean build cache
uses: actions/cache@v4
with:
path: |
formal/yul/.lake/build
formal/yul/.lake/packages/*/.lake/build
lib/EVMYulLean/.lake/build
${{ inputs.cache-paths }}
key: ${{ runner.os }}-${{ inputs.cache-name }}-lean-${{ hashFiles('formal/yul/lean-toolchain', 'formal/yul/lakefile.toml', 'formal/yul/lake-manifest.json', 'formal/yul/FormalYul/**/*.lean', 'lib/EVMYulLean/**/*.lean') }}-${{ hashFiles(inputs.cache-hash-globs) }}
restore-keys: |
${{ runner.os }}-${{ inputs.cache-name }}-lean-
${{ runner.os }}-formal-lean-

- name: Install solc 0.8.34
shell: bash
run: forge build -- src/chains/Mainnet/TakerSubmitted.sol
env:
FOUNDRY_SOLC_VERSION: 0.8.34

- name: Fetch Mathlib cache
uses: ./.github/actions/fetch-lean-cache
with:
working-directory: formal/yul

- name: Build Yul importer
shell: bash
working-directory: formal/yul
run: lake build FormalYul.Preservation yul_importer
72 changes: 20 additions & 52 deletions .github/workflows/cbrt-formal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- formal/yul/**
- foundry.toml
- remappings.txt
- .gitmodules
- lib/EVMYulLean
- .github/actions/setup-formal/**
- .github/actions/fetch-lean-cache/**
- .github/workflows/cbrt-formal.yml
pull_request:
paths:
Expand All @@ -22,6 +26,10 @@ on:
- formal/yul/**
- foundry.toml
- remappings.txt
- .gitmodules
- lib/EVMYulLean
- .github/actions/setup-formal/**
- .github/actions/fetch-lean-cache/**
- .github/workflows/cbrt-formal.yml

jobs:
Expand All @@ -32,50 +40,17 @@ jobs:
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install pinned Lean toolchain
run: |
curl https://raw.githubusercontent.com/leanprover/elan/917c18d0ad52f649c2603dc8b973f5b9fa5f8f43/elan-init.sh -sSf | sh -s -- -y --default-toolchain none
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
LEAN_TOOLCHAIN="$(cat formal/cbrt/CbrtProof/lean-toolchain)"
"$HOME/.elan/bin/elan" toolchain install "$LEAN_TOOLCHAIN"
"$HOME/.elan/bin/elan" default "$LEAN_TOOLCHAIN"

- name: Restore Lean build cache
uses: actions/cache@v4
- name: Set up the formal toolchain
uses: ./.github/actions/setup-formal
with:
path: |
formal/yul/.lake/build
formal/yul/.lake/packages/*/.lake/build
lib/EVMYulLean/.lake/build
lean-toolchain-files: formal/cbrt/CbrtProof/lean-toolchain
cache-name: cbrt-formal
cache-paths: |
formal/cbrt/CbrtProof/.lake/build
key: ${{ runner.os }}-cbrt-formal-lean-${{ hashFiles('formal/yul/lean-toolchain', 'formal/yul/lakefile.toml', 'formal/yul/lake-manifest.json', 'formal/cbrt/CbrtProof/lakefile.toml', 'formal/cbrt/CbrtProof/lake-manifest.json', 'formal/yul/FormalYul/**/*.lean', 'formal/cbrt/CbrtProof/**/*.lean', 'lib/EVMYulLean/**/*.lean') }}
restore-keys: |
${{ runner.os }}-cbrt-formal-lean-
${{ runner.os }}-formal-lean-

- name: Install solc 0.8.34
run: forge build -- src/chains/Mainnet/TakerSubmitted.sol
env:
FOUNDRY_SOLC_VERSION: 0.8.34

- name: Fetch Mathlib cache
working-directory: formal/yul
run: |
# Mathlib's `cache get` fetches the ProofWidgets cloud release, then
# deletes its `lib`/`ir` outputs and fails if they are missing. Fetch
# the release and ensure those directories exist before it runs.
lake build proofwidgets:release
mkdir -p \
.lake/packages/proofwidgets/.lake/build/lib \
.lake/packages/proofwidgets/.lake/build/ir
lake exe cache get

- name: Build Yul importer
working-directory: formal/yul
run: lake build FormalYul.Preservation yul_importer
cache-hash-globs: |
formal/cbrt/CbrtProof/lakefile.toml
formal/cbrt/CbrtProof/lake-manifest.json
formal/cbrt/CbrtProof/**/*.lean

- name: Generate EVMYulLean artifacts from compiled CbrtWrapper Yul IR
run: |
Expand All @@ -91,16 +66,9 @@ jobs:
--output formal/cbrt/CbrtProof/CbrtProof/FiniteCert.lean

- name: Fetch proof dependency cache
working-directory: formal/cbrt/CbrtProof
run: |
# Mathlib's `cache get` fetches the ProofWidgets cloud release, then
# deletes its `lib`/`ir` outputs and fails if they are missing. Fetch
# the release and ensure those directories exist before it runs.
lake build proofwidgets:release
mkdir -p \
.lake/packages/proofwidgets/.lake/build/lib \
.lake/packages/proofwidgets/.lake/build/ir
lake exe cache get
uses: ./.github/actions/fetch-lean-cache
with:
working-directory: formal/cbrt/CbrtProof

- name: Build Cbrt proof package
working-directory: formal/cbrt/CbrtProof
Expand Down
78 changes: 25 additions & 53 deletions .github/workflows/cbrt512-formal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
- formal/yul/**
- foundry.toml
- remappings.txt
- .gitmodules
- lib/EVMYulLean
- .github/actions/setup-formal/**
- .github/actions/fetch-lean-cache/**
- .github/workflows/cbrt512-formal.yml
pull_request:
paths:
Expand All @@ -36,6 +40,10 @@ on:
- formal/yul/**
- foundry.toml
- remappings.txt
- .gitmodules
- lib/EVMYulLean
- .github/actions/setup-formal/**
- .github/actions/fetch-lean-cache/**
- .github/workflows/cbrt512-formal.yml

jobs:
Expand All @@ -46,52 +54,23 @@ jobs:
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install pinned Lean toolchain
run: |
curl https://raw.githubusercontent.com/leanprover/elan/917c18d0ad52f649c2603dc8b973f5b9fa5f8f43/elan-init.sh -sSf | sh -s -- -y --default-toolchain none
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
LEAN_TOOLCHAIN="$(cat formal/cbrt/Cbrt512Proof/lean-toolchain)"
test "$LEAN_TOOLCHAIN" = "$(cat formal/cbrt/CbrtProof/lean-toolchain)"
"$HOME/.elan/bin/elan" toolchain install "$LEAN_TOOLCHAIN"
"$HOME/.elan/bin/elan" default "$LEAN_TOOLCHAIN"

- name: Restore Lean build cache
uses: actions/cache@v4
- name: Set up the formal toolchain
uses: ./.github/actions/setup-formal
with:
path: |
formal/yul/.lake/build
formal/yul/.lake/packages/*/.lake/build
lib/EVMYulLean/.lake/build
lean-toolchain-files: |
formal/cbrt/Cbrt512Proof/lean-toolchain
formal/cbrt/CbrtProof/lean-toolchain
cache-name: cbrt512-formal
cache-paths: |
formal/cbrt/CbrtProof/.lake/build
formal/cbrt/Cbrt512Proof/.lake/build
key: ${{ runner.os }}-cbrt512-formal-lean-${{ hashFiles('formal/yul/lean-toolchain', 'formal/yul/lakefile.toml', 'formal/yul/lake-manifest.json', 'formal/cbrt/CbrtProof/lakefile.toml', 'formal/cbrt/CbrtProof/lake-manifest.json', 'formal/cbrt/Cbrt512Proof/lakefile.toml', 'formal/cbrt/Cbrt512Proof/lake-manifest.json', 'formal/yul/FormalYul/**/*.lean', 'formal/cbrt/CbrtProof/**/*.lean', 'formal/cbrt/Cbrt512Proof/**/*.lean', 'lib/EVMYulLean/**/*.lean') }}
restore-keys: |
${{ runner.os }}-cbrt512-formal-lean-
${{ runner.os }}-formal-lean-

- name: Install solc 0.8.34
run: forge build -- src/chains/Mainnet/TakerSubmitted.sol
env:
FOUNDRY_SOLC_VERSION: 0.8.34

- name: Fetch Mathlib cache
working-directory: formal/yul
run: |
# Mathlib's `cache get` fetches the ProofWidgets cloud release, then
# deletes its `lib`/`ir` outputs and fails if they are missing. Fetch
# the release and ensure those directories exist before it runs.
lake build proofwidgets:release
mkdir -p \
.lake/packages/proofwidgets/.lake/build/lib \
.lake/packages/proofwidgets/.lake/build/ir
lake exe cache get

- name: Build Yul importer
working-directory: formal/yul
run: lake build FormalYul.Preservation yul_importer
cache-hash-globs: |
formal/cbrt/CbrtProof/lakefile.toml
formal/cbrt/CbrtProof/lake-manifest.json
formal/cbrt/Cbrt512Proof/lakefile.toml
formal/cbrt/Cbrt512Proof/lake-manifest.json
formal/cbrt/CbrtProof/**/*.lean
formal/cbrt/Cbrt512Proof/**/*.lean

- name: Generate 512-bit EVMYulLean artifacts from compiled Cbrt512Wrapper Yul IR
run: |
Expand All @@ -107,16 +86,9 @@ jobs:
--output formal/cbrt/CbrtProof/CbrtProof/FiniteCert.lean

- name: Fetch proof dependency cache
working-directory: formal/cbrt/Cbrt512Proof
run: |
# Mathlib's `cache get` fetches the ProofWidgets cloud release, then
# deletes its `lib`/`ir` outputs and fails if they are missing. Fetch
# the release and ensure those directories exist before it runs.
lake build proofwidgets:release
mkdir -p \
.lake/packages/proofwidgets/.lake/build/lib \
.lake/packages/proofwidgets/.lake/build/ir
lake exe cache get
uses: ./.github/actions/fetch-lean-cache
with:
working-directory: formal/cbrt/Cbrt512Proof

- name: Build Cbrt512 proof package
working-directory: formal/cbrt/Cbrt512Proof
Expand Down
Loading
Loading