hiero-ledger / hiero-ledger/hiero-consensus-node

Rename `SignedState` to `SignableState`

Open
#6,216 4 comments 0 reactions 1 assignee Claimed by @Deepakgarg02 View on GitHub
Good First Issue Candidate hacktoberfest Platform
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

## 🆕🐥 First Timers Only

This issue is reserved for people who have never contributed to [Hedera](https://hedera.com) or any open source project in general.
We know that creating a pull request (PR) is a major barrier for new contributors.
The goal of this issue and all other issues labeled by [**'good first issue'**](https://github.com/issues?q=is%3Aopen+is%3Aissue+org%3Ahashgraph+archived%3Afalse+label%3A%22good+first+issue%22+) is to help you make your first contribution to Hedera.

## 👾 Description of the issue

There is a class `SignedState.java`. This class is the top level object of the state and has a field where signatures are added to it as they are collected. It collects signatures in this class level field:

```
/**
* the signatures collected so far (including from self)
*/
private SigSet sigSet;
```

Once enough signatures are collected, the state is considered "signed". The name of this class is misleading because it implies that the state is always signed, but there is time before it collects enough signatures during which it is NOT signed. See in the `SignedState.java` constructor the `sigSet` is initialized with no signatures:

`sigSet = new SigSet();`

Signatures are added to the `sigSet` later, as they are collected, using this method:

```
/**
* Add a signature to the sigset. Does not validate the signature.
*
* @param nodeId the ID of the node that provided the signature
* @param signature the signature to add
*/
public void addSignature(@NonNull final NodeId nodeId, @NonNull final Signature signature)
```

### Steps to reproduce

Find the `SignedState` class. Observe the empty `sigSet` in the constructor.

### Proposed Solution:

Refactor the `SignedState.java` class to `SignableState.java`. This new name is more accurate and clear, indicating that it is an object that can collect signatures but does not imply how many have been collected.

The refactor should include all test classes with the term `SignedState` in the name.

Leave the `SignedStateInfo.java` class alone. There is [another ticket](https://github.com/hashgraph/hedera-services/issues/15304) for removing this unused interface.

## 📋 Step by step guide to do a contribution

If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. More information and concrete samples for shell commands for each step can be found in our [CONTRIBUTING.md](https://github.com/hashgraph/.github/blob/main/CONTRIBUTING.md) file.
A more detailed general documentation of the GitHub PR workflow can be found [here](https://github.com/firstcontributions/first-contributions/blob/master/README.md).

- [ ] **Claim this issue:** Comment below that you are interested in working on the issue
- [ ] **Wait for assignment:** A community member with the given rights will add you as an assignee of the issue
- [ ] **Fork the repository:** You can do that in GitHub (by simply clicking the 'fork' button).
- [ ] **Check out the forked repository**
- [ ] **Create a feature branch** for the issue. We do not have a hard naming definition for branches but it is best practice to prefix the branch name with the issue id.
- [ ] **Solve the issue** in your branch.
- [ ] **Commit your changes:** Here, it is needed to add `sign-off` information to the commit to accept the "Developer Certificate of Origin" (https://developercertificate.org). More details can be found in our [CONTRIBUTING.md](https://github.com/hashgraph/.github/blob/main/CONTRIBUTING.md)
- [ ] **Start a Pull Request (PR)**: We have a pattern for naming pull requests that a GitHub Action checks. We use that pattern to support the creation of automatic release notes.
- [ ] **Check GitHub Actions:** Several GitHub Actions will be triggered automatically for each PR. If a GitHub Action fails and you do not understand the cause of that error do not hesitate to add a comment to the PR and ask the Hedera developer community for support.
- [ ] **Wait for reviews:** Members of the Hedera developer community will review your PR. If a reviewer finds any missing pieces or a problem, he or she will start a discussion with you and describe the next steps for solving the problem.
- [ ] **You did it 🎉:** We will merge the fix in the develop branch. Thanks for being part of the Hedera community as an open-source contributor ❤️

## 🎉 Contribute to Hacktoberfest

Solve this issue as part of the [Hacktoberfest](https://hacktoberfest.digitalocean.com) event and get a chance to receive cool goodies like a T-Shirt. 🎽

## 🤔 Additional Information

If you have any questions, just ask us directly in this issue by adding a comment. You can join our community chat at [Discord](https://hedera.com/discord). A general manual about open-source contributions can be found [here](https://github.com/firstcontributions/first-contributions/blob/master/README.md).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.