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

Consider removing BlobsFromProto and BlobFromProto #982

Closed
rootulp opened this issue Mar 14, 2023 · 0 comments · Fixed by #988
Closed

Consider removing BlobsFromProto and BlobFromProto #982

rootulp opened this issue Mar 14, 2023 · 0 comments · Fixed by #988
Assignees
Labels

Comments

@rootulp
Copy link
Collaborator

rootulp commented Mar 14, 2023

Context

celestia-core/types/block.go

Lines 1081 to 1103 in f7b5c1f

func BlobFromProto(p *tmproto.Blob) Blob {
if p == nil {
return Blob{}
}
return Blob{
NamespaceID: p.NamespaceId,
Data: p.Data,
ShareVersion: uint8(p.ShareVersion),
}
}
func BlobsFromProto(p []*tmproto.Blob) []Blob {
if p == nil {
return []Blob{}
}
blobs := make([]Blob, 0, len(p))
for i := 0; i < len(p); i++ {
blobs = append(blobs, BlobFromProto(p[i]))
}
return blobs
}

Questions

  1. Why aren't these auto-generated?
  2. Are they necessary? A cursory search shows that these exported functions aren't used in celestia-core, celestia-app, or celestia-node so if not consider removing them
@rootulp rootulp self-assigned this Mar 14, 2023
cmwaters pushed a commit that referenced this issue Sep 20, 2023
* Add `CMT_HOME` (or remove it?) (#983)

Closes #982

Added `CMT_HOME` everywhere `CMTHOME` is used.

### Notes to reviewers

This could be fixed the opposite way, by removing the only reference to `CMT_HOME` in the code, and also the reference in `UPGRADING.md` (two lines of code).

However, the reference in `UPGRADING.md`, which is part of our documentation, is already present in `v0.34.x` (not in `v0.37.x` though!). That's why this PR introduces `CMT_HOME` to work in equal conditions as `CMTHOME`.

If reviewers lean toward removing `CMT_HOME` from the doc in `v0.34.x` (and unreleased `v0.38.x` and `main`), I can do it easily.

---

#### PR checklist

- [x] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments

(cherry picked from commit b7be568)

# Conflicts:
#	cmd/cometbft/commands/root_test.go

* Revert "Add `CMT_HOME` (or remove it?) (#983)"

* Add `CMT_HOME` (or remove it?) (#983)

Closes #982

Added `CMT_HOME` everywhere `CMTHOME` is used.

This could be fixed the opposite way, by removing the only reference to `CMT_HOME` in the code, and also the reference in `UPGRADING.md` (two lines of code).

However, the reference in `UPGRADING.md`, which is part of our documentation, is already present in `v0.34.x` (not in `v0.37.x` though!). That's why this PR introduces `CMT_HOME` to work in equal conditions as `CMTHOME`.

If reviewers lean toward removing `CMT_HOME` from the doc in `v0.34.x` (and unreleased `v0.38.x` and `main`), I can do it easily.

---

- [x] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments

---------

Co-authored-by: Sergio Mena <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant