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

Fixed UserOp Identifier #75

Merged
merged 4 commits into from
Oct 11, 2024
Merged

Fixed UserOp Identifier #75

merged 4 commits into from
Oct 11, 2024

Conversation

bh2smith
Copy link
Collaborator

@bh2smith bh2smith commented Oct 11, 2024

The Safe Salt Nonce is one way to identify Bitte Protocol Safes, but requires querying traces:

The Query Execution by SafeSaltNonce is computationally expensive and slow:

https://dune.com/queries/4150748 (9 minutes on large cluster)

However, appending an Identifier to the call data bytes reduces the complexity substantially:

https://dune.com/queries/4151053 (1 minute on large cluster)

This PR Proposes using both.

Observe that the SafeSaltNonce is left configurable to end users but the UserOpIdentifier will be permanently baked into the call data of every outgoing transaction from this library.

Copy link
Member

Choose a reason for hiding this comment

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

Why are some test files called .spec.ts and others .test.ts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ahh whoops. They are both common. I just forgot to only use one.

Copy link
Member

@tifrel tifrel left a comment

Choose a reason for hiding this comment

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

I see a few console.logs in here, but I am not the biggest fan of those in library functions. I know near-api-js does it and it drives me nuts. We might want to consider guarding them behind an environment variable, e.g. if NEAR_SAFE_LOGS=1 or so. Out of scope for this PR though.

@bh2smith
Copy link
Collaborator Author

Ya, it would be good to introduce a proper logger so those logs can be disabled.

@bh2smith bh2smith merged commit 7cad4c4 into main Oct 11, 2024
1 check passed
@bh2smith bh2smith deleted the callDataIdentifier branch October 11, 2024 11:14
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.

2 participants