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

Add encryptCallData() to gasless chapter and example #477

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

matevz
Copy link
Member

@matevz matevz commented Dec 23, 2024

This PR:

  • documents encryptCallData() in gasless.md to generate encrypted gasless transaction
  • adds encryptCallData() to examples/onchain-signer and tests it
  • removes some unneeded sleeps from the onchain-signer tests since the recent sapphire-localnet healthcheck correctly waits that the EVM is spun up before running them

PREVIEW

Fixes #463.

Copy link

netlify bot commented Dec 23, 2024

Deploy Preview for oasisprotocol-sapphire-paratime ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-sapphire-paratime/deploys/676a8b3f6c5eeb984d80cea6
😎 Deploy Preview https://deploy-preview-477--oasisprotocol-sapphire-paratime.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@matevz matevz requested a review from rube-de December 23, 2024 14:54
@matevz matevz force-pushed the matevz/docs/encryptcalldata branch 2 times, most recently from f5ff7d0 to d0d56b2 Compare December 23, 2024 21:23
@matevz matevz force-pushed the matevz/docs/encryptcalldata branch 2 times, most recently from 9b80896 to 7273f83 Compare December 24, 2024 09:53
@matevz matevz force-pushed the matevz/docs/encryptcalldata branch from 7273f83 to 7cfbc50 Compare December 24, 2024 09:55
solidity: {
version: '0.8.20',
settings: {
// XXX: Needs to match https://github.com/oasisprotocol/sapphire-paratime/blob/main/contracts/hardhat.config.ts
Copy link
Member

@ptrus ptrus Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on some of my quick testing I believe it is not about matching, but actually things fail without this optimization enabled.

For example, removing this optimization in contracts/hardhat.config.ts makes the tests in contracts/ fail as well.

Do we know why this happens? Should someone investigate this further?

const tx = await commentBox.comment('Hello, world!');
await tx.wait();
// TODO: https://github.com/oasisprotocol/sapphire-paratime/issues/179
const response = await provider.broadcastTransaction(tx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calldata encryption could be checked here (requires sapphire-paratime import)

Suggested change
const response = await provider.broadcastTransaction(tx);
const response = await provider.broadcastTransaction(tx);
expect(isCalldataEnveloped(response.data)).eq(!plain);

also is the TODO still open?
I used await wrapEthereumProvider(provider).broadcastTransaction(tx) and didn't got an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: Use new encryptCallData in EIP155 gasless chapter
3 participants