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

fix: gosec warnings #1785

Merged
merged 3 commits into from
Oct 10, 2024
Merged

fix: gosec warnings #1785

merged 3 commits into from
Oct 10, 2024

Conversation

MatusKysel
Copy link
Contributor

No description provided.

@@ -157,7 +157,7 @@ func ComputeCommitteeID(committee []spectypes.OperatorID) spectypes.CommitteeID
// Convert to bytes
bytes := make([]byte, len(committee)*4)
for i, v := range committee {
binary.LittleEndian.PutUint32(bytes[i*4:], uint32(v)) // nolint:gosec
binary.LittleEndian.PutUint32(bytes[i*4:], uint32(v)) // #nosec
Copy link
Contributor

Choose a reason for hiding this comment

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

let's please disable only the specific rule to avoid missing any future rules

@@ -95,6 +95,7 @@ func (eh *EventHandler) handleOperatorAdded(txn basedb.Txn, event *contract.Cont
return nil
}

// This function is currently no-op and it will do nothing. Operator removed event is not used in the current implementation.
Copy link
Contributor

@moshe-blox moshe-blox Oct 10, 2024

Choose a reason for hiding this comment

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

i think we can remove the commented code inside and move this comment there instead, also clarifying that it will do nothing - beyond validating the operator exists, and that we should consider removing the operator and updating the shares in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also opened an issue #1786

@moshe-blox moshe-blox changed the title Gosec fixes fix: gosec warnings Oct 10, 2024
@moshe-blox moshe-blox merged commit ec5e0ad into stage Oct 10, 2024
6 checks passed
@moshe-blox moshe-blox deleted the gosec-fixes branch October 10, 2024 12:15
iurii-ssv pushed a commit to iurii-ssv/ssv that referenced this pull request Oct 16, 2024
* resolve gosec issues

* add comment to clarify handleOperatorRemoved implementation

* fix review comments
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