Open
Conversation
jayz22
reviewed
Mar 12, 2026
| } | ||
| currCompiledWasmBytes += mModuleCache->get_wasm_bytes_input(v); | ||
| } | ||
| if (currCompiledWasmBytes > (2 * lastCompiledWasmBytes)) |
Contributor
There was a problem hiding this comment.
I think the mModuleCacheRebuildBytes only counts a Wasm contract bytes once, whereas currCompiledWasmBytes counts the total bytes across all protocols (which means the the same Wasm contract is counted multiple times).
So currCompiledWasmBytes will always be larger than 2 * lastCompiledWasmBytes since there are three active protocols (23,24,25)?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This does a little simplification on the arithmetic we were doing to track thresholds of module cache rebuilding, as well as clarifying when we're measuring input vs. output values in the cost model. Also it moves the module cache tests to a separate file, as part of my long term dream to split InvokeHostFunctionTests.cpp into multiple files.
One disappointing part about this is that the tweak above reveals that the
ApplyStatestate-invariant-checking that @SirTyson put in back in #4819 was actually slightly incorrect: thefinishPendingCompilationmethod does actually write toApplyStatewhen it's inREADY_TO_APPLY(it did back then too, it just didn't happen to occur in tests before). I can't think of any really great way to avoid this (the whole point is to defer the implied variable-update/stall until the last moment before we'll need it) besides I guess we could like add in another state? I don't know if that would win much, but I'd be willing to if that's your preference @SirTyson ?