feat: Rollup contracts moves msgs between L1 and L2#609
Merged
Conversation
rahul-kothari
approved these changes
May 17, 2023
Maddiaa0
reviewed
May 17, 2023
| const slot = keccak256(Buffer.concat([l1ToL2Messages[i].toBuffer(), fr(0).toBuffer()])); | ||
| const value = 1n | ((2n ** 32n - 1n) << 128n); | ||
| // we are using Fr for the value as an easy way to get a correctly sized buffer and string. | ||
| const params = `["${inboxAddress}", "${slot}", "0x${new Fr(value).toBuffer().toString('hex')}"]`; |
Member
There was a problem hiding this comment.
I'd probably refactor this such that there is a method
const overwriteSlot = (address: EthAddress, slot: number, value: Buffer) => {
// throw anvil stuff in here
}
^ this can be hidden away somewhere.
Then have forceInsertionIndex be nice n tidy in this file.
Contributor
Author
There was a problem hiding this comment.
I created #613 as I think it is a tad too cheeky to jump in and overwrite storage slots manually for integration tests.
Maddiaa0
approved these changes
May 17, 2023
| rollupStateHash = newStateHash; | ||
|
|
||
| // @todo (issue #605) handle fee collector | ||
| IInbox inbox = REGISTRY.getInbox(); |
Member
There was a problem hiding this comment.
would it be more gas efficient to just make one external call getting all addresses then destructure?
Contributor
Author
There was a problem hiding this comment.
If getting all the addresses we will be reading an extra storage slot for the rollup address as well, e.g., 1 contract access + 3 storage reads. Here we have 1 cold contract access and 1 hot + 2 storage reads.
6 tasks
ludamad
pushed a commit
that referenced
this pull request
Jul 14, 2023
This was referenced Jul 25, 2023
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.
Description
Fixes #523.
Checklist: