Only store IssuanceChain if not cached#1679
Conversation
3928f69 to
90b3f4c
Compare
|
/gcbrun |
1 similar comment
|
/gcbrun |
5fd1a6d to
92cdb3c
Compare
|
/gcbrun |
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
roger2hk
left a comment
There was a problem hiding this comment.
This change should greatly reduce the data transfer between CTFE and the database for add[-pre]-chain requests. Thanks, @robstradling!
If an IssuanceChain is already present in CTFE's LRU cache, then we know it must also already be stored on the database. Since a cache lookup is less expensive than a database write (that we know will fail with a duplicate key exception), it makes sense to check the cache and then only perform the database write if the IssuanceChain is not present in the cache.
Checklist