Skip to content

Commit 185ee2a

Browse files
committed
deploy: 7ecd85f
1 parent 9a749fb commit 185ee2a

18 files changed

Lines changed: 321 additions & 28 deletions

3sf_mini.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
const path_to_root = "";
3636
const default_light_theme = "light";
3737
const default_dark_theme = "navy";
38-
window.path_to_searchindex_js = "searchindex-a0050628.js";
38+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
3939
</script>
4040
<!-- Start loading toc.js asap -->
41-
<script src="toc-54238a3b.js"></script>
41+
<script src="toc-4653f9cc.js"></script>
4242
</head>
4343
<body>
4444
<div id="mdbook-help-container">

404.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
const path_to_root = "";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "searchindex-a0050628.js";
39+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
42-
<script src="toc-54238a3b.js"></script>
42+
<script src="toc-4653f9cc.js"></script>
4343
</head>
4444
<body>
4545
<div id="mdbook-help-container">

checkpoint_sync.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
const path_to_root = "";
3636
const default_light_theme = "light";
3737
const default_dark_theme = "navy";
38-
window.path_to_searchindex_js = "searchindex-a0050628.js";
38+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
3939
</script>
4040
<!-- Start loading toc.js asap -->
41-
<script src="toc-54238a3b.js"></script>
41+
<script src="toc-4653f9cc.js"></script>
4242
</head>
4343
<body>
4444
<div id="mdbook-help-container">

data_storage.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
const path_to_root = "";
3636
const default_light_theme = "light";
3737
const default_dark_theme = "navy";
38-
window.path_to_searchindex_js = "searchindex-a0050628.js";
38+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
3939
</script>
4040
<!-- Start loading toc.js asap -->
41-
<script src="toc-54238a3b.js"></script>
41+
<script src="toc-4653f9cc.js"></script>
4242
</head>
4343
<body>
4444
<div id="mdbook-help-container">
@@ -621,6 +621,9 @@ <h2 id="key-files"><a class="header" href="#key-files">Key Files</a></h2>
621621
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg></span>
622622
</a>
623623

624+
<a rel="next prefetch" href="spec_deviations.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
625+
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/></svg></span>
626+
</a>
624627

625628
<div style="clear: both"></div>
626629
</nav>
@@ -632,6 +635,9 @@ <h2 id="key-files"><a class="header" href="#key-files">Key Files</a></h2>
632635
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg></span>
633636
</a>
634637

638+
<a rel="next prefetch" href="spec_deviations.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
639+
<span class=fa-svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/></svg></span>
640+
</a>
635641
</nav>
636642

637643
</div>

fork_choice_visualization.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
const path_to_root = "";
3636
const default_light_theme = "light";
3737
const default_dark_theme = "navy";
38-
window.path_to_searchindex_js = "searchindex-a0050628.js";
38+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
3939
</script>
4040
<!-- Start loading toc.js asap -->
41-
<script src="toc-54238a3b.js"></script>
41+
<script src="toc-4653f9cc.js"></script>
4242
</head>
4343
<body>
4444
<div id="mdbook-help-container">

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
const path_to_root = "";
3636
const default_light_theme = "light";
3737
const default_dark_theme = "navy";
38-
window.path_to_searchindex_js = "searchindex-a0050628.js";
38+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
3939
</script>
4040
<!-- Start loading toc.js asap -->
41-
<script src="toc-54238a3b.js"></script>
41+
<script src="toc-4653f9cc.js"></script>
4242
</head>
4343
<body>
4444
<div id="mdbook-help-container">

introduction.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
const path_to_root = "";
3636
const default_light_theme = "light";
3737
const default_dark_theme = "navy";
38-
window.path_to_searchindex_js = "searchindex-a0050628.js";
38+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
3939
</script>
4040
<!-- Start loading toc.js asap -->
41-
<script src="toc-54238a3b.js"></script>
41+
<script src="toc-4653f9cc.js"></script>
4242
</head>
4343
<body>
4444
<div id="mdbook-help-container">

lmd_ghost.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
const path_to_root = "";
3636
const default_light_theme = "light";
3737
const default_dark_theme = "navy";
38-
window.path_to_searchindex_js = "searchindex-a0050628.js";
38+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
3939
</script>
4040
<!-- Start loading toc.js asap -->
41-
<script src="toc-54238a3b.js"></script>
41+
<script src="toc-4653f9cc.js"></script>
4242
</head>
4343
<body>
4444
<div id="mdbook-help-container">

metrics.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
const path_to_root = "";
3636
const default_light_theme = "light";
3737
const default_dark_theme = "navy";
38-
window.path_to_searchindex_js = "searchindex-a0050628.js";
38+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
3939
</script>
4040
<!-- Start loading toc.js asap -->
41-
<script src="toc-54238a3b.js"></script>
41+
<script src="toc-4653f9cc.js"></script>
4242
</head>
4343
<body>
4444
<div id="mdbook-help-container">

print.html

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
const path_to_root = "";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "searchindex-a0050628.js";
39+
window.path_to_searchindex_js = "searchindex-d3e5491e.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
42-
<script src="toc-54238a3b.js"></script>
42+
<script src="toc-4653f9cc.js"></script>
4343
</head>
4444
<body>
4545
<div id="mdbook-help-container">
@@ -2644,6 +2644,33 @@ <h2 id="key-files-1"><a class="header" href="#key-files-1">Key Files</a></h2>
26442644
</tbody>
26452645
</table>
26462646
</div>
2647+
<div style="break-before: page; page-break-before: always;"></div>
2648+
<h1 id="spec-deviations"><a class="header" href="#spec-deviations">Spec Deviations</a></h1>
2649+
<p>ethlambda diverges from the <a href="https://github.com/leanEthereum/leanSpec">leanSpec</a>
2650+
reference in a few places, mainly for performance reasons. This page lists those
2651+
deviations; each will be fleshed out with rationale, implementation notes, and
2652+
trade-offs over time.</p>
2653+
<h2 id="asynchronous-signature-aggregation-with-an-early-start-and-an-early-stop"><a class="header" href="#asynchronous-signature-aggregation-with-an-early-start-and-an-early-stop">Asynchronous signature aggregation with an early start and an early stop</a></h2>
2654+
<p>Aggregation runs off the main BlockChainServer actor loop, may start before its
2655+
interval, and stops early once it runs out of time.</p>
2656+
<ul>
2657+
<li><strong>ethlambda:</strong> the actor snapshots everything aggregation needs (<code>snapshot_aggregation_inputs</code>, <code>crates/blockchain/src/aggregation.rs</code>) and spawns a <code>tokio::task::spawn_blocking</code> worker (<code>run_aggregation_worker</code>, <code>aggregation.rs</code>). Candidates are the store’s gossip-signature groups plus payload-only groups (<code>new_payload_keys</code>, which need at least two existing proofs to merge). A tiered greedy selector orders them by consensus value (current-slot before stale, then <code>Finalize &gt; Justify &gt; Build</code>, mirroring the block builder) and emits at most <code>MAX_AGGREGATION_JOBS</code> jobs, dropping to a single job in the slot before one of our validators proposes. The worker streams each finished group back as an <code>AggregateProduced</code> message; the actor loop is never blocked on XMSS work.</li>
2658+
<li><strong>Early start:</strong> a session normally fires at interval 2, but may start up to <code>EARLY_AGGREGATION_WINDOW</code> earlier once the 2/3 signature threshold is already met (<code>maybe_start_early_aggregation</code>, <code>crates/blockchain/src/lib.rs</code>), so the proof lands earlier in the slot.</li>
2659+
<li><strong>Early stop:</strong> a <code>send_after(AGGREGATION_DEADLINE, ...)</code> timer cancels the session that long after <strong>session start</strong>, so a session that started early also ends early (<code>AGGREGATION_DEADLINE</code>, <code>aggregation.rs</code>). The worker checks <code>cancel.is_cancelled()</code> before each job (<code>aggregation.rs</code>); in-flight jobs finish, remaining jobs are dropped.</li>
2660+
<li><strong>leanSpec:</strong> <code>aggregate()</code> is called inline and synchronously from <code>tick_interval</code>, at interval 2 only. It walks every attestation data with fresh evidence, with no job cap, no time budget, no worker, and no cancellation.</li>
2661+
<li><strong>Equivalence:</strong> on cancellation the worker emits only the groups that finished, so a slot may pack fewer aggregates than the synchronous path would; any such subset still yields a valid block, affecting how many votes are included rather than signature validity. The job cap has the same character: it bounds prover work per slot, not what a block may carry.</li>
2662+
</ul>
2663+
<h2 id="attestation-scoring-on-block-building"><a class="header" href="#attestation-scoring-on-block-building">Attestation scoring on block building</a></h2>
2664+
<p>Attestations are scored and selected when packing a block, rather than taken in
2665+
target-slot order as they are scanned.</p>
2666+
<ul>
2667+
<li><strong>ethlambda:</strong> <code>select_attestations</code> (<code>crates/blockchain/src/block_builder.rs</code>) ranks candidate <code>AttestationData</code> entries by tier <code>Finalize &gt; Justify &gt; Build</code> (<code>enum Tier</code>, <code>block_builder.rs</code>). The within-tier order is tier-dependent (<code>EntryScore::ordering_key</code>, <code>block_builder.rs</code>): <code>Finalize</code>/<code>Justify</code> entries already cross 2/3, so newer chain progress leads (target slot, attestation slot, then new-voter count); <code>Build</code> entries only add marginal voters, so coverage leads (new-voter count, target slot, then attestation slot). <code>data_root</code> is the final deterministic tiebreak in both tiers. Each round picks the best candidate against a projected post-state.</li>
2668+
<li><strong>Proposer budget:</strong> rounds stop at <code>max_attestations_per_block</code> distinct <code>AttestationData</code> entries (<code>--max-attestations-per-block</code>, default 3), clamped to <code>MAX_ATTESTATIONS_DATA</code>. The <em>consensus</em> cap is <code>MAX_ATTESTATIONS_DATA</code>, the same value leanSpec enforces in its state transition; only the proposer-side budget differs, and it is configurable.</li>
2669+
<li><strong>Collapsing duplicate data:</strong> a winning entry may carry several proofs, which must collapse to one proof per <code>AttestationData</code> before the block is valid. By default ethlambda keeps only the best-coverage proof and <strong>drops</strong> the rest (<code>keep_best_proof_per_data</code>, <code>block_builder.rs</code>), skipping the leanVM merge at the cost of the voters those proofs carried. With <code>--enable-proposer-aggregation</code>, <code>compact_attestations</code> (<code>block_builder.rs</code>) instead merges them through recursive proof aggregation, which is what leanSpec always does.</li>
2670+
<li><strong>leanSpec:</strong> <code>build_block</code> scans candidates sorted by <code>(target.slot, data_root)</code>, oldest target first, and includes the first ones that pass its filters (greedy, no scoring), re-running the scan as a fixed point when justification/finalization advances. Its proposer budget is <code>MAX_ATTESTATIONS_DATA</code> itself.</li>
2671+
<li><strong>Equivalence:</strong> both produce a valid block. ethlambda front-loads the attestations that advance justification and finality, and within those tiers prefers the <em>newest</em> target where leanSpec takes the <em>oldest</em>; combined with the smaller default budget, an older entry can be outranked by newer ones round after round, so which votes reach peers through blocks differs even though every block stays valid. The smaller budget yields smaller blocks and lower build times.</li>
2672+
<li><strong>Upstream status:</strong> the tiered strategy is proposed upstream as leanSpec <a href="https://github.com/leanEthereum/leanSpec/pull/1149">PR #1149</a> (open at the time of writing), so this deviation may converge; the recursive-merge collapse follows leanSpec #510.</li>
2673+
</ul>
26472674

26482675
</main>
26492676

0 commit comments

Comments
 (0)