Skip to content

feat: TEE pipeline skeleton and fact registration split#48

Open
chudkowsky wants to merge 7 commits intomainfrom
feat/tee-business-logic
Open

feat: TEE pipeline skeleton and fact registration split#48
chudkowsky wants to merge 7 commits intomainfrom
feat/tee-business-logic

Conversation

@chudkowsky
Copy link
Collaborator

Summary

  • TEE pipeline skeleton: introduces saya/core/src/tee/ (TeeAttestation, TeeTrace, TeeAttestor, OffchainTeeVerifier), saya/core/src/prover/tee/ (TeeProver, TeeProof), and saya/core/src/orchestrator/tee.rs (TeeOrchestrator) — a full stub pipeline wiring BlockIngestor → BlockOrderer → TeeAttestor → OffchainTeeVerifier → TeeProver → Settlement.
  • Fact registration split: extracts proof verification logic from PiltoverSettlementBackend into a new FactRegistrar trait (settlement/fact_registration/). The trait returns Option<Call> so each strategy controls its own Piltover entry point. Three implementations: IntegrityFactRegistrar (STARK on-chain verifier), NoopFactRegistrar (dev/test), TeeFactRegistrar (skeleton, returns Ok(None) until verifier contract is deployed).
  • PiltoverSettlementBackend is now generic over FR: FactRegistrar, collapsing ~280 lines of mixed verification+submission logic to ~60 lines.
  • AnyFactRegistrar enum added to bin/saya for runtime dispatch between registrar implementations.
  • Starknet crate version mismatch resolved by re-exporting Call as SettlementCall from saya-core so bin/saya (which overrides to a git fork) uses the same type through the core crate.

Test plan

  • cargo build --workspace passes with no errors
  • cargo test --workspace --all-features --exclude saya-e2e — all 19 unit tests pass
  • persistent-tee start still compiles and wires correctly with TeeFactRegistrar
  • persistent start with --mock-layout-bridge-program-hash uses NoopFactRegistrar
  • persistent start with --settlement-integrity-address uses IntegrityFactRegistrar
  • E2E tests (saya-e2e) require a running settlement chain and are unaffected by this change

🤖 Generated with Claude Code

chudkowsky and others added 7 commits February 24, 2026 14:12
…lement

Introduce skeleton components for the full TEE proving pipeline
(TeeAttestor → OffchainTeeVerifier → TeeProver → TeeOrchestrator) and
decouple proof verification from state submission in the settlement layer.

- Add `saya/core/src/tee/` with TeeAttestation and TeeTrace pipeline types
- Add `saya/core/src/tee/attestor.rs` (TeeAttestor) and `verifier.rs`
  (OffchainTeeVerifier) as PipelineStage skeletons
- Add `saya/core/src/prover/tee/` with TeeProver and TeeProof
- Add `saya/core/src/orchestrator/tee.rs` wiring the full TEE pipeline
- Introduce `FactRegistrar` trait in `settlement/fact_registration/`:
  returns `Option<Call>` so each strategy controls its own entry point
- Implement IntegrityFactRegistrar, NoopFactRegistrar (moved from piltover),
  and TeeFactRegistrar (skeleton, returns Ok(None) until verifier deployed)
- Refactor PiltoverSettlementBackend to be generic over `FR: FactRegistrar`,
  collapsing ~280-line run loop to ~60 lines
- Add AnyFactRegistrar enum to bin/saya for runtime dispatch
- Re-export `Call as SettlementCall` from saya-core to resolve starknet
  crate version mismatch between saya-core (0.17.0) and bin/saya (git fork)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire TeeOrchestratorBuilder (attestor → offchain verifier → prover →
settlement) into the CLI as the `tee` subcommand. Remove the old
`persistent-tee` command (which used the simpler PersistentTeeOrchestrator)
and the unimplemented `sharding` stub.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… logic

- Remove Sovereign, Persistent, and PersistentTee orchestrators; only TEE
  mode remains in the binary
- Remove Atlantic SNOS/layout-bridge provers, mock prover, PIE generator,
  data availability layer (Celestia), and fact registration — all STARK
  proving infrastructure is gone
- Remove OffchainTeeVerifier stage; attestation now flows directly into the
  SP1 prover
- PollingBlockIngestor rewritten to emit ordered Vec<BlockInfo> batches
  (configurable batch_size + idle_timeout) instead of individual blocks;
  BlockOrderer between ingestor and attestor is no longer needed
- TeeAttestation extended with quote, state roots, block hashes, and block
  numbers carried from Katana through the full pipeline
- Add bin/saya: attestor.rs (moved+reworked from saya-core), prover.rs,
  prover_impl.rs (SP1 Groth16 generation), settlement.rs
  (TeePiltoverSettlementBackend building PiltoverInput::TeeInput calldata)
- TeeSettlementBackendBuilder trait replaces SettlementBackendBuilder and
  accepts Receiver<TeeProof> directly — no DA cursor adapter needed
- TeeOrchestratorBuilder simplified from 5 stages to 3 (ingestor, attestor,
  prover, settlement)
- Prover credentials and provider URL moved from hardcoded consts to CLI
  args read from env (--prover-rpc, --tee-registry-address,
  --prover-private-key)
- Pin boundless-market to v1.1.0; pin alloy crates to v1.0.41
- Update rust-toolchain and recompile core_contract.json artifact

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove underscore prefix from poll_interval fields since they are used.
Fix prev_block_number calculation to only subtract 1 when not block 0,
avoiding off-by-one when the batch starts at block 1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant