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-129: Implement modify DON #13242

Conversation

cds95
Copy link
Contributor

@cds95 cds95 commented May 17, 2024

No description provided.

@cds95 cds95 force-pushed the KS-129/implement-modify-DON-capability-registry branch from 203e604 to 251d23f Compare May 17, 2024 10:08
s_dons[donId].isPublic = isPublic;

DONCapabilityConfig storage donCapabilityConfig = s_dons[donId].config[configCount];
for (uint256 i; i < nodes.length; ++i) {
Copy link
Contributor Author

@cds95 cds95 May 17, 2024

Choose a reason for hiding this comment

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

Thinking a bit on how to optimize this. Currently the code blindly updates the DON's nodes and supported capability configs even if the function parameters are the same as what's already in storage. One idea I had was to store the hash of nodes and capabilityConfigs and compare them against the hash of the params passed in.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Create a ticket to test this out during the gas optimization stage?

Comment on lines 565 to 566
uint32 configCount = 1; // Initialize config count to start at 1
_setDONConfig(id, configCount, nodes, capabilityConfigurations, isPublic);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
uint32 configCount = 1; // Initialize config count to start at 1
_setDONConfig(id, configCount, nodes, capabilityConfigurations, isPublic);
_setDONConfig(id, 1, nodes, capabilityConfigurations, isPublic);

@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@cds95 cds95 merged commit 9e3d804 into use-encode-instead-of-encode-packed-capability-id May 20, 2024
117 checks passed
@cds95 cds95 deleted the KS-129/implement-modify-DON-capability-registry branch May 20, 2024 09:29
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