Skip to content

Conversation

@x1m3
Copy link
Contributor

@x1m3 x1m3 commented Oct 15, 2024

This PR adds an optional parameter to packer.Unpack function and change the implementation of the the ZKKPacker unpack code to support parameter with custom AuthVerifyDelay

packers/zkp.go Outdated

// VerificationHandlerFunc registers the handler function for state verification.
type VerificationHandlerFunc func(id circuits.CircuitID, pubsignals []string) error
type VerificationHandlerFunc func(id circuits.CircuitID, pubsignals []string, opts ...DefaultZKPUnpackerOption) error
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open question. Is it ok to use DefaultZKPUnpackerOption or we should create a new Option type?

Copy link
Contributor

Choose a reason for hiding this comment

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

My proposal it's add UnpackerParams in the same way how we did with PackerParams and use them instead of DefaultZKPUnpackerOption

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean the function verificationKey.VerificationFn.Verify(circuits.CircuitID(token.CircuitID), token.ZkProof.PubSignals, verifyOpts...) should accept ZKPPUnpackerParams

packers/zkp.go Outdated
}

func (d *defaultZKPUnpacker) defaultZkpUnpackerVerificationFn(id circuits.CircuitID, pubsignals []string) error {
func (d *defaultZKPUnpacker) defaultZkpUnpackerVerificationFn(id circuits.CircuitID, pubsignals []string, opts ...DefaultZKPUnpackerOption) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you will remove opts from defaultZKPUnpacker, you can refactor the method to function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. It is using d.resolvers inside the method body.

@ilya-korotya ilya-korotya self-requested a review November 13, 2024 10:32
use zkp unpacker params only
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.

3 participants