Skip to content
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

Merged
merged 26 commits into from
Jan 21, 2022

Conversation

aalu1418
Copy link
Collaborator

@aalu1418 aalu1418 commented Jan 19, 2022

  • Make SkipPreflight configurable (now default off for speed purposes)
  • Make commitment level configurable (default: CommitmentConfirmed, middle between Processed & Finalized)
  • Add state polling
  • libocr update
  • Local testing

Related PR in core: smartcontractkit/chainlink#5838

@@ -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)
Copy link
Collaborator Author

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

@aalu1418 aalu1418 changed the title Make preflight checks configurable + polling state Make state/transmit configurable + polling state Jan 19, 2022
if err := c.fetchLatestTransmission(ctx); err != nil {
c.lggr.Errorf("error in PollState.fetchLatestTransmission %s", err)
}
}()
Copy link
Contributor

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?

Copy link
Collaborator Author

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

Copy link
Contributor

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.

Copy link
Collaborator Author

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

@aalu1418 aalu1418 force-pushed the feature/configurability branch from 3f66868 to 321da08 Compare January 21, 2022 13:50
@aalu1418 aalu1418 marked this pull request as ready for review January 21, 2022 17:42
pkg/solana/client.go Outdated Show resolved Hide resolved
pkg/solana/contract.go Outdated Show resolved Hide resolved
pkg/solana/contract.go Outdated Show resolved Hide resolved
pkg/solana/contract.go Outdated Show resolved Hide resolved
@aalu1418 aalu1418 merged commit 5b4d7cd into develop Jan 21, 2022
@aalu1418 aalu1418 deleted the feature/configurability branch January 21, 2022 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants