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

Random number seed setter #61

Closed
RyuMaster opened this issue Oct 25, 2019 · 3 comments
Closed

Random number seed setter #61

RyuMaster opened this issue Oct 25, 2019 · 3 comments

Comments

@RyuMaster
Copy link
Collaborator

In order to unit-test front-end properly, there needs to be a way to make sure, that random number generator always produces same numbers for the same moves both on mainnet and regtest. Hence, we need a way to manually feed seed into mainnet generator, and then use same for the regtest, which will make them identical

@domob1812
Copy link
Collaborator

Why do you need this? That's somewhat hard, because the RNG is seeded based on the block hashes. We could introduce some way to control this with e.g. command-line flags, but that then seems like a risk since people could accidentally get out of sync with everyone else by using those. (Or someone with malicious intents could convince people who do not know what they are doing to set those flags.)

@RyuMaster
Copy link
Collaborator Author

Hmmmmm. I am just looking or an easy way to make front-end unit testing, but if that bring such complications, let it be then

@domob1812
Copy link
Collaborator

Yes sure, but I don't understand for what exactly you need this RNG seeding change. If mainnet contains "enough complicated" behaviour to test the frontend, just let it sync to the actual mainnet chain block by block (e.g. using invalidateblock and reconsiderblock) to test the frontend.

Otherwise, you could just create a script that creates some situations you want to test on regtest similar to our integration tests for the GSP, for which you don't need a particular RNG seed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants