Conversation
| ```python | ||
| MAX_SUPERCHAIN_SIZE = 2**20 # the binary merkle-tree is 20 levels deep (excluding the SSZ length-mixin) | ||
|
|
||
| class SuperSnapshot(Container: |
There was a problem hiding this comment.
looks like its missing closing )
|
|
||
| We adapt the output-root that commits to the state of an individual L2 like in "version 0", | ||
| but now extended with a `messages_root`. | ||
| The `messages_root` commits to accumulators of the initiating messages and executing messages. |
There was a problem hiding this comment.
I like this idea of messages_root - curious if you have thought about the structure at all yet. I think a sparse merkle tree is most simple where the key is the blockhash and the leaf is a vector commitment to the executing (ssz'ified subset of tx data) + initiating messages (all logs emitted). If block hash isn't present then we can also do keccak256(blocknumber)
| This the remaining bitstring after the leading `1` bit of the generalized index. | ||
|
|
||
| TODO: diagram of the binary tree | ||
|
|
There was a problem hiding this comment.
Would be useful to define a constants table that has split depth + max l1 history
| `SPLIT_DEPTH = 64` | ||
|
|
||
| - `path[0]`: [L1 Execution](#l1-execution-extra) [Experimental] | ||
| - `path[0] == 0`: L1 block-number bisection |
There was a problem hiding this comment.
Is this what you mean by the padding function?
def compute_offset(value):
# Ensure the input is within the range of a byte
if value < 0 or value > 255:
raise ValueError("Input must be a byte (0-255).")
# Convert the byte value to its binary representation, remove the '0b' prefix
binary_str = bin(value)[2:]
# Pad the binary string on the left to make it 8 bits long
binary_str = binary_str.rjust(8, '0')
# Pad the binary string on the right with 1s to make it 31 bits long
padded_binary_str = binary_str.ljust(31, '1')
return padded_binary_str|
|
||
| - `path[0]`: [L1 Execution](#l1-execution-extra) [Experimental] | ||
| - `path[0] == 0`: L1 block-number bisection | ||
| - For bits in `path` in range `[1...32)`: right-pad the bits to 31 bits with `1`s as padding. |
There was a problem hiding this comment.
This is basically saying, the more steps of bisection, go back less in time?
| ## Security Considerations | ||
|
|
||
| TODO | ||
| TODO expand fault-proof security. |
There was a problem hiding this comment.
Assumption that all chains have the same blocktime at 2 seconds
| `SPLIT_DEPTH = 64` | ||
|
|
||
| - `path[0]`: [L1 Execution](#l1-execution-extra) [Experimental] | ||
| - `path[0] == 0`: L1 block-number bisection |
There was a problem hiding this comment.
I think it would be helpful with typing if we used path[0] == 0b0, ie the 0b prefix where it makes sense, it helps me keep in context what things are
| Each L1 block, relative by `max_l1_history - offset` blocks to the `l1_head` that the game started at, | ||
| is transformed into a commitment of accumulated useful and safe L1 information. | ||
| Where `max_l1_history = 24 * 60 * 60 / 12` (last 24 hours of L1 data). | ||
| TODO: depends on sequencing window and other backward L1 traversal. |
There was a problem hiding this comment.
Can you elaborate on this todo?
3db0418 to
ee85a0c
Compare
d8a4385 to
7882818
Compare
7882818 to
98ef7a2
Compare
|
Closing this. The design has changed a fair bit since this was written. Starting to spec out the actual design in #620 |
Work in progress.