Skip to content

[KS-196] ReportCodec implementation for Streams trigger#13218

Merged
bolekk merged 1 commit intodevelopfrom
deploy_staging
May 21, 2024
Merged

[KS-196] ReportCodec implementation for Streams trigger#13218
bolekk merged 1 commit intodevelopfrom
deploy_staging

Conversation

@bolekk
Copy link
Copy Markdown
Contributor

@bolekk bolekk commented May 16, 2024

  1. Implement Codec, which validates report signatures and decodes needed fields.
  2. Pass report context from Merucry Transmitter, which is needed to validate signatures.
  3. Update fake Syncer to run successful e2e tests.

@bolekk bolekk requested review from a team as code owners May 16, 2024 02:11
@bolekk bolekk requested a review from a team May 16, 2024 15:18
@bolekk bolekk force-pushed the deploy_staging branch 11 times, most recently from db12eea to ac1bba1 Compare May 21, 2024 02:52
@bolekk bolekk changed the title Update syncer to include real trigger DON [KS-196] ReportCodec implementation for Streams trigger May 21, 2024
@bolekk bolekk requested a review from DeividasK May 21, 2024 02:53
@bolekk bolekk requested a review from krehermann May 21, 2024 02:54
@bolekk bolekk requested a review from samsondav May 21, 2024 03:30
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

May I ask, why is the list of reports passed as a wrapped values.Value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

values.Value is a universal wrapper for all data passed around during workflow execution. Trigger Service will wrap it and then the receiver DON will unwrap it here.

Comment on lines 65 to 67
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth implementing a StateMachine here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This Syncer implementation will soon be replaced with a real one reading stuff from the chain. Right now it's here just to allow easy local and staging tests. Please ignore all shortcomings ;)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you mean to delete this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I want to leave it for easier local tests - will be replaced within 2 weeks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a permanent failure that leaves the node in a broken state?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

broken meaning unable to send trigger events but otherwise functional.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems confusingly named, count doesn't appear to be a timer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

true, will remove the "seconds" thanks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would this be cleaner using a backoff.Backoff with permanent retry?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes but probably not worth it - again this Syncer won't be used in prod.

@bolekk bolekk force-pushed the deploy_staging branch 2 times, most recently from e42f85a to aa9659d Compare May 21, 2024 15:20
Comment on lines 91 to 97
Copy link
Copy Markdown
Contributor

@DeividasK DeividasK May 21, 2024

Choose a reason for hiding this comment

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

Heads up, that this will change to be bytes32 onchain (https://github.com/smartcontractkit/chainlink/pull/13183/files#diff-d94c1796b3544ef8780af7e16b5361c8fb9e4d63f492faeda6a3362a8363f51bR45-R51). We can do decoding once the Syncer is up, but not sure the best place to do that, thread: https://chainlink-core.slack.com/archives/C064418MJHE/p1716308390423929

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's fine. As long as the Syncer passes correct binary addresses to all services, we're good.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
s.lggr.Infow("trigger not found yet ...", "capabilityId", capId, "error", err)
s.lggr.Infow("trigger not found yet ...", "capabilityId", capId, "error", err2)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixing, thanks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the future, this should only happen when DON isPublic, right? Currently, this assumes that the capability is always remote without actually checking for local existence, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this rawReportCtx [3][32]byte, be based on a workflow spec config?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How so? The context encodes OCR round and epoch in which the report was produced.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess it's not clear what this context is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It should be pretty clear in the context of the Transmitter because it already uses it elsewhere.

DeividasK
DeividasK previously approved these changes May 21, 2024
1. Implement Codec, which validates report signatures and decodes needed fields.
2. Pass report context from Merucry Transmitter, which is needed to validate signatures.
3. Update fake Syncer to run successful e2e tests.
@cl-sonarqube-production
Copy link
Copy Markdown

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