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

Revert "Revert "fix: P-441 remove NoEligibleIdentity (#2739)" (#2777)" #2788

Closed
wants to merge 3 commits into from

Conversation

higherordertech
Copy link
Contributor

This reverts commit dbcac65.

Context

Labels

Please apply following PR-related labels when appropriate:

  • C0-breaking: if your change could break the existing client, e.g. API change, critical logic change
  • C1-noteworthy: if your change is non-breaking, but is still worth noticing for the client, e.g. reference code improvement

How (Optional)

Testing Evidences

Please attach any relevant evidences if applicable

Copy link

linear bot commented Jun 5, 2024

@higherordertech higherordertech requested review from silva-fj, jonalvarezz and BillyWooo and removed request for silva-fj June 5, 2024 03:38
Comment on lines 69 to 71
// error when trying to build vc but no eligible identity is found
#[codec(index = 11)]
NoEligibleIdentity,
Copy link
Contributor

Choose a reason for hiding this comment

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

is it safe to remove? or do we need to keep this index unused? I'm thinking of upcoming errors we want to append

Copy link
Collaborator

Choose a reason for hiding this comment

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

In fact, if we really want to retain the maximal compatibility, we could leave this enum unchanged (so does definitions.ts)

So this will just become an error type that will never be emitted.
Good thing is you don't have to change anything in SDK. @jonalvarezz @higherordertech

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm fine with either way - they both have arguments

Will leave it to you to decide

@higherordertech higherordertech force-pushed the P-441-remove-NoEligibleIdentity branch from 925740b to 2a38393 Compare June 10, 2024 03:50
@higherordertech higherordertech enabled auto-merge (squash) June 10, 2024 03:51
@higherordertech higherordertech force-pushed the P-441-remove-NoEligibleIdentity branch from 2a38393 to 3e3ea00 Compare June 10, 2024 03:57
@@ -66,7 +66,7 @@ pub enum ErrorDetail {
// of verification data
#[codec(index = 10)]
VerifyWeb3SignatureFailed,
// error when trying to build vc but no eligible identity is found
// this is deprecated as this should not be emitted anymore to not leak the information, kept here so client side type definition do not need change
#[codec(index = 11)]
NoEligibleIdentity,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This never-used error type is retained now, but with deprecated note

@higherordertech higherordertech force-pushed the P-441-remove-NoEligibleIdentity branch from 3e3ea00 to 6617764 Compare June 10, 2024 03:59
Copy link
Collaborator

@Kailai-Wang Kailai-Wang left a comment

Choose a reason for hiding this comment

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

But I'm wondering if this PR is still up-to-date, because we don't send any "RequestVcFailed" events to parachian now...

So there's no information leak even for NoEligibleIdentity.

On the other side, it does help reduce the response time and alleviate the server load (so that it returns early when possible)

@higherordertech @jonalvarezz

@@ -90,7 +91,6 @@ impl fmt::Debug for ErrorDetail {
ErrorDetail::WrongWeb2Handle => write!(f, "WrongWeb2Handle"),
ErrorDetail::UnexpectedMessage => write!(f, "UnexpectedMessage"),
ErrorDetail::VerifyWeb3SignatureFailed => write!(f, "VerifyWeb3SignatureFailed"),
ErrorDetail::NoEligibleIdentity => write!(f, "NoEligibleIdentity"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Then you'll need to keep this

@@ -86,7 +86,7 @@ export default {
UnexpectedMessage: "Null",
__Unused_WrongSignatureType: "Null",
VerifyWeb3SignatureFailed: "Null",
NoEligibleIdentity: "Null",
__Unused_NoEligibleIdentity: "Null",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now that we keep NoEligibleIdentity, I suggest we leave it unchagned.

It's "unused" only from logic/code perspective, but the type is actually there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds a plan, so the change becomes:
1 No logic will emit that, including StfError::RequestVCFailed, so to not leak it
2 NoEligibleIdentity and it's type definition still remains unchanged

higherordertech added 3 commits June 11, 2024 11:51
@higherordertech higherordertech force-pushed the P-441-remove-NoEligibleIdentity branch from 2b3fac4 to 5dff202 Compare June 11, 2024 01:51
@BillyWooo
Copy link
Collaborator

Hi guys @higherordertech @Kailai-Wang , a bit confused. What's the conclusion?

  1. No NoEligibleIdentity event emit.
  2. But still return early, if NoEligibleIdentity.
    If so, the code logic doesn't match condition 2.

@BillyWooo
Copy link
Collaborator

Don't need it anymore. Simply close it.

@BillyWooo BillyWooo closed this Jun 11, 2024
auto-merge was automatically disabled June 11, 2024 15:22

Pull request was closed

@higherordertech higherordertech deleted the P-441-remove-NoEligibleIdentity branch July 25, 2024 23:31
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