-
Notifications
You must be signed in to change notification settings - Fork 128
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
Make db initialization configurable #3129
Conversation
execution_chain/db/ledger.nim
Outdated
@@ -453,6 +453,10 @@ proc getCode*(ac: LedgerRef, | |||
returnHash: static[bool] = false): auto = | |||
let acc = ac.getAccount(address, false) | |||
if acc.isNil: | |||
# We need to record that the code was read even if the account doesn't exist | |||
# so that the returned multikeys correctly show that the code lookup occurred | |||
ac.witnessCache[address] = WitnessData(codeTouched: true) |
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.
For EVM execution without witnessCache
, who will clear the table?
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.
Probably the whole witnessCache
code path should be put behind compile time flag.
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.
For EVM execution without
witnessCache
, who will clear the table?
It appears that the existing code does not clear the witnessCache. Perhaps the previous logic to clear the witnessCache was removed at some point.
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.
Probably the whole
witnessCache
code path should be put behind compile time flag.
Great point, I guess this has the risk of impacting performance without the compile time flag. Actually I was thinking about rewriting and improving the witnessCache code to make it better suited to what I'm doing and putting it behind a compile time flag as you suggested.
I'll remove the witness cache change from this PR and do it in a future PR with the improved implementation.
Changes in this PR: