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

ref: Remove ethers in logger #366

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Conversation

joshLong145
Copy link

Description

replaces ethers.utils.hashMessage with a non secure 32 bit hash function which has a low collision chance but quick throughput. This does mean the hashing function is non secure, meaning it is possible to reverse hashes in reasonable time. However we do need a secure hashing implementation for the purposes of the logger.

Test times are observed to be the same and in some cases 100 - 200ms faster measurement was done with logger.spec.ts tests with both hashing implementations.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

logger.spec.ts was run against the new hashing function

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@CLAassistant
Copy link

CLAassistant commented Feb 18, 2024

CLA assistant check
All committers have signed the CLA.

@joshLong145 joshLong145 changed the title Remove/ethers in logger ref: Remove ethers in logger Feb 18, 2024
@joshLong145 joshLong145 changed the base branch from master to staging/3.1.5 February 18, 2024 19:19
@Ansonhkg Ansonhkg mentioned this pull request Feb 18, 2024
5 tasks
@@ -1,6 +1,4 @@
import { version } from '@lit-protocol/constants';
import { hashMessage } from 'ethers/lib/utils';
import { encode } from 'punycode';
Copy link
Contributor

Choose a reason for hiding this comment

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

With this, I think we can remove punycode from the project

@Ansonhkg Ansonhkg merged commit b51c75a into staging/3.1.5 Feb 19, 2024
4 checks passed
@Ansonhkg Ansonhkg deleted the remove/ethers-in-logger branch February 19, 2024 15:57
@Ansonhkg Ansonhkg mentioned this pull request Feb 19, 2024
5 tasks
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.

4 participants