Skip to content
Draft
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
2311463
refactor(common): route block inscriptions through one codec
agureev Nov 10, 2026
0b8974c
fix(sequencer): size blocks by their inscription bytes
agureev Nov 10, 2026
d032b50
feat!: hash transactions and blocks over proof digests, and fetch pro…
agureev Nov 12, 2026
486331d
test: pin the digest-form hashes, the proof store and fetching proofs…
agureev Nov 12, 2026
8be3ca5
feat!: inscribe blocks in digest form and settle them by the skip rule
agureev Nov 12, 2026
98a4551
test(chain_state): select and settle by the skip rule
agureev Nov 12, 2026
6175399
test(sequencer, common): digest-form blocks, transaction caps and the…
agureev Nov 12, 2026
d399c8b
test(indexer, cross_zone): index and deliver only settled blocks
agureev Nov 12, 2026
7e09fd4
Merge remote-tracking branch 'origin/dev' into artem/block-proof-gossip
agureev Nov 12, 2026
8babfdf
fixup! Merge remote-tracking branch 'origin/dev' into artem/block-pro…
agureev Nov 12, 2026
dab220c
fixup! Merge remote-tracking branch 'origin/dev' into artem/block-pro…
agureev Nov 12, 2026
ab8872d
refactor(executor): take the proof store from the chain state
agureev Nov 12, 2026
50f2dc1
refactor(common): read a transaction's or a block's proofs through on…
agureev Nov 12, 2026
84a8a76
refactor(common): hydrate a digest-form block to an Option
agureev Nov 12, 2026
02b7119
refactor(chain_state): keep one proof store handle and measure the di…
agureev Nov 12, 2026
824a671
test: drop size and pinning tests another layer already pins
agureev Nov 12, 2026
28edb80
refactor(gossip): fetch proofs over libp2p's JSON request-response codec
agureev Nov 12, 2026
55beee4
fixup! refactor(common): read a transaction's or a block's proofs thr…
agureev Nov 12, 2026
5d6058c
refactor(cross_zone): fold a peer's batch once for both structural re…
agureev Nov 12, 2026
c2a1029
test(chain_state): build the shared private transfer with the apply t…
agureev Nov 12, 2026
50d411b
test(sequencer): run a watcher pass through one helper
agureev Nov 12, 2026
6cea44b
fixup! test(chain_state): build the shared private transfer with the …
agureev Nov 12, 2026
caf2dc1
Revert "refactor(cross_zone): fold a peer's batch once for both struc…
agureev Nov 12, 2026
ce4cbf0
refactor(executor): settle a held block's deliveries in the replay's …
agureev Nov 12, 2026
273ac01
refactor(indexer): chain each batch on the fold's final message
agureev Nov 12, 2026
323452c
refactor(chain_state): read batches with try_unfold
agureev Nov 12, 2026
5b854d5
test(chain_state): name the skip-rule fixture blocks by their roles
agureev Nov 17, 2026
da5411e
refactor(chain_state): check a proof against the cap in one place
agureev Nov 17, 2026
0324dce
fix(executor): cache a submitted proof only within the proof cap
agureev Nov 17, 2026
b6cff42
refactor(lee): make the proof digest a plain 32-byte array
agureev Nov 17, 2026
39ce634
refactor(chain_state): rename fold outcomes, verdicts and blocker fields
agureev Nov 17, 2026
a566af8
refactor(sequencer): name follow's hydration result for what it reports
agureev Nov 17, 2026
538020b
refactor(indexer): name the ingestion loop's state and actions
agureev Nov 17, 2026
5e32cf7
docs: describe settlement as settled state and trim review comments
agureev Nov 17, 2026
6b156c8
test(chain_state): a misplaced block on the settled tip is punishable
agureev Nov 17, 2026
a5b308f
test(executor): cache a proof within the cap and refuse one over it
agureev Nov 17, 2026
11a519f
test(chain_state): pin the skip-rule tests' windows, offences and lat…
agureev Nov 17, 2026
a8b509f
docs(indexer): describe what a failed pass reads again and what stays…
agureev Nov 17, 2026
e0ee779
Merge remote-tracking branch 'origin/dev' into artem/block-proof-gossip
agureev Nov 18, 2026
09bc0b6
feat(storage): add a Logos Storage REST client
agureev Nov 18, 2026
d88a7fc
feat(sequencer): track verified proof locators and their holds
agureev Nov 18, 2026
94828dd
feat(sequencer): bound proof downloads and keep live capacity
agureev Nov 18, 2026
2ee6c7b
feat!(common): inscribe a Storage locator per private transaction
agureev Nov 18, 2026
27c00a2
feat!(sequencer): announce private transactions by digest and locator
agureev Nov 18, 2026
a999685
feat!(sequencer): recover missing proofs by locator and digest lookup
agureev Nov 18, 2026
50fa0f7
feat(indexer): fetch proofs from Logos Storage, with getProof as reco…
agureev Nov 18, 2026
a791bfe
feat(sequencer_stake): sign availability approvals
agureev Nov 18, 2026
d945c37
feat(sequencer): approve candidates whose proofs this node serves
agureev Nov 18, 2026
83f2683
feat!(sequencer): publish proof-bearing blocks on a two-thirds availa…
agureev Nov 18, 2026
92f9c7d
chore(docker): run a pinned Logos Storage node beside the sequencer a…
agureev Nov 18, 2026
c00700a
docs: document Logos Storage proof distribution
agureev Nov 18, 2026
51aabe6
test(common): pin the locator inscription and its charge
agureev Nov 18, 2026
f9c6617
test(storage): screen manifests and bound downloads
agureev Nov 18, 2026
d911af8
test(sequencer): admit announced private transactions after screening
agureev Nov 18, 2026
91bb07e
test(sequencer): count availability approvals and fall back to public…
agureev Nov 18, 2026
7002c13
test(indexer): recover proofs by locator and by digest
agureev Nov 18, 2026
cc4a013
test(sequencer): recover a proof by digest after a wrong locator
agureev Nov 18, 2026
fd3fed6
fixup! feat!(sequencer): announce private transactions by digest and …
agureev Nov 18, 2026
81746c2
fixup! feat(storage): add a Logos Storage REST client
agureev Nov 18, 2026
195dc55
fixup! feat(sequencer): bound proof downloads and keep live capacity
agureev Nov 18, 2026
0662be6
fixup! feat!(common): inscribe a Storage locator per private transaction
agureev Nov 18, 2026
11138ea
fixup! feat!(sequencer): announce private transactions by digest and …
agureev Nov 18, 2026
7e6cc7f
fixup! feat!(sequencer): recover missing proofs by locator and digest…
agureev Nov 18, 2026
5669d13
fixup! feat(indexer): fetch proofs from Logos Storage, with getProof …
agureev Nov 18, 2026
6632653
fixup! feat(sequencer): approve candidates whose proofs this node serves
agureev Nov 18, 2026
6269903
fixup! feat!(sequencer): publish proof-bearing blocks on a two-thirds…
agureev Nov 18, 2026
e0cc696
fixup! test(sequencer): admit announced private transactions after sc…
agureev Nov 18, 2026
3f39219
fixup! test(sequencer): count availability approvals and fall back to…
agureev Nov 18, 2026
5944d95
fixup! feat(storage): add a Logos Storage REST client
agureev Nov 18, 2026
417914c
fixup! feat(sequencer): bound proof downloads and keep live capacity
agureev Nov 18, 2026
497155d
fixup! feat!(sequencer): recover missing proofs by locator and digest…
agureev Nov 18, 2026
1d7322f
fixup! feat(indexer): fetch proofs from Logos Storage, with getProof …
agureev Nov 18, 2026
047f115
fixup! feat!(sequencer): publish proof-bearing blocks on a two-thirds…
agureev Nov 18, 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
35 changes: 32 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,12 @@ libp2p = { version = "0.57", features = [
"ed25519",
"gossipsub",
"identify",
"json",
"kad",
"macros",
"mdns",
"quic",
"request-response",
"tokio",
] }
aes-gcm = { version = "0.10.3", features = ["zeroize"] }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To our knowledge, this design is unique to LEZ. Other privacy-focused programmab
2. Transfer from public to private (local / privacy-preserving execution)
- Alice runs the token program `Transfer` function locally, sending to Bob’s private account.
- A ZKP of correct execution is generated.
- The proof is submitted to the blockchain and verified by validators.
- The proof is submitted to the validators, which verify it; only its digest is published on-chain.
- Alice’s public balance is updated on-chain.
- Bob’s private balance remains hidden, while the transfer is provably correct.

Expand Down
10 changes: 5 additions & 5 deletions docs/benchmarks/integration_bench.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ All three draw from a genesis-funded public account and move the native token; n
|---|---|---|
| Wall time per step | same in both modes | real adds the PPE prove time per private step |
| `public_tx_bytes` | same in both modes | same in both modes |
| `ppe_tx_bytes` | n/a | dev: the message plus a stub proof pruned to a digest → real: the message plus 223 KB (`PROOF_BYTES` from cycle_bench) |
| `block_bytes` | same in both modes | real adds about 223 KB per PPE tx in the block |
| `ppe_tx_bytes` | n/a | same in both modes: the proof is published as its 32-byte digest |
| `block_bytes` | same in both modes | same in both modes |
| `bedrock_finality_s` | same in both modes | same in both modes (L1 cadence, not LEZ prover) |
| Blocks captured | similar in both modes | real captures more empty clock-only ticks that fill prove wall-time |

Tables below report dev mode for all three scenarios. A real-proving sweep is not run here; `cycle_bench --ppe` measures the per-PPE prove cost directly.

## Methodology

Per scenario, every produced block is fetched via `getBlock(BlockId)` and serialized with `borsh::to_vec(&Block)`. Each transaction is serialized individually and counted by variant. Empty clock-only ticks give the per-block fixed-cost baseline. Wall time is captured per step (submit + inclusion + wallet sync) and aggregated to the per-scenario `total_s`. The one-time stack-setup cost (`shared_setup_s` at the run level) and the closing bedrock finality wait (`bedrock_finality_s` per scenario) are reported separately, not folded into `total_s`.
Per scenario, every produced block is fetched via `getBlock(BlockId)` and measured as inscribed, each proof replaced by its digest (`block.digested().to_inscription()`). Each transaction is measured individually in the same form and counted by variant. Empty clock-only ticks give the per-block fixed-cost baseline. Wall time is captured per step (submit + inclusion + wallet sync) and aggregated to the per-scenario `total_s`. The one-time stack-setup cost (`shared_setup_s` at the run level) and the closing bedrock finality wait (`bedrock_finality_s` per scenario) are reported separately, not folded into `total_s`.

`bedrock_finality_s` is the time for the indexer's L1-finalised block id to reach the sequencer tip. If it does not within `--finality-timeout-s` (default 300), the scenario records it as unmeasured rather than reporting the deadline as a latency.

Expand Down Expand Up @@ -67,12 +67,12 @@ In dev mode every submitting step costs about 30 s, which is block cadence and n
| private_chained_flow | 9 | 8,891 | 810..25,210 | 314 / 18 | 24,244 / 3 |
| parallel_fanout | 60 | 933 | 810..1,181 | 322 / 140 | n/a |

The `private_chained_flow` `ppe_tx_bytes` above are dev-mode stubs, measured before the proof's claim was pruned to a digest; a dev-mode stub is now far smaller. Under real proving each grows by the 223 KB proof from cycle_bench.
These figures predate digest-form inscriptions: they count each PPE transaction's full proof, a dev-mode stub measured before the proof's claim was pruned to a digest. Each PPE transaction now publishes its proof as a 32-byte digest, in either mode.

## Findings

- Public native transfers are small and uniform: 258 to 371 bytes per transaction, under 1.2 KB per block.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Public native transfers are small and uniform: 258 to 371 bytes per transaction, under 1.2 KB per block.

- A PPE transaction dominates its block. Even the dev-mode stub takes a block from 810 bytes to 25 KB, and real proofs take it to roughly 223 KB.
- Before digest-form inscriptions, a PPE transaction dominated its block: even the dev-mode stub took a block from 810 bytes to 25 KB, and real proofs took it to roughly 223 KB. Blocks now publish a 32-byte digest per proof; re-measurement is pending.
- Wall time in dev mode is set by block cadence, not by the node's work.

## Reproduce
Expand Down
4 changes: 3 additions & 1 deletion docs/metrics/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ Titles carry no "Sequencer" prefix, since every dashboard here is about sequence
| Is the rotation fair, and are turns used? | **Share of turns**, **Share of blocks produced**, **Blocks per turn** over the time range |
| Is anyone falling behind or failing? | **Blocks behind the network**, **Failed production turns in a row** |

`blocks_produced_total` counts a block once the channel finalizes it, signed by this sequencer: a block on the head can still be orphaned when another sequencer's inscription wins the same position, typically around a turn handover. Summed over sequencers it equals the finalized chain height, as long as none restarted.
`blocks_produced_total` counts a block once it settles, signed by this sequencer: until then a block on the head can still be orphaned when another sequencer's inscription wins the same position, typically around a turn handover, or cut when the next writer skips it. Summed over sequencers it equals the settled chain height, as long as none restarted.

`skips_total{writer}` counts the skips each writer placed, once final: blocks built on the parent of another writer's private block, cutting it. An honest writer skips a block whose proofs it never received, so a high count is evidence for eviction, not proof of a fault.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`skips_total{writer}` counts the skips each writer placed, once final: blocks built on the parent of another writer's private block, cutting it. An honest writer skips a block whose proofs it never received, so a high count is evidence for eviction, not proof of a fault.
`skips_total{writer}` counts the skips, once final: blocks built on the parent of another writer's block, cutting it. An honest writer skips a block whose proofs it never received.


Turns come from Bedrock: the zone SDK notifies a sequencer when its turn to write starts and ends, and the Bedrock actor forwards that to the executor. `sequencer_executor_actor_metrics` records them as `turn_to_write` (1 while held) and `turns_to_write_total` (turns started; a turn notified several times counts once, while a new starting slot is a new turn even for the same holder).

Expand Down
22 changes: 18 additions & 4 deletions integration_tests/src/testing_framework/apps/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl LezIndexerClient {
#[derive(Clone)]
pub struct IndexerApp {
bedrock_addr: SocketAddr,
proof_source: Option<SocketAddr>,
state_dir: Option<PathBuf>,
}

Expand All @@ -76,10 +77,18 @@ impl IndexerApp {
pub const fn new(bedrock_addr: SocketAddr) -> Self {
Self {
bedrock_addr,
proof_source: None,
state_dir: None,
}
}

/// Fetches the proofs of private blocks from the sequencer at `addr`.
#[must_use]
pub const fn with_proof_source(mut self, addr: SocketAddr) -> Self {
self.proof_source = Some(addr);
self
}

/// Places indexer state and logs below the supplied scenario artifact
/// directory.
#[must_use]
Expand All @@ -100,6 +109,7 @@ impl AppDeployment<AppHostEnv> for IndexerApp {
if let Some(home) = self.state_dir {
service = crate::setup::setup_indexer_at(
self.bedrock_addr,
self.proof_source,
config::bedrock_channel_id(),
None,
&home,
Expand All @@ -108,10 +118,14 @@ impl AppDeployment<AppHostEnv> for IndexerApp {
.context("failed to set up LEZ indexer")?;
state_dir = None;
} else {
let (indexer, temp_dir) =
setup_indexer(self.bedrock_addr, config::bedrock_channel_id(), None)
.await
.context("failed to set up LEZ indexer")?;
let (indexer, temp_dir) = setup_indexer(
self.bedrock_addr,
self.proof_source,
config::bedrock_channel_id(),
None,
)
.await
.context("failed to set up LEZ indexer")?;
service = indexer;
state_dir = Some(temp_dir);
}
Expand Down
15 changes: 8 additions & 7 deletions integration_tests/src/testing_framework/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,21 @@ impl AppDeployment<AppHostEnv> for LezLocalApp {
let bedrock = ctx.deploy_and_expose(bedrock_app).await?;
wait_for_bedrock_ready(&bedrock).await?;

let indexer = IndexerApp::new(bedrock.primary_api_addr());
let indexer = scenario_base_dir.as_ref().map_or_else(
|| indexer.clone(),
|dir| indexer.clone().with_state_dir(dir.join("lez/indexer")),
);
let indexer = ctx.deploy_and_expose(indexer).await?;

let sequencer = SequencerApp::new(self.sequencer, bedrock.primary_api_addr());
let sequencer = scenario_base_dir.as_ref().map_or_else(
|| sequencer.clone(),
|dir| sequencer.clone().with_state_dir(dir.join("lez/sequencer")),
);
let sequencer = ctx.deploy_and_expose(sequencer).await?;

let indexer =
IndexerApp::new(bedrock.primary_api_addr()).with_proof_source(sequencer.addr());
let indexer = scenario_base_dir.as_ref().map_or_else(
|| indexer.clone(),
|dir| indexer.clone().with_state_dir(dir.join("lez/indexer")),
);
let indexer = ctx.deploy_and_expose(indexer).await?;

let wallet = WalletApp::from_sequencer(&sequencer);
let wallet = if self.initialize_private_accounts {
wallet
Expand Down
1 change: 1 addition & 0 deletions integration_tests/tests/cross_zone_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ async fn lock_on_zone_a_mints_wrapped_token_on_zone_b() -> Result<()> {
}],
min_committee_size: 0,
genesis_hash: None,
skip_window: partial.channel_params.skip_window,
emitters: vec![],
}],
lock_target_zones: Vec::new(),
Expand Down
1 change: 1 addition & 0 deletions integration_tests/tests/cross_zone_ping/any_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ async fn a_registered_program_sends_and_receives_across_zones() -> Result<()> {
}],
min_committee_size: 0,
genesis_hash: None,
skip_window: partial.channel_params.skip_window,
emitters: vec![cross_zone::RegisteredEmitter {
account_id: chat_a,
until_src_block: None,
Expand Down
1 change: 1 addition & 0 deletions integration_tests/tests/cross_zone_ping/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ async fn ping_crosses_from_zone_a_to_zone_b() -> Result<()> {
}],
min_committee_size: 0,
genesis_hash: None,
skip_window: partial.channel_params.skip_window,
emitters: vec![],
}],
lock_target_zones: Vec::new(),
Expand Down
13 changes: 9 additions & 4 deletions integration_tests/tests/cross_zone_ping/three_zones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const C_TO_A_PAYLOAD: &[u8] = b"undeliverable";
const B_TO_A_PAYLOAD: &[u8] = b"hello-from-b";

/// A peer entry watching `channel` with the plain ping route.
fn ping_route_peer(channel: [u8; 32]) -> CrossZonePeer {
fn ping_route_peer(channel: [u8; 32], skip_window: u32) -> CrossZonePeer {
CrossZonePeer {
channel_id: channel,
allowed_routes: vec![CrossZoneRoute {
Expand All @@ -50,6 +50,7 @@ fn ping_route_peer(channel: [u8; 32]) -> CrossZonePeer {
}],
min_committee_size: 0,
genesis_hash: None,
skip_window,
emitters: vec![],
}
}
Expand Down Expand Up @@ -212,22 +213,26 @@ async fn a_message_does_not_transit_through_an_intermediate_zone() -> Result<()>
let zone_a: [u8; 32] = *channel_a.as_ref();
let zone_b: [u8; 32] = *channel_b.as_ref();
let zone_c: [u8; 32] = *channel_c.as_ref();
let skip_window = partial.channel_params.skip_window;

let ctx = MultiZoneTestContextBuilder::default()
.with_zone(zone(
channel_a,
partial,
watching(vec![ping_route_peer(zone_b)]),
watching(vec![ping_route_peer(zone_b, skip_window)]),
))
.with_zone(zone(
channel_b,
partial,
watching(vec![ping_route_peer(zone_a), ping_route_peer(zone_c)]),
watching(vec![
ping_route_peer(zone_a, skip_window),
ping_route_peer(zone_c, skip_window),
]),
))
.with_zone(zone(
channel_c,
partial,
watching(vec![ping_route_peer(zone_b)]),
watching(vec![ping_route_peer(zone_b, skip_window)]),
))
.build()
.await?;
Expand Down
1 change: 1 addition & 0 deletions integration_tests/tests/cross_zone_verified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async fn indexer_verifies_and_delivers_cross_zone_ping() -> Result<()> {
}],
min_committee_size: 0,
genesis_hash: None,
skip_window: partial.channel_params.skip_window,
emitters: vec![],
}],
lock_target_zones: Vec::new(),
Expand Down
1 change: 1 addition & 0 deletions integration_tests/tests/cross_zone_watcher_restart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ async fn restarted_watcher_resumes_instead_of_replaying_the_peer_channel() -> Re
}],
min_committee_size: 0,
genesis_hash: None,
skip_window: partial.channel_params.skip_window,
emitters: vec![],
}],
lock_target_zones: Vec::new(),
Expand Down
Loading
Loading