Conversation
This covers the components currently implemented in alpen-ee.
|
Commit: 2049cd1 SP1 Execution Results
|
storopoli
left a comment
There was a problem hiding this comment.
Amazing piece of documentation.
Thank you!
I have some suggestions.
Also one question: should we mention ASM or just treat "L1" as a blackbox like we already do?
|
|
||
| ## System Context | ||
|
|
||
| The EE exists within a layered architecture anchored to Bitcoin: |
There was a problem hiding this comment.
Multiple EEs
| The EE exists within a layered architecture anchored to Bitcoin: | |
| EEs exist within a layered architecture anchored to Bitcoin: |
| ┌──────────┐ ┌──────────┐ ┌──────────┐ | ||
| │ EE 1 │ │ EE 2 │ │ EE N │ | ||
| │ (This) │ │ │ │ │ | ||
| └──────────┘ └──────────┘ └──────────┘ |
There was a problem hiding this comment.
| ┌──────────┐ ┌──────────┐ ┌──────────┐ | |
| │ EE 1 │ │ EE 2 │ │ EE N │ | |
| │ (This) │ │ │ │ │ | |
| └──────────┘ └──────────┘ └──────────┘ | |
| ┌──────────┐ ┌──────────┐ ┌──────────┐ | |
| │ EE 1 │ │ EE 2 │ │ EE N │ | |
| │ (Alpen) │ │ │ │ │ | |
| └──────────┘ └──────────┘ └──────────┘ |
Better than "this".
| | **OL** | OL blocks grouped into epochs | OL client (not covered here) | | ||
| | **EE** | EVM blocks | `alpen-client` (this binary) | |
There was a problem hiding this comment.
You could point to strata.
| | **OL** | OL blocks grouped into epochs | OL client (not covered here) | | |
| | **EE** | EVM blocks | `alpen-client` (this binary) | | |
| | **OL** | OL blocks grouped into epochs | `bin/strata` | | |
| | **EE** | EVM blocks | `bin/alpen-client` | |
|
|
||
| ### Communication Pattern: Watch Channels | ||
|
|
||
| Components communicate via `tokio::sync::watch` channels for efficient state broadcasting: |
There was a problem hiding this comment.
This could get outdated.
| Components communicate via `tokio::sync::watch` channels for efficient state broadcasting: | |
| Components communicate via `tokio` channels for efficient state broadcasting: |
| └── finalized: EeAccountStateAtEpoch // State at finalized epoch | ||
| ``` | ||
|
|
||
| **Outputs** (via watch channels): |
There was a problem hiding this comment.
| **Outputs** (via watch channels): | |
| **Outputs** (via `tokio` channels): |
| **Responsibilities**: | ||
| - Broadcast new block headers from sequencer | ||
| - Receive and validate block headers from peers | ||
| - Verify sequencer signatures (Schnorr over EIP-191 hash) |
There was a problem hiding this comment.
Oh god we created a monstrosity 😂 Schnorr over EIP-191 hash.
Are we the only ones using that?
I do have to agree that is BEAUTIFUL.
PKs are always 32 bytes and sigs are always 64 bytes.
EIP-191 hashes gives us ample support from most of the Rust ethereum ecosystem...
There was a problem hiding this comment.
Cc @AaronFeickert and/or @sampkaALP for sanity checking.
| **Key Points**: | ||
| - Only messages from finalized OL blocks are processed (to avoid reorg issues) | ||
| - Deposits are rate-limited per block (`max_deposits_per_block`) | ||
| - Subject ID (32 bytes) is truncated to EVM address (20 bytes) |
There was a problem hiding this comment.
Truncated how? We add zero padding? If yes, to the left or to the right?
There was a problem hiding this comment.
add? something needs to be removed.
| - Only messages from finalized OL blocks are processed (to avoid reorg issues) | ||
| - Deposits are rate-limited per block (`max_deposits_per_block`) | ||
| - Subject ID (32 bytes) is truncated to EVM address (20 bytes) | ||
| - Bitcoin amounts (sats) are converted to wei |
There was a problem hiding this comment.
Point towards the sats_to_wei function in ee-common?
| │ │ │ │ | ||
| ``` | ||
|
|
||
| **Status**: Withdrawal extraction is implemented. Batch submission to OL with SNARK proofs is not yet implemented. |
There was a problem hiding this comment.
I think we should remove the status, since we are working on batch assembly already.
| **Status**: Withdrawal extraction is implemented. Batch submission to OL with SNARK proofs is not yet implemented. |
| - **Batch Assembly**: Grouping multiple EE blocks into batches for OL submission | ||
| - **SNARK Proof Generation**: Proving EE state transitions | ||
| - **OL Update Submission**: Posting proofs and state updates to OL | ||
| - **Cross-EE Messaging**: Messages between different EEs via OL | ||
| - **Independent Block Sync**: EE fullnodes currently rely on sequencer P2P |
There was a problem hiding this comment.
This has the risk of getting outdated soon.
We should just removed. It does not add anything from what we already know from our tickets and sprint planning.
There was a problem hiding this comment.
at least let's add a date
bewakes
left a comment
There was a problem hiding this comment.
Very comprehensive! I like this.
Agree with @storopoli 's comments.
|
|
||
| Fullnodes learn about new blocks through two mechanisms: | ||
|
|
||
| 1. **Consensus (Confirmed/Finalized)**: From OL via OL Tracker |
There was a problem hiding this comment.
let's add that in this case they actually learn about a sequence of blocks
|
|
||
| **Important**: EE fullnodes do not have independent block sync. They rely on: | ||
| - Reth's P2P for block data (triggered by gossip) | ||
| - OL for consensus (confirmed/finalized status) |
There was a problem hiding this comment.
this is not quite block sync, right? (not only that technically this does not sync blocks, but) we are not syncing data from OL, it is needed to be fetched from bitcoin. This is not implemented right now, correct?
| ├─────────────►│ │ │ | ||
| │ │ │ │ | ||
| │ finalized │ │ │ | ||
| │◄─────────────┤ │ │ |
There was a problem hiding this comment.
do we have a better way to pass the message that this should be a finalized block? The way I currently read it is that OL sends some finalized object to L1, but in fact it is not finalized when sent.
There was a problem hiding this comment.
It would also be good to explain what this (finalized) object is. I am not sure.
| **Key Points**: | ||
| - Only messages from finalized OL blocks are processed (to avoid reorg issues) | ||
| - Deposits are rate-limited per block (`max_deposits_per_block`) | ||
| - Subject ID (32 bytes) is truncated to EVM address (20 bytes) |
There was a problem hiding this comment.
add? something needs to be removed.
| ``` | ||
|
|
||
| **Key Points**: | ||
| - Only messages from finalized OL blocks are processed (to avoid reorg issues) |
There was a problem hiding this comment.
I fail to follow something here: what happens between DT and the inbox msg? Do we literally just wait for an OL batch that covers the L1 range where the DT is to be posted to and buried in L1? If so, I don't really see a reason for it.
| - **Batch Assembly**: Grouping multiple EE blocks into batches for OL submission | ||
| - **SNARK Proof Generation**: Proving EE state transitions | ||
| - **OL Update Submission**: Posting proofs and state updates to OL | ||
| - **Cross-EE Messaging**: Messages between different EEs via OL | ||
| - **Independent Block Sync**: EE fullnodes currently rely on sequencer P2P |
There was a problem hiding this comment.
at least let's add a date
prajwolrg
left a comment
There was a problem hiding this comment.
This is really nice. Thank you so much.
I just have added a few nits.
| ┌─────────────────────────────────────────────────────────────────────┐ | ||
| │ Bitcoin (L1) │ | ||
| │ - Source of truth for finality │ | ||
| │ - Data Availability (DA) for OL state │ |
There was a problem hiding this comment.
I don't think we need to talk about OL DA here. Maybe we should mention about EE DA instead.
| ``` | ||
| ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ | ||
| │ L1 │ │ OL │ │ EE │ │ EVM │ | ||
| │(Bitcoin)│ │ │ │ Client │ │ State │ | ||
| └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ | ||
| │ │ │ │ | ||
| │ deposit tx │ │ │ | ||
| ├─────────────►│ │ │ | ||
| │ │ │ │ | ||
| │ finalized │ │ │ | ||
| │◄─────────────┤ │ │ |
There was a problem hiding this comment.
Doesn't mermaid support this?
| **Key Points**: | ||
| - Only messages from finalized OL blocks are processed (to avoid reorg issues) | ||
| - Deposits are rate-limited per block (`max_deposits_per_block`) | ||
| - Subject ID (32 bytes) is truncated to EVM address (20 bytes) |
| ``` | ||
| ┌─────────┐ ┌─────────────┐ ┌─────────┐ ┌─────────┐ | ||
| │ EVM │ │ Payload │ │ OL │ │ L1 │ | ||
| │ State │ │ Builder │ │ │ │(Bitcoin)│ | ||
| └────┬────┘ └──────┬──────┘ └────┬────┘ └────┬────┘ | ||
| │ │ │ │ | ||
| │ withdrawal │ │ │ | ||
| │ intent │ │ │ | ||
| ├───────────────►│ │ │ | ||
| │ │ │ │ | ||
| │ │ BlockOutputs │ │ | ||
| │ │ (SentMessage) │ │ | ||
| │ ├───────────────►│ │ | ||
| │ │ │ │ | ||
| │ │ │ bridge │ | ||
| │ │ ├─────────────►│ | ||
| │ │ │ │ | ||
| ``` |
There was a problem hiding this comment.
nit: if we can use mermaid here.
|
@sapinb let's push to merge this? It's stale for a month now |
Description
This covers the components currently implemented in alpen-ee.
AI disclosure: With help from claude, especially for the diagrams.
Type of Change
Notes to Reviewers
I'm not sure exactly where this should go. Or if it even belongs in this repo. Please suggest if this needs to go elsewhere.
My plan is to update this doc as more pieces of alpen-ee get integrated.
Checklist
Related Issues