-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
YAS 227 L2-to-L1 Message Receiver #44
YAS 227 L2-to-L1 Message Receiver #44
Conversation
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.
Left a few comments, but looks good!
Question:
Is there ever a time when the sequencer (or some other authorized party) would be able to remove messages from the queue? May be nice to reduce state and get a gas rebate.
uint nonce | ||
); | ||
|
||
struct EnqueuedL2ToL1Message { |
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.
If this will be passed between multiple contracts, should we put it in DataTypes.sol
?
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.
As far as I can tell, it is only gonna show up here, so that's where I put it.
|
||
struct EnqueuedL2ToL1Message { | ||
dt.L2ToL1Message message; | ||
uint blockEnqueued; |
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 L1 block, right?
} | ||
|
||
address public trustedSequencer; | ||
uint public messageDelay; |
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.
What unit is this in? Seconds?
blockEnqueued: blockNum | ||
}); | ||
messageNonce += 1; | ||
emit L2ToL1MessageEnqueued( |
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.
Will the event have a blocknum accessible by default? Also, will we want the nonce in this?
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.
good catch, that was supposed to be the nonce!
} | ||
|
||
function verifyL2ToL1Message(dt.L2ToL1Message memory _message, uint _nonce) public view returns (bool) { | ||
// The enqueued message at the given nonce mudt match the _message being verified |
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.
// The enqueued message at the given nonce mudt match the _message being verified | |
// The enqueued message at the given nonce must match the _message being verified |
uint blockEnqueued; | ||
} | ||
|
||
address public trustedSequencer; |
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.
How do you feel about removing the word trusted
? My rationale is that it's implied and may draw unnecessary negative attention.
This is a little tricky, since the context for this contract is that it is really there to " simulate" what an actual rollup contract would do. And in that context, the messages can't be removed--but they also don't appear on the main chain other than implicitly via a state root. So for now, I think I'm not gonna add that ability as it would be deprecated quickly anyway. |
…down-lint Add markdown linting and formatting with markdownlint
* Add concurrent sends
…name change token name to QKC
Description
Implements YAS 227, L2-to-L1 message receiver in a trusted context to build out dev ex.
Questions
Metadata
Fixes
Contributing Agreement