-
Notifications
You must be signed in to change notification settings - Fork 961
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
A Proposal for Sharding Client Abstraction #83
Conversation
This looks fine and works well too. I think we can still further abstract all this: This should all be run before the collator client is called , otherwise we end up having repetition again on the proposer client. |
It depends if we are just implementing for phase 1. As we introduce Executor client in phase 2, it will not need to deploy SMC |
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'm not sure how @nisdas feels about this but I find it quite frustrating. @nisdas put out a design doc for review and that was the place for suggestions like this, not a pull request. If we were to merge this, it would effectively throw away all of the work he has done so far (and has not pushed to his branch yet).
I don't understand the motivation for this change. It appears you guys are against introducing new packages under sharding in order to separate the consumer/producer of a client in the sharding paradigm but you have provided no basis why your argument is better. There was one comment that said it would make it more difficult to merge upstream which is not true at all. Furthermore, @nisdas and I provided links to various go style guides and standards to support our argument that splitting these up would be more effective.
I recommend that we close this PR entirely and take the discussion back to the google doc and perhaps have a review phone call about it. https://docs.google.com/document/d/1__74pTWFpzfLLJ8017XeWQWJfs89YgTGxuefjkFUAaY/edit
@prestonvanloon we don't mean to frustrate you or @nisdas or step into his shoes. The reasons this PR got created was to help us kick start #79 and #80. We wanted to work on them over the weekend, but it was blocked by #82. We are more than happy to merge back with Nishant's #82 after he is done. In the mean time, we can have a call when everyone is free |
Fixed in #85. This PR will be closed. |
Building on #82, we were discussing how to abstract common methods from collators/proposers into a general sharding client as an effort to have no code duplication in
collator.go
andproposer.go
respectively.@terenc3t and I came up with this scheme that works in this PR, and wanted to get @nisdas and @prestonvanloon's opinions on.
Here is an explanation of the changes
collator_client.go
toclient.go
. This file exposes an abstractShardingClient
struct that will implement thecollator
andproposer
interface. It contains all common methods for both.collator.go
file to contain an interface with only the functions collators will need, as well as specific collator functionality. The same thing can be done withproposer.go
.smc.go
file, as InitSMC should be a common function to both collators and proposers.sharding.startCollatorClient
andsharding.startProposerClient
. These functions take in a struct that implements thecollator
interface and theproposer
interface, respectively. For example:Here is where we need feedback
collator
interface incollator.go
that we can obfuscate even more?