-
Notifications
You must be signed in to change notification settings - Fork 7
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
commit/tokenprice: add async tokenprice observer #668
Conversation
commit/chainfee/observation_async.go
Outdated
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 here are pretty much all logging related, I wanted to add contextual logging where possible to be able to visualize rounds better.
@@ -54,26 +59,58 @@ func (p *processor) ObserveFChain(lggr logger.Logger) map[cciptypes.ChainSelecto | |||
return fChain | |||
} | |||
|
|||
func (p *processor) ObserveFeedTokenPrices(ctx context.Context, lggr logger.Logger) cciptypes.TokenPriceMap { | |||
if p.tokenPriceReader == nil { | |||
type observer interface { |
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.
Intentionally written to be as close as possible to the existing async observers
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.
Why not creating a new file for the async observer? We would match the style used for chainfee. but this is nit
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.
Its alright, this code will get deleted soon-ish anyway once we do the per-node cache.
- cmd: cd integration-tests/smoke/ccip && go test ccip_gas_price_updates_test.go -timeout 12m -test.parallel=2 -count=1 -json | ||
name: "Gas Price Updates Test" | ||
- cmd: cd integration-tests/smoke/ccip && go test ccip_token_price_updates_test.go -timeout 12m -test.parallel=2 -count=1 -json | ||
name: "Token Price Updates Test" |
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 for additional coverage.
can only run in docker at the moment
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
|
Token prices test passes in CL. Merging. |
Add an asynchronous token price
observer
implementation that follows what is being done inmerkleroot
andchainfee
.In the future, we'd want to potentially explore having these caches on a node-level rather than a plugin level to get even more performance gains.
The token price integration test couldn't be added because it requires docker, in a follow up will fix that and add it to this CI.