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

Remove airnode address from template verification #1037

Merged
merged 4 commits into from
Apr 27, 2022

Conversation

vponline
Copy link
Contributor

This removes airnode address as an input for templateId derivation.

@vponline vponline self-assigned this Apr 26, 2022
@vponline vponline requested a review from a team April 26, 2022 07:04
Copy link
Contributor

@Siegrift Siegrift left a comment

Choose a reason for hiding this comment

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

👍 LGTM.

@@ -8,7 +8,6 @@ interface ValidatedField {

function getTemplateIdValidationFields(template: ApiCallTemplateWithoutId): ValidatedField[] {
return [
{ type: 'address', value: template.airnodeAddress },
Copy link
Contributor

Choose a reason for hiding this comment

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

I think @acenolaza is correct. The getExpectedTemplateId function is used in api/index.ts (https://github.com/api3dao/airnode/blob/master/packages/airnode-node/src/api/index.ts#L149) both for signed data gateway requests but also regular Airnode RRP requests. That's why you had to change tests everywhere, not just the ones for callApi. I think this change breaks the Airnode RRP. We need two different template ID derivation functions, one for Airnode RRP (v0 contracts) and one for signed data gateway (v1 contracts).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you prefer to have two separate functions, or we could pass the request type (regular/http-signed-gateway) into getExpectedTemplateId and return based on that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think two separate functions will result in a nicer code.

Copy link
Contributor

@amarthadan amarthadan left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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