Improve Randomness in Emulator
chasefleming opened this issue · 1 comments
chasefleming commented
Current Behavior
In the Flow emulator, the randomness is derived from a constant source of randomness. This constant usage results in repetitive randomness patterns.
Ideal Behavior:
- Dynamic Randomness per Block: For a better user experience, particularly when simulating transactions/scripts against different blocks, it would be ideal to have different random values per block.
- Utilizing Block ID: Instead of the hardcoded SoR constant, the suggestion is to use a block ID (if present) in the emulator to generate the SoR. This would create dynamic randomness per block.
Impact and Rationale
- Enhances Testing Realism: This change would make emulator testing more reflective of real-world scenarios, where randomness varies per block.
- No Security Concerns for Emulator: Using a block hash is not secure for TestNet/MainNet, but in the emulator context, security is not a primary concern, making this approach fine for improving user experience.
bluesign commented
note: here we should also consider debugging mainnet/testnet transactions, probably we will not have access to SoR but we can at least mention it in the docs maybe.