-
Notifications
You must be signed in to change notification settings - Fork 267
Conversation
ValidationCacheData { | ||
entries: validation.source_chain_entries.clone(), | ||
headers: validation.source_chain_headers.as_ref().unwrap().clone(), | ||
cached_at: SystemTime::now(), |
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.
Are we cool keeping these things cached forever? cached_at
doesn't seem to ever be read.
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.
I'm not persisting this data, so it will be cleared on reboot, which is fine I think because in that case the chain in the cache is probably pretty stale and will need to be fetched anyways. I think he only real reason to dump the cache is because memory gets tight...
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.
question about cache expiry and comment addition - otherwise looks good 👍
Co-authored-by: David Braden <neonphog@gmail.com>
PR summary
This PR adds caching of FullChain ValidationPackages received from agents so that on subsequent attempts get data from the same agent we can skip the network roud-trip. This is especially important when nodes first come on any may have to hold lots of data from a given node. This can drastically reduce the number of network round-trips.
testing/benchmarking notes
N.B. App-spec failing
This PR includes changing the sim2h RETRY_FETCH_MISSING_ASPECTS_INTERVAL_MS from .5s to 30 seconds. This is necessary for systemic health (especially as new nodes come online), but causes a number of app-spec tests to fail due to timing issues.
followups
( any new tickets/concerns that were discovered or created during this work but aren't in scope for review here )
changelog
documentation