-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: main
Are you sure you want to change the base?
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
/// @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
up skip
update typo
unused
No need to namespace LibSignal.deriveSlot from within LibSignal.sol Also, this is consistent with the other instance in this file
…up into signal-service
This PR aims at adding additional signalling functionality.