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

Add unused code back in to preserve compatibility with the sdk #522

Merged
merged 2 commits into from
Aug 31, 2021

Conversation

evan-forbes
Copy link
Member

Description

we need to restore some unused code to get the cosmos-sdk to compile. This should be reevaluated after we update to the latest versions of tendermint and the sdk.

Closes: #521

@evan-forbes evan-forbes self-assigned this Aug 26, 2021
@evan-forbes evan-forbes requested review from Bidon15 and renaynay and removed request for liamsi August 26, 2021 20:38
@evan-forbes evan-forbes marked this pull request as draft August 26, 2021 20:40
Copy link
Member

@Bidon15 Bidon15 left a comment

Choose a reason for hiding this comment

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

If changing something comparing to #208 due to my comments can cause a pain-in-the-neck future, then no need to change 😅

tmsync "github.com/celestiaorg/celestia-core/libs/sync"
)

// var maxNumberConnections = 2
Copy link
Member

Choose a reason for hiding this comment

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

I don't quite get the idea why this comment is still left here stranded 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

me neither 🤷‍♂️


// Read requests from conn and deal with them
func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, responses chan<- *types.Response) {
var count int
Copy link
Member

Choose a reason for hiding this comment

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

It seems like a wisdom thought liner. Nevertheless, it would be nice if there is an explanation why this is only used for incrementing and nothing else 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

wait, what's a wisdom thought liner? Also, I tend to agree, comment are usually very much appreciated.

Copy link
Member

Choose a reason for hiding this comment

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

A wisdom thought liner is a 1 line of code that does something too magical that I can't get the understanding of it aka too wise for me 😸


// Pull responses from 'responses' and write them to conn.
func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, responses <-chan *types.Response) {
var count int
Copy link
Member

Choose a reason for hiding this comment

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

Same wisdom is applied here 🧐

return connID
}

// deletes conn even if close errs
Copy link
Member

Choose a reason for hiding this comment

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

for comments, even on private funcs, I think it's nice to do:

// <func name> does X, Y, Z

@renaynay
Copy link
Member

@evan-forbes this is code copied and pasted from the cosmos sdk?

@evan-forbes
Copy link
Member Author

evan-forbes commented Aug 27, 2021

This code was copied from the commit directly before it was deleted in celestia-core. It's needed for the sdk to compile. I tried to only copy the minimum code necessary, but will likely have to copy more as I broke a bunch of stuff in the sdk 😅 (see #28)

so I'll leave this as a draft until I figure out how to fix all the breaking tests. Normally I like to incorporate as much feedback as possible, but I think in this very specific scenario where this code was copied from tendermint, I think it might be advantageous to leave the code alone so that we modify tendermint even less. If you think otherwise though, I'm very happy to incorporate the wonderful feedback you provided!!

@Bidon15
Copy link
Member

Bidon15 commented Aug 27, 2021

This code was copied from the commit directly before it was deleted in celestia-core. It's needed for the sdk to compile. I tried to only copy the minimum code necessary, but will likely have to copy more as I broke a bunch of stuff in the sdk 😅 (see #28)

so I'll leave this as a draft until I figure out how to fix all the breaking tests. Normally I like to incorporate as much feedback as possible, but I think in this very specific scenario where this code was copied from tendermint, I think it might be advantageous to leave the code alone so that we modify tendermint even less. If you think otherwise though, I'm very happy to incorporate the wonderful feedback you provided!!

If we are applying the black box thinking to this, then for me it's for the best to just remeber/document somewhere what we actually think should be changed in the code-base. Or just make a PR with questions to tendermint itself 😅

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

👍🏻

@evan-forbes evan-forbes merged commit ceaf5e5 into master Aug 31, 2021
@evan-forbes evan-forbes deleted the evan/restore-some-unused-code branch August 31, 2021 14:39
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.

Restore the ABCI server package
4 participants