-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix(mevboost, relay): ordering logic for multiproofs #166
Conversation
@@ -50,17 +61,14 @@ func verifyInclusionProof(log *logrus.Entry, transactionsRoot phase0.Root, proof | |||
} | |||
|
|||
leaves[i] = txHashTreeRoot[:] | |||
indexes[i] = int(proof.GeneralizedIndexes[i]) |
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.
Should we be careful with converting from uin64 to int64 here?
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 safe because max i64 is 9,223,372,036,854,775,807 and all generalized indexes for transactions are capped at 2^22 -1 = 4,194,303 by consensus specs
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.
For the multiproof verification it is required that indexes
is a []int
. Given that generalized indexes will reasonably be small numbers (in the order of
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.
LGTM, let's test this and then merge
After some internal discussion we figured out that our MEV-Boost and relay fork don't need to sort the unindexed constraints like builder does, see #162 for context, but it is sufficient that the
InclusionProof
struct satisfies the following property:An example is the following: if on a block$B$ I have two preconfirmed transactions $T_1$ and $T_2$ at index $i_1$ , $i_2$ respectively and $g_1$ , $g_2$ are their generalized indexes, then the proof data must be:
or, equivalently