-
Notifications
You must be signed in to change notification settings - Fork 992
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
[DNM] Fix verifier cache keys by hashing full Output
#3613
Conversation
Thanks @DavidBurkett ! All comments addressed. |
It would be good to add a test here that exercises the full block processing pipeline resulting in an Ideally we can reproduce the inflation bug running the test with We will have to jump through some hoops to build an "invalid" block (presumably we need to swap out a valid rangeproof for an invalid one). tl;dr This was probably the most serious bug we have discovered in |
Got it. I looked the relevant code and I think I'll be able to make progress on this. Will ping when ready for a review, or with any questions that arise. Thanks! |
The more I look at the "verifier cache" the less I like our current implementation. Note: the test coverage implemented by @trevyn is still very much useful and I am not proposing we discard this. I'm going to take a pass at what the code would look like with the verifier cache removed entirely. If we subsequently want to reintroduce some level of caching we should do this at the txpool level and keep it isolated there, rather than threading this global "cache" state all over the codebase. |
I definitely support removing the cache. Do we have a sense of the actual, measured performance impact? |
For a handful of txs per block like we have currently and a txpool that handles those few txs the performance impact is going to be close to zero. |
PR to remove the verifier cache - #3628 |
👍🏼. Will sort out bringing the tests over once that is merged. |
Per #3606 and discussion with @antiochp, this includes:
DefaultHashable
forOutput
, and hash the fullOutput
including theOutputIdentifier
, instead of just theRangeProof
. This looks to be provided via the existingWriteable
impl onOutput
.Outstanding questions: