-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Creating a proposer client interface #60
Conversation
Could you add a pull request description? What are the changes you are making here? |
Added a description above |
1e3f775
to
2737711
Compare
f4bb857
to
14a42c4
Compare
3650e55
to
4bed18a
Compare
Should we add tests and avoid the duplicate code within clients? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a lot of concerns about the patterns we are choosing here. The code is already getting wildly wild and it's probably my fault (I started it).
We have agreed that there are two problems here:
- There is pretty much no new code, it's the same code as the collator client.
- There are no tests in this PR.
I think the latter is a product of the former. So let's start with addressing 1 with abstraction. I'd like to see these common methods abstracted into a new interface that both of these clients use. Think about all the things they have in common:
- Endpoint
- Client
- Keystore
- CLI context
- SMC
- Even their constructor methods are very similar
Can you create a "client" interface for sharding that provides all of the above and that the proposer and collator can use?
Read:
https://golang.org/doc/effective_go.html#interfaces_and_types
https://github.com/golang/go/wiki/CodeReviewComments#interfaces
I think we should call it shardingClient so that we're different that the ethclient or other packages in the repo. |
I really like this initiative to address our client side abstraction. +1 to shardingClient |
So the common methods can be receivers for shardingClient, while specific ones can be receivers of CollatorClient and ProposerClient. |
Hey guys, I will be putting up a design proposal soon for refactoring/abstraction of our code so as to provide a solution for the issues that have been raised |
* Week 0 & 1 update * Update development-updates.md * Update development-updates.md --------- Co-authored-by: Mário Havel <61149543+taxmeifyoucan@users.noreply.github.com>
Addresses #59
geth sharding-proposer
is entered a basic proposer rpc - client is initiated