Skip to content
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

Improve Randomness in Emulator #509

Closed
chasefleming opened this issue Nov 16, 2023 · 1 comment · Fixed by #511
Closed

Improve Randomness in Emulator #509

chasefleming opened this issue Nov 16, 2023 · 1 comment · Fixed by #511
Assignees
Labels
Feature A new user feature or a new package API Feedback

Comments

@chasefleming
Copy link
Member

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.
@chasefleming chasefleming added Feature A new user feature or a new package API Feedback labels Nov 16, 2023
@chasefleming chasefleming self-assigned this Nov 16, 2023
@bluesign
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A new user feature or a new package API Feedback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants