-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix: cache and fallback only work for OptimismGeneric and SimpleCommitment modes #156
base: main
Are you sure you want to change the base?
Conversation
@epociask I think this is true right? cache and fallback don't make sense in keccak commitment case, since s3 is the main storage engine for keccak commitments? Unless there's a way to put a redis cache in front of the s3 reason for whatever reason? |
@mcortesi how would a commitment ever be nil for keccak if we're returning up the call-stack via |
@epociask the local variable |
@mcortesi that is the intended behavior - we treat S3 or |
@epociask i understand that... but if i call Again, too much discussion for just some clean up really. To me, the change means safer/more clear code. But if you don't agree, or feel it's unnecessary and are happy sending |
} | ||
|
||
if r.cacheEnabled() || r.fallbackEnabled() { | ||
// FIXME commit here might be nil for OptimismKeccak mode |
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.
OptimismKeccak mode never reaches this code. I'm confused by this comment.
Hey @mcortesi just catching up here, sorry for the delay. I agree with the refactor because I think it makes the code clearer and less bug-prone to future changes, but I disagree with your reasoning. You must have missed the
Hence
is just not possible. But please just fix the lint error, and remove the FIXME in the code which is confusing, and then we can merge this :) |
Put
forOptimismKeccak
was broken, sincecommit
wasnil
.Checking and how
Get()
works, neither cache or fallback are possible. So what makes sense is that onPut()
we don't try to write to neither of those for this mode.