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.
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
Add account specifications #57
Add account specifications #57
Changes from 1 commit
e186ad2
b1c35fe
f5eca39
2e6ebf1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is adding
msg.sender
completely covered by the referencefallback
implementation?The reason I ask is that I would propose not having this requirement:
Account
implementation is expected to internally make configuration calls like adding a plugin, then I would change theManager.addPlugin
implementation to take an explicit caller parameter instead of having this "rule"Account
calls configuration function through its fallback handler, then this is already specified through the referencefallback
implementation right?Sorry for being nit-picky but this paragraph "felt a bit off" to me and it's the spec 😅 which needs to be 👌.
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 the account implements the specification required for the function handlers, it is covered. But it is a requirement for all state-changing methods.
It is coming as an after-effect of having function handlers. So we have the Manager set as a fallback handler, right? That means an arbitrary sender can call into the account and execute an arbitrary
CALL
to the Manager. Because of this, we had to add this requirement for the Manager to authenticate the caller.I'm also not highly fond of this requirement, but I do not see a possible workaround. I'm happy to iterate on the specs to make it more clear.
Then the sender can specify an arbitrary caller, can't they?
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.
I don't think this is a form of authentication in the Manager side though - a malicious account implementation or caller can just as easily add a different address at the end of the Manager call.
My point was more about questioning "why is this requirement needed". If the configuration change methods are always called via the
fallback
mechanism, then this is a non-issue correct (as in, this requirement doesn't need to be mentioned as it is captured by thefallback
mechanism specification)?Is my understanding correct that if the
Account
has code where it internally makes configuration changes, then it needs to either:IManager(this).configurationMethod()
(to ensure that it goes over the fallback mechanism, at the cost of an additionalCALL
, which I think should be fine in the name of simplicity)msg.sender
at the end of the call data, in which case it likely makes sense to expose methods for configuration in the form of a library:And in this context, this requirement is meant to capture the requirement for the second option right?
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.
@rmeissner - do you have context on the choice of using
uint8
instead of anenum
for the operation?I think that they are equivalent from an ABI standpoint, but an
enum
might be more self-documenting.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.
I wouldn't capitalise "native token" here.
Also, something that is not obvious (and related to EVM semantics) is that this value can't be specified when doing a
DELEGATECALL
(since you don't send values withDELEGATECALL
and it inherits the current transaction value).Actually, thinking about it, how do you do a
DELEGATECALL
with a value under 4337? I assume it that you would have to make theSafe
call itself with a value to do the actualDELEGATECALL
you want?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.
I specified that the value would be ignored if the operation is delegatecall.
🤯 Something like this, yeah 😂
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.
Is this always available? I'm asking because I feel like I've seen calls to this function with
messageData = ""
and can imagine scenarios where this isn't available (for example, when verifying EIP-1271 signatures for example with the default verifier).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.
So the
messageData
variable has a legacy background because the older EIP-1271 spec usedbytes
instead ofbytes32
and the data hash. If it's not always available, I'd explicitly state that the account must not expect this argument but keep the signature consistentThere 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.
Looking through the
checkSignatures
code, it looks like older versions of the Safe used this for the old EIP-1271 spec for contract signatures. Seeing as, since Safe v1.5.0 this is no longer the case (it uses the the new EIP-1271 signature verification for all contract signatures), could we just removedata
from the interface?If the old
checkSignatures
function is kept around for backwards compatibility on the Safe, that is fine, but I don't think it should be needed for theIAccount
interface. Essentially, you can add the following methods to the Safe so keep a backwards compatible interface, without adding thedata
"tech debt" to the newIAccount
interface:This can even be implemented as a plugin to not take precious code space from the
Safe
contract.