Skip to content

[KS-241] Update metadata passed to Forwarder and Receiver#13389

Merged
bolekk merged 7 commits intodevelopfrom
feature/KS-241-contracts-new-meta
Jun 5, 2024
Merged

[KS-241] Update metadata passed to Forwarder and Receiver#13389
bolekk merged 7 commits intodevelopfrom
feature/KS-241-contracts-new-meta

Conversation

@bolekk
Copy link
Copy Markdown
Contributor

@bolekk bolekk commented Jun 1, 2024

No description provided.

Comment on lines +83 to +89
// workflow_name // offset 64, size 10
// workflow_owner // offset 74, size 20
// report_name // offset 94, size 2
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.

This is 32 bytes total. You could return just the 32 bytes and do an equality comparison (even a hash is not needed).

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 might be tough when we allow multiple owners and/or names.

@bolekk bolekk marked this pull request as ready for review June 5, 2024 02:30
@bolekk bolekk requested review from a team and patrick-dowell as code owners June 5, 2024 02:30
@archseer archseer requested a review from DeividasK June 5, 2024 07:33
archseer
archseer previously approved these changes Jun 5, 2024

bytes32 reportId = _reportId(receiverAddress, workflowExecutionId);
if (s_reports[reportId].transmitter != address(0)) revert ReportAlreadyProcessed(reportId);
bytes32 combinedId = _combinedId(receiverAddress, workflowExecutionId, reportId);
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.

Inconsistent naming

Suggested change
bytes32 combinedId = _combinedId(receiverAddress, workflowExecutionId, reportId);
bytes32 messageId = _combinedId(receiverAddress, workflowExecutionId, reportId);

I would prefer transmissionId. We can fix in a follow-up.

// workflow_owner // offset 119, size 20
// report_name // offset 139, size 2
if (uint8(rawReport[0]) != 1) {
revert InvalidVersion(uint8(rawReport[0]));
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.

As discussed, we don't need this validation today. We can fix it in a follow-up.

bytes10[] internal s_allowedWorkflowNamesList;
mapping(bytes10 => bool) internal s_allowedWorkflowNames;

function setConfig(
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.

This is not efficient (I understand it is just an example). We can fix it in a follow-up gas optimization PR.

Copy link
Copy Markdown
Contributor

@DeividasK DeividasK left a comment

Choose a reason for hiding this comment

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

LGTM. I will address polish comments in a follow-up PR.

@bolekk bolekk enabled auto-merge June 5, 2024 14:33
@bolekk bolekk added this pull request to the merge queue Jun 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 5, 2024
@bolekk bolekk added this pull request to the merge queue Jun 5, 2024
Merged via the queue into develop with commit 3959091 Jun 5, 2024
@bolekk bolekk deleted the feature/KS-241-contracts-new-meta branch June 5, 2024 15:46
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