-
Notifications
You must be signed in to change notification settings - Fork 44
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
Make state/transmit configurable + polling state #124
Conversation
pkg/solana/transmitter.go
Outdated
@@ -19,7 +18,7 @@ func (c *ContractTracker) Transmit( | |||
report types.Report, | |||
sigs []types.AttributedOnchainSignature, | |||
) error { | |||
recent, err := c.client.rpc.GetRecentBlockhash(ctx, rpc.CommitmentFinalized) | |||
recent, err := c.client.rpc.GetRecentBlockhash(ctx, rpcCommitment) |
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.
switch from CommitmentFinalized to CommitmentConfirmed
if err := c.fetchLatestTransmission(ctx); err != nil { | ||
c.lggr.Errorf("error in PollState.fetchLatestTransmission %s", err) | ||
} | ||
}() |
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.
Should these goroutines cancel on c.done
?
Is it OK to proceed without waiting for them to complete?
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.
that's a good point, it would be good to cancel the context or wait for it to complete.
not sure how to do this off the top of my mind, but i'll do some digging
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.
package utils
has some relevant helpers, e.g. ContextFromChan
and WaitGroupChan
.
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.
💯 it had ContextFromChanWithDeadline
which is exactly what i needed
i should look through utils
more often
3f66868
to
321da08
Compare
Related PR in core: smartcontractkit/chainlink#5838