-
Notifications
You must be signed in to change notification settings - Fork 204
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
Create payload disperser #1159
Create payload disperser #1159
Conversation
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
PayloadPolynomialForm codecs.PolynomialForm | ||
|
||
// The timeout duration for contract calls | ||
ContractCallTimeout time.Duration |
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.
prob should mention a default. Typically I define a defaultPayloadClientConfig
struct with the default values, and assign those in the constructor for any value that wasn't set.
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 think it might be worth adding some guidelines for configuration classes to the style guide.
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.
@samlaf Could you clarify what config architecture you're proposing here? Creating a constructor for the struct? Creating a method which checks and sets missing defaults?
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.
Added TODO for me to add this to style guide: #1137 (comment)
In terms of my personal preference, I like:
- no constructor for config structs (that's very much against the point of having extendability, which requires using go's default zero value initialization)
- having the constructor validate the config and inject default values over zero values (note: this requires care that zero values are always meaningless, which is not always the case!)
- validation + injecting defualt values can be part of a separate function if it's a large config struct that would overwhelm the rest of constructor logic
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.
no constructor for config structs (that's very much against the point of having extendability, which requires using go's default zero value initialization)
Could you explain what you mean by this? What's the problem with having a constructor for ConfigA
, and if ConfigA
extends ConfigB
, call the constructor for ConfigB
in the constructor of ConfigA
?
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 created some config utilities in 959e4564. LMK what you think
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.
LGTM! Having a default constructor is totally fine, and is actually a good idea! What I meant is that users shouldn't be constructing the config by using a constructor of the type
func NewConfig(fieldA, fieldB, fieldC, fieldD,...) Config {
return Config{
fieldA,
fieldB,
...
}
}
Because this is dumb
// This call to the disperser doesn't have a dedicated timeout configured. | ||
// If this call fails to return in a timely fashion, the timeout configured for the poll loop will trigger |
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.
is this actually true?
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.
There is a timeout set on the context being passed into pollBlobStatusUntilCertified
.
If that timeout triggers, it will abort this GetBlobStatus
call if necessary, and abort the polling loop, right?
previousStatus = newStatus | ||
} | ||
|
||
switch newStatus { |
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.
let's add a TODO specifying that we'll need to add more in-depth response status processing to derive failover errors
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 I understand what you mean by "derive failover errors".
Do you mean we will need to expand the types of status returned from the top level SendPayload
method, beyond what's included in the existing BlobStatus
enum?
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.
so we'll need to interpret terminal status status in a meaningful way to map them into a failover
error which tells the proxy to return a status 503
response which a rollup batcher can interpret as "go use other DA"
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.
Hmm. Is it not true that any error in dispersal would require resorting to failover? If not, what class of error would you expect to not result in failover, and what would be the strategy to handle it? Retries? (trying to understand likely outcomes, to be able to write a helpful TODO)
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.
we already have a strategy or framework in-place for this that we can extend from. Would recommend just adding a general todo vs re-articulating a methodology that was months of research
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.
Added the TODO
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
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.
The changes that I had requested have been made, so approving.
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.
LGTM
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Why are these changes needed?
PUT
side of the v2 clientChecks