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

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

Merged
merged 7 commits into from
Jun 5, 2024

Conversation

bolekk
Copy link
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
Collaborator

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
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 force-pushed the feature/KS-241-contracts-new-meta branch from 09db180 to bdcc21a Compare June 4, 2024 21:04
@bolekk bolekk force-pushed the feature/KS-241-contracts-new-meta branch from 1e33a20 to 82e99fc Compare 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 force-pushed the feature/KS-241-contracts-new-meta branch from a9fd3af to 3ce2f6d Compare June 5, 2024 07:31
archseer
archseer previously approved these changes Jun 5, 2024

// f can never be 0, so this means the config doesn't actually exist
if (s_configs[donId].f == 0) revert InvalidDonId(donId);

bytes32 reportId = _reportId(receiverAddress, workflowExecutionId);
if (s_reports[reportId].transmitter != address(0)) revert ReportAlreadyProcessed(reportId);
bytes32 combinedId = _combinedId(receiverAddress, workflowExecutionId, reportId);
Copy link
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

@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
106 checks passed
@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