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

pluginconfigs: axe unnecessary config types #70

Closed
wants to merge 4 commits into from

Conversation

makramkd
Copy link
Collaborator

@makramkd makramkd commented Aug 19, 2024

What

Axe unnecessary config types.

Why

They're confusing and unnecessary

Fixed tests here: smartcontractkit/ccip#1325

@makramkd makramkd marked this pull request as ready for review August 19, 2024 18:19
MaxReportTransmissionCheckAttempts uint `json:"maxReportTransmissionCheckAttempts"`

// SyncTimeout is the timeout for syncing the commit plugin reader.
SyncTimeout time.Duration `json:"syncTimeout"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't use defaults for these let's add them validation for them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have multiple readers and better clarify here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have defaults for this that are applied in the plugin constructors. I'm wondering if there should be a standard place where defaults are applied. In the plugin constructor seems fine to me at the moment though.

// The maximum number of times to check if the previous report has been transmitted
MaxReportTransmissionCheckAttempts uint `json:"maxReportTransmissionCheckAttempts"`

// SyncTimeout is the timeout for syncing the commit plugin reader.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// SyncTimeout is the timeout for syncing the commit plugin reader.
// SyncTimeout is the timeout for syncing the commit plugin ccip reader.

// SyncTimeout is the timeout for syncing the commit plugin reader.
SyncTimeout time.Duration `json:"syncTimeout"`

// SyncFrequency is the frequency at which the commit plugin reader should sync.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// SyncFrequency is the frequency at which the commit plugin reader should sync.
// SyncFrequency is the frequency at which the commit plugin ccip reader should sync.

PriceSources: map[types.Account]ArbitrumPriceSource{},
},
true,
},
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add tests for sync durations and timeouts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sync duration and timeout have defaults that are applied in the plugin constructors, so I think its OK if they're zero.

Although there could be an argument for not having these defaults since its less visible...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to be enforced through config. Better for visibility and understanding the important parts when reading the config.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then will rip out the defaults and enforce that they're specified in the offchain config

Copy link

Test Coverage

Branch Coverage
mk/CCIP-3028 61.5%
ccip-develop 61.7%

@makramkd
Copy link
Collaborator Author

Will re-implement in another branch

@makramkd makramkd closed this Aug 27, 2024
@makramkd makramkd deleted the mk/CCIP-3028 branch August 27, 2024 11:01
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