-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interop: Interop Fault Proof specs draft #31
base: main
Are you sure you want to change the base?
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.
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 )
|
||
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.
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 | ||
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
3db0418
to
ee85a0c
Compare
d8a4385
to
7882818
Compare
7882818
to
98ef7a2
Compare
Work in progress.