refactor: add stack comments to claim_batch_pipe_double_words#2620
Open
partylikeits1983 wants to merge 1 commit intoagglayerfrom
Open
refactor: add stack comments to claim_batch_pipe_double_words#2620partylikeits1983 wants to merge 1 commit intoagglayerfrom
claim_batch_pipe_double_words#2620partylikeits1983 wants to merge 1 commit intoagglayerfrom
Conversation
claim_batch_pipe_double_words
mmagician
requested changes
Mar 17, 2026
Collaborator
mmagician
left a comment
There was a problem hiding this comment.
We should not remove the current invocation of claim_batch_pipe_double_words, but leaf data is piped to memory twice now:
claim->claim_batch_pipe_double_words(piped viapipe_double_words_preimage_to_memory)claim->verify_leaf_bridge->get_leaf_value-> (piped viapipe_preimage_to_memory)
Since both happen within the AggLayerBridge account context, the latter is not necessary
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.
This PR adds stack comments to
claim_batch_pipe_double_words, and was an opportunity to research if the call tomem::pipe_double_words_preimage_to_memoryforPROOF_DATA_KEYis necessary in theclaim_batch_pipe_double_wordsprocedure.The purpose of this PR is to close #2237 specifically point 5:
@bobbinth left a comment here regarding the old state of the
claim_batch_pipe_double_wordsprocedure. In the comment, it is pointed out that it is not necessary to callexec.mem::pipe_double_words_preimage_to_memoryfor thePROOF_DATA_KEY, which is technically true.This is the current state of the
claim_batch_pipe_double_wordsprocedure:It is possible to remove the call to
mem::pipe_double_words_preimage_to_memoryfor thePROOF_DATA_KEY, however, I think we should keep this call.Why? Because the bridge should not have to trust that the
CLAIMnote (or the note calling theclaimprocedure), correctly insertedPROOF_DATAunderPROOF_DATA_KEYin theAdviceMap. This call tomem::pipe_double_words_preimage_to_memoryis in effect a sanity check. If we removed it, it's unlikely to open a possible vulnerability, however, I think we should keep it, unless there is a strong reason to remove it. Removing it would save around ~257 cycles.Essentially this call to
mem::pipe_double_words_preimage_to_memorymakes it so that thebridge_incomponent does not have to trust that the note which called theclaimprocedure correctly insertedPROOF_DATAunderPROOF_DATA_KEYin theAdviceMap.Closes #2237