Skip to content
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

fix: allow safe apps to disable off-chain signing #2441

Merged
merged 3 commits into from
Sep 25, 2023
Merged

Conversation

schmanu
Copy link
Member

@schmanu schmanu commented Aug 25, 2023

What it solves

Resolves #2440

How this PR fixes it

Considers the safe signing settings when signing a message from safe apps.

How to test it

  1. Use the eip1271 test dapp
  2. disable off-chain signing
  3. sign a message
  4. Observe on-chain signature modal

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@schmanu schmanu requested a review from iamacook August 25, 2023 10:07
@github-actions
Copy link

github-actions bot commented Aug 25, 2023

Branch preview

✅ Deploy successful!

https://fix_safe_setsettings--walletweb.review-wallet-web.5afe.dev

@github-actions
Copy link

github-actions bot commented Aug 25, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@katspaugh
Copy link
Member

katspaugh commented Aug 25, 2023

@schmanu can you give an example of how a Safe App can toggle this? Or is it the user who should toggle it?

@schmanu
Copy link
Member Author

schmanu commented Aug 25, 2023

@schmanu can you give an example for how a Safe App can toggle this? Or is it the user who should toggle it?

@katspaugh It can be toggled by a custom RPC call safe_setSettings.

@katspaugh katspaugh changed the title fix: allow safe apps to overwrite the off-chain signing setting fix: allow safe apps to disable off-chain signing Aug 25, 2023
@francovenica
Copy link
Contributor

So the onchain/offchain works, in the sense that if you choose how the message must be signed in the eip app that's what you get in the web app

I still got a bunch of other issues that I'm not sure are related to the ticket, so I'd like to debug them in a call if possible.

The messages are not showing in the message tab after signing
Trying to sign with a 2nd owner in a safe 2/x is throwing errors
image

@schmanu
Copy link
Member Author

schmanu commented Sep 4, 2023

@francovenica
I can reproduce those issues on staging CGW.
When I use the prod CGW this does not happen.
In staging I also do not see the proposed message in the messages tab at all.

@francovenica
Copy link
Contributor

Yes. I tried the same and it seems something is wrong with the stg CGW. I posted a message for the infra team to see if something has changed in the past week.

Taking that aside the ticket is fine
The message is being proposed as offchain/onchain depending on the "Enable/Disable off chain signing" in the app itself
image

Made sure that the checkbox in Settings > Safe apps, that forces the message to be on chain no matter what still works as intended

Looks good to me.
I'll re check this ticket after having a response from Infra team

@katspaugh
Copy link
Member

@francovenica can we merge this, or do you want to check it again?

@francovenica
Copy link
Contributor

Give it a 2nd try now that the issue with the CGW was solved

Looks good, I can enable now the on-chian type of message signing in the app and it works fine. Off chain message signing still works fine and the settings in the app that forces on-chain type of singature also works fine as well.

@katspaugh katspaugh merged commit ca0894f into dev Sep 25, 2023
9 checks passed
@katspaugh katspaugh deleted the fix-safe-setSettings branch September 25, 2023 11:56
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable dapps to disable off-chain signing through safe_setSettings
4 participants