-
Notifications
You must be signed in to change notification settings - Fork 207
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
Implement cert verifier address provider #1368
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]>
blob, err := payload.ToBlob(pd.config.PayloadPolynomialForm) | ||
if err != nil { | ||
return nil, fmt.Errorf("convert payload to blob: %w", err) | ||
} | ||
|
||
timeoutCtx, cancel := context.WithTimeout(ctx, pd.config.ContractCallTimeout) | ||
defer cancel() | ||
requiredQuorums, err := pd.requiredQuorumsStore.GetQuorumNumbersRequired(timeoutCtx, certVerifierAddress) | ||
requiredQuorums, err := pd.certVerifier.GetQuorumNumbersRequired(timeoutCtx) |
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.
This utilizes the cache righT?
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.
Correct. The cache is now internal to the cert verifier, rather than being managed by the payload disperser.
// This method is synchronized in a way that, if called by multiple goroutines, only a single goroutine will actually | ||
// poll the internal eth client for the most recent block number. The goroutine responsible for polling at a given time | ||
// updates an atomic integer, so that all goroutines may check the most recent block without duplicating work. | ||
func (bnp *BlockNumberProvider) MaybeWaitForBlockNumber(ctx context.Context, targetBlockNumber uint64) error { |
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 maybe
is quite confusing until i went through the logic twice. Idk if we can rename it or soemthing.
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.
Renamed to WaitForBlockNumber
ceee94b9
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.
Looks like very nice cleanup. Have a bunch of nits but honestly would be happy merging in this state.
api/clients/v2/payloadretrieval/relay_payload_retriever_test.go
Outdated
Show resolved
Hide resolved
// checkAndSetCertVerifierAddress checks whether the input address string is empty, and skips the test if it is | ||
// | ||
// If the input address is not empty, this method configures the test client to use the input address as the cert | ||
// verifier address. | ||
func checkAndSetCertVerifierAddress(t *testing.T, c *client.TestClient, certVerifierAddress string) { | ||
if certVerifierAddress == "" { | ||
t.Skip("Requested cert verifier address is not configured") |
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.
first time I see this kind of pattern of skipping a test inside some function. Is this something you've used before? Curious if there would be another way to skip the test earlier and inside the test itself.
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 something you've used before?
Nope, I just did this since there were two things that needed to happen, each time a test handles a cert verifier address. Don't feel too strongly about it, would you prefer doing each of things manually on a per-test basis?
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.
As we've discussed before, I'm just scared of dynamic stuff. Can this skip be done midway through the test after some processing has been done? Or is it purely a construct used at the beginning of tests? If the latter then fine with me.
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 talked offline. Would prefer in the future that we don't have this kind of dynamic skipping of tests. But let's move on for now, more tests is always better than no tests!
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]>
type BlockNumberProvider struct { | ||
// BlockNumberMonitor is a utility for waiting for a certain ethereum block number | ||
// | ||
// TODO: this utility is not currently in use, but DO NOT delete it. It will be necessary for the upcoming |
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.
// TODO: this utility is not currently in use, but DO NOT delete it. It will be necessary for the upcoming | |
// TODO(litt): this utility is not currently in use, but DO NOT delete it. It will be necessary for the upcoming |
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.
which litt? ;)
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.
Litt specified, and disambiguated
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Closes EGDA-979
Why are these changes needed?
CertVerifierAddressProvider
is used throughout the clients, instead of manually passing in an address for each callChecks