Conversation
f8ca4e2 to
e55ac11
Compare
Added cach layer Remove redundant calls.
e55ac11 to
04f6520
Compare
| blocktime, | ||
| true, | ||
| c.config.GetUint64(optionNameMinimumGasTipCap), | ||
| blocktime-2, |
There was a problem hiding this comment.
Just to note that current blocktime on our CI is 1s. So this way caching is not used there... How we could achive to use it there?
There was a problem hiding this comment.
In deploy.go blockTime is hardcoded by itself. But if we are talking about CI, normally cacheTTL is about 85% of block time, so even if it is 1 second, than we will get 850 ms
| t.Helper() | ||
|
|
||
| var expSegments [][]byte | ||
| expSegments := make([][]byte, 0, len(exp)) |
There was a problem hiding this comment.
These are fine but feel like they belong in a separate PR.
There was a problem hiding this comment.
Yes, but linter was failing so I decided to fix everything. Next time will create separate PR
pkg/node/chain.go
Outdated
| pollingInterval time.Duration, | ||
| chainEnabled bool, | ||
| minimumGasTipCap uint64, | ||
| blockCacheTTl time.Duration, |
There was a problem hiding this comment.
Typo blockCacheTTl -> blockCacheTTL
| } | ||
| } | ||
|
|
||
| func NewMetrics() Metrics { |
There was a problem hiding this comment.
Seems not used (dead code).
| c.metrics.LoadErrors.Inc() | ||
| return val, err | ||
| } | ||
| c.Set(val, time.Now()) |
There was a problem hiding this comment.
Should we use here now from argument?
There was a problem hiding this comment.
What could happen if loader takes a while?
There was a problem hiding this comment.
I do not think so because there is difference between time when we request value and time, when we set new value if we had to load it.
|
Suggestion: Instead of a fixed TTL ( How it works:
|
Checklist
Description
Removed RPC patterns in the transaction flow. Added cache layer for BlockNumber rpc call.
Fixed lint issues in the new cache package and cleaned up minor lint findings in adjacent test/helper code.
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
#5388
Screenshots (if appropriate):
Highly likely hit ratio is low because of high load errors (EOF), which is fix by PR