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

Gauntlet fix offchain serialize #26

Merged
merged 2 commits into from
Dec 14, 2021

Conversation

RodrigoAD
Copy link
Member

@RodrigoAD RodrigoAD commented Dec 13, 2021

Old JSON descriptor was generating a different result than libocr. Now is autogenerated from the .proto description

@@ -0,0 +1,45 @@
// Autogenerated from ocr2Proto.proto with Protobuf.toJSON()
export const descriptor = {
Copy link
Member Author

Choose a reason for hiding this comment

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

Autogenerated descriptor with https://github.com/smartcontractkit/chainlink-solana/blob/8bb813d26e1ab55e54fbf6b938c33417685c86cd/gauntlet/packages/gauntlet-solana-contracts/src/core/proto/ocr2Proto.proto as source
JSON descriptor is still used as TS transpilation does not allow to include .proto files, that will be needed for the binary

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add a yarn script that will do the auto-generation and write the descriptor to the file so there are no manual steps involved.

@@ -0,0 +1,37 @@
syntax="proto3";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is this file from? It will also be required for the monitoring service AFAIK cc @topliceanu

Let's move this to the root e.g. ./proto/ocr2.proto and then both use the same source.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, let's just move it to root and monitoring can use directly while Gauntlet derives/generates the ts descriptors by using the local script.

@@ -0,0 +1,45 @@
// Autogenerated from ocr2Proto.proto with Protobuf.toJSON()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's rename the file as ocr2.proto.ts and move it from ./core as these are contracts/ocr2 specific, not part of core lib.

@RodrigoAD RodrigoAD merged commit 076a2d6 into feature/relay Dec 14, 2021
krebernisak pushed a commit that referenced this pull request Dec 20, 2021
* proto encoding with Proto description

* Proto descriptor as JSON object
@archseer archseer deleted the gauntlet-fix-offchain-serialize branch January 12, 2022 08:02
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.

None yet

2 participants