Skip to content

Conversation

magicxyyz
Copy link
Contributor

@magicxyyz magicxyyz commented Nov 8, 2024

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Nov 8, 2024
@magicxyyz magicxyyz changed the base branch from master to ondemand-module-compile November 8, 2024 15:51
@magicxyyz magicxyyz marked this pull request as ready for review November 15, 2024 15:19
Base automatically changed from ondemand-module-compile to master January 10, 2025 04:50
@magicxyyz magicxyyz assigned tsahee and unassigned magicxyyz Apr 8, 2025
@tsahee tsahee added the after-next-version This PR shouldn't be merged until after the next version is released label Apr 11, 2025
@eljobe eljobe removed the after-next-version This PR shouldn't be merged until after the next version is released label Jun 3, 2025
@magicxyyz magicxyyz changed the title use MessageRunMode struct use MessageRunContext struct Jun 12, 2025
Copy link
Contributor

@tsahee tsahee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small change required in tests. other changes are for thought/can be done later

if err := PopulateStylusTargetCache(targetConfig); err != nil {
return fmt.Errorf("error populating stylus target cache: %w", err)
}
s.wasmTargets = targetConfig.WasmTargets()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not right now - but I wonder if we can move the targetConfig to a different place.. though we'll still need that Initialize call


func createNonL1BlockChainWithStackConfig(
t *testing.T, info *BlockchainTestInfo, dataDir string, chainConfig *params.ChainConfig, arbOSInit *params.ArbOSInit, initMessage *arbostypes.ParsedInitMessage, stackConfig *node.Config, execConfig *gethexec.Config, wasmCacheTag uint32, useFreezer bool,
t *testing.T, info *BlockchainTestInfo, dataDir string, chainConfig *params.ChainConfig, arbOSInit *params.ArbOSInit, initMessage *arbostypes.ParsedInitMessage, stackConfig *node.Config, execConfig *gethexec.Config, useFreezer bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be important.
By default, tests did not use wasmCache. Now there is no way to turn it off.
We might want/need to add cachetag as a parameter to both ExecutionEngine and NewMessageCommitContext.
It only affects system tests, though, which seem to be passing, and there are very few stylus contracts in tests so I'm certainly not worried about mem usage..
still, somethin remember/watch

Copy link
Contributor Author

@magicxyyz magicxyyz Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we discussed it briefly before: #2779 (comment)
but looking into future, any interactions between different tests that change their execution might make the tests unreliable/indeterministic and we should avoid it. The global cache of deserialized stylus modules changes slightly the execution, either we call wasmer deserialization function or we get the result from cache - the exec difference doesn't seem to be huge, and if I am correct it is contained within the deserialization of module, so maybe not that bad.

Currently it seems that all program_test tests have DontParallelise set, so eitherway that shouldn't be an issue currently, only other tests that use stylus programs might be affected (still in limited way of only having shared wasmer deserialization cache)

Copy link
Contributor Author

@magicxyyz magicxyyz Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In future, we could either support overwriting wasm cache tag to not use the global cache, or maybe we could refactor the cache to not be a global cache and support multiple instances of the cache for test purposes (although I am not sure if that's worth extra complexity)

@tsahee tsahee assigned magicxyyz and unassigned tsahee Jun 26, 2025
Copy link
Contributor

@tsahee tsahee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tsahee tsahee enabled auto-merge June 27, 2025 19:14
@tsahee tsahee merged commit fe6d174 into master Jun 27, 2025
24 of 25 checks passed
@tsahee tsahee deleted the run-mode-struct branch June 27, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design-approved s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants