Conversation
andrevmatos
reviewed
Mar 24, 2026
Comment on lines
+8
to
+26
| /// @dev Bit layout of the `bytes2` finality value (16 bits, MSB on the left): | ||
| /// | ||
| /// Bit: 15 14 13 12 11 10 | 9 8 7 6 5 4 3 2 1 0 | ||
| /// +----+----+----+----+----+---+----+----+----+----+----+----+----+----+----+----+ | ||
| /// | R | R | R | R | R | S | block depth (10 bits) | | ||
| /// +----+----+----+----+----+---+----+----+----+----+----+----+----+----+----+----+ | ||
| /// \____________________ ____/ \________________________ _____________________/ | ||
| /// \/ \/ | ||
| /// flags (6 bits) depth (10 bits) | ||
| /// max = 1023 (0x3FF) | ||
| /// | ||
| /// S (bit 10) = WAIT_FOR_SAFE_FLAG — wait for the `safe` tag instead of a block count. | ||
| /// R (bits 11-15) = Reserved for future flags (currently unassigned; accepted on the wire). | ||
| /// Reserved bits may be assigned in the future, read the docs for the latest bit definitions. | ||
| /// | ||
| /// Special values: | ||
| /// 0x0000 WAIT_FOR_FINALITY_FLAG — wait for full finality (safest, default). | ||
| /// 0x0400 WAIT_FOR_SAFE_FLAG — wait for the `safe` head (bit 10 set, no depth). | ||
| /// 0x0001..0x03FF — wait for N confirmation blocks (depth only, no flags). |
There was a problem hiding this comment.
10 bits is only up to 1024 blocks depth, which is less than certain rollups finalization;
From the way I see it, block depth is exclusive with any other flag.
So why not have a bit to specify this exclusively? e.g.
- If highest bit (15) is unset, then bits 0..14 are interpreted as block depth (so, 15 bits for block depth, ~32k max)
- We can even keep the 0 value special as
finalizedtag - Easy to calculate, as it's just a modulo
- We can even keep the 0 value special as
- If highest bit is set, then this allows enabling any of the 15 other bits as flags.
Collaborator
Author
There was a problem hiding this comment.
For sending you want exactly one signal, but for the pools, CCVs, executor and receiver you likely want to signal broader support. Our executor will for sure support multiple of these values, including a block depth AND the safe tag.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.