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

Refactor callDataPublicKey handling #270

Merged
merged 14 commits into from
Feb 6, 2024

Conversation

CedarMist
Copy link
Member

@CedarMist CedarMist commented Feb 5, 2024

This should fix several long-standing issues with call encryption.

Previously the Cipher object would be created and maintained with the same keys throughout the duration of the session, it also did not support the new Epoch flag which specifies which calldata public key was being used to encrypt the request (requiring the server to try several).

This would cause problems, like when you leave a dApp open for a while your transactions would fail with 'tag verification failed'.

This introduces several changes:

  • New Cipher instance is used for every request
  • calldata public key is cached (5 minutes by default)
  • The epoch parameter is passed in the encryption envelope
  • Debug scripts/proxy.js shows epoch status too.

This means that leaving dApps open for prolonged periods of time will be OK.


Follow-up notes:

  • Gas tests in contracts/ had a small rewrite, because of the variance they were longer a sufficient test of what they were supposed to do check for! They've been made relative instead.

@CedarMist CedarMist added p:0 Priority: very high js client labels Feb 5, 2024
@CedarMist CedarMist self-assigned this Feb 6, 2024
@CedarMist CedarMist marked this pull request as ready for review February 6, 2024 07:46
@CedarMist CedarMist requested review from matevz and lubej February 6, 2024 08:25
@CedarMist CedarMist requested a review from lubej February 6, 2024 10:26
Copy link
Contributor

@lubej lubej left a comment

Choose a reason for hiding this comment

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

LGTM

@CedarMist CedarMist merged commit cfc6eeb into main Feb 6, 2024
14 checks passed
@CedarMist CedarMist deleted the CedarMist/calldatapublickey-expire branch February 6, 2024 11:03
github-actions bot added a commit that referenced this pull request Feb 6, 2024
…darMist/calldatapublickey-expire

Refactor callDataPublicKey handling cfc6eeb
github-actions bot added a commit that referenced this pull request Feb 6, 2024
…edarMist/calldatapublickey-expire

Refactor callDataPublicKey handling cfc6eeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client p:0 Priority: very high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants