Skip to content

interop: Interop Fault Proof specs draft#31

Closed
protolambda wants to merge 1 commit intomainfrom
feat/interop-fp
Closed

interop: Interop Fault Proof specs draft#31
protolambda wants to merge 1 commit intomainfrom
feat/interop-fp

Conversation

@protolambda
Copy link
Copy Markdown
Contributor

Work in progress.

```python
MAX_SUPERCHAIN_SIZE = 2**20 # the binary merkle-tree is 20 levels deep (excluding the SSZ length-mixin)

class SuperSnapshot(Container:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like its missing closing )

@tynes tynes mentioned this pull request Feb 8, 2024

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.
Copy link
Copy Markdown
Contributor

@tynes tynes Feb 8, 2024

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

@tynes tynes Feb 8, 2024

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is basically saying, the more steps of bisection, go back less in time?

## Security Considerations

TODO
TODO expand fault-proof security.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you elaborate on this todo?

@protolambda protolambda changed the title interop-specs: Interop Fault Proof specs draft interop: Interop Fault Proof specs draft Feb 9, 2024
@tynes tynes force-pushed the feat/interop branch 2 times, most recently from 3db0418 to ee85a0c Compare February 11, 2024 20:37
@protolambda protolambda changed the base branch from feat/interop to main February 16, 2024 23:23
@ajsutton
Copy link
Copy Markdown
Contributor

Closing this. The design has changed a fair bit since this was written. Starting to spec out the actual design in #620

@ajsutton ajsutton closed this Mar 13, 2025
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.

Interop Specs: Fault Proof

3 participants