-
Notifications
You must be signed in to change notification settings - Fork 7
Signalling #89
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
Signalling #89
Conversation
todo comments bytes memory
The value is what you want to signal i.e. a message. A signal is what actually ends up being stored
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.
Just did a first pass on the signaling mechanism, will continue with the CheckpointSyncer and briding. The most important feedback so far is that we are missing some parameters when verifying the signals
src/libs/LibSignal.sol
Outdated
/// @dev Signal a `value` at a namespaced slot. See `deriveSlot`. | ||
function signal(uint64 chainId, address account, bytes32 value) internal returns (bytes32) { | ||
bytes32 slot = deriveSlot(chainId, account, value); | ||
slot.getBytes32Slot().value = value; |
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.
Since we already have the storage slot, is there any gas savings from doing this directly with assembly? I'm not familiar with the implementation of getBytes32Slot
, I'll check it out - this is just not to miss the idea
assembly {
sstore(slot, value)
}
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.
Hey, the implementation is:
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
Co-authored-by: Gustavo Gonzalez <[email protected]>
Co-authored-by: Gustavo Gonzalez <[email protected]>
98f3244
to
89056bc
Compare
simplify comment updated event explain root
aa0ee38
to
d7da73f
Compare
re-do order comment
baa218e
to
96c4b94
Compare
This is now fixed
Okay i went with the "hash the underlying value" approach i think its better this way - less edge cases
Okay they are now merged |
Okay i changed this now to have a separate namespace param - one for eth deposits and one for generic signals. (Im not convinced on all the namings so open to suggestions) but at least this isnt an issue |
33c93a8
to
e7ddb8d
Compare
This should have been part of the previous commit
I just realised I updated |
Changes to gas cost
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Co-authored-by: Nikesh Nazareth <[email protected]> Co-authored-by: Gustavo Gonzalez <[email protected]>
Co-authored-by: Nikesh Nazareth <[email protected]> Co-authored-by: Gustavo Gonzalez <[email protected]>
Co-authored-by: Nikesh Nazareth <[email protected]> Co-authored-by: Gustavo Gonzalez <[email protected]>
…ontract description
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.
Did a final pass and I think this is ready to merged. We might want to exclude the fork tests(or have a separate command to run them), since they block the pipeline and make every forge test run fail.
I know we are changing the testing strategy for the SS and the bridge on #119 , so I'm fine with either approach as long as we keep main clean
This PR aims at adding additional signalling functionality.